diff options
author | Martin Vilcans <martin@librador.com> | 2014-10-14 23:09:31 +0200 |
---|---|---|
committer | Martin Vilcans <martin@librador.com> | 2014-10-14 23:09:56 +0200 |
commit | 58711bbda0c2354b7a173ddebf4809cfbdf2cfad (patch) | |
tree | 3aa21191f2dc56e37c16341c15a0300ed39751f0 | |
parent | 1e565b5761129f75258e01666d67f99e91adff47 (diff) | |
download | screenplain-58711bbda0c2354b7a173ddebf4809cfbdf2cfad.tar.gz |
Check for Reportlab. Required for PDF output.
-rw-r--r-- | screenplain/export/pdf.py | 9 | ||||
-rwxr-xr-x | setup.py | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/screenplain/export/pdf.py b/screenplain/export/pdf.py index b5f0fb0..76b4d4a 100644 --- a/screenplain/export/pdf.py +++ b/screenplain/export/pdf.py @@ -2,6 +2,15 @@ # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php +import sys + +try: + import reportlab +except ImportError: + sys.stderr.write('ERROR: ReportLab is required for PDF output\n') + raise +del reportlab + from reportlab.lib import pagesizes from reportlab.platypus import ( BaseDocTemplate, @@ -9,9 +9,9 @@ setup( author='Martin Vilcans', author_email='screenplain@librador.com', url='http://www.screenplain.com/', - requires=[ - 'reportlab', - ], + extras_require={ + 'PDF': 'reportlab' + }, packages=[ 'screenplain', 'screenplain.export', |