diff --git a/src/DocumentLibrary/FileConverters/wpd.py b/src/DocumentLibrary/FileConverters/wpd.py new file mode 100644 index 0000000..762f9ec --- /dev/null +++ b/src/DocumentLibrary/FileConverters/wpd.py @@ -0,0 +1,22 @@ +"""wpd to text file converter for Document Library""" + +from os import popen, remove, path +from Globals import package_home + +content_type = 'application/wordperfect' + +content_description = """WordPerfect [WordPerfect]""" + +catwpd_file = path.join(package_home(globals()), 'catwpd') +# Uses catwpd, found in the wpConverter directory. See wpConverter/README for +# information on installing catwpd +# Requires write access to /tmp + +def convert(documentFile): + """Convert WordPerfect data to raw text""" + + tmp_name = documentFile._writeToTempFile() + text = popen('%s %s ' % (catwpd_file, tmp_name)).read() + remove(tmp_name) + + return text diff --git a/src/DocumentLibrary/document_icons/wordperfect_large.gif b/src/DocumentLibrary/document_icons/wordperfect_large.gif new file mode 100644 index 0000000..cd719a3 --- /dev/null +++ b/src/DocumentLibrary/document_icons/wordperfect_large.gif Binary files differ diff --git a/src/DocumentLibrary/document_icons/wordperfect_small.gif b/src/DocumentLibrary/document_icons/wordperfect_small.gif new file mode 100644 index 0000000..6d5f726 --- /dev/null +++ b/src/DocumentLibrary/document_icons/wordperfect_small.gif Binary files differ