-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest_install.py
36 lines (27 loc) · 1 KB
/
test_install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python3
# -*- coding: utf-8 -*-
try:
from docxfactory import WordProcessingCompiler
except ImportError as e:
print('\nDocxFactory python3 module WAS NOT installed correctly! Error:')
print('-' * 30)
print(e)
print('-' * 30)
print('TIPS: there might be something missing during DocxFactory installation,')
print(' read the error msg above and install the missing dependencies.')
print(' For example: you may be missing "libXext" library, install it by "yum install libXext".\n')
else:
print('DocxFactory is successfully installed!')
try:
compiler = WordProcessingCompiler.get_instance()
compiler.compile(
'/opt/DocxFactory/exercises/templates/top_level_items.docx',
'/opt/DocxFactory/exercises/templates/top_level_items.dfw'
)
print('DocxFactory works as expected!\n')
except Exception as e:
print('DocxFactory NOT work as expected. Error:')
print('-' * 30)
print(e)
print('-' * 30)
print('TIPS: you may need to read the DocxFactory tutorial manual for troubleshooting.\n')