aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Vilcans <martin@librador.com>2014-10-14 23:09:31 +0200
committerMartin Vilcans <martin@librador.com>2014-10-14 23:09:56 +0200
commit58711bbda0c2354b7a173ddebf4809cfbdf2cfad (patch)
tree3aa21191f2dc56e37c16341c15a0300ed39751f0
parent1e565b5761129f75258e01666d67f99e91adff47 (diff)
downloadscreenplain-58711bbda0c2354b7a173ddebf4809cfbdf2cfad.tar.gz
Check for Reportlab. Required for PDF output.
-rw-r--r--screenplain/export/pdf.py9
-rwxr-xr-xsetup.py6
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,
diff --git a/setup.py b/setup.py
index 86c53f6..b158c28 100755
--- a/setup.py
+++ b/setup.py
@@ -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',