Skip to content

Commit 8852253

Browse files
committed
Merge pull request #1 from samuelcolvin/fix-heroku
Fix heroku
2 parents 19ba23e + 2fb097d commit 8852253

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

pydf/bin/wkhtmltopdf-heroku

-44.5 MB
Binary file not shown.

pydf/wkhtmltopdf.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import subprocess
33
from tempfile import NamedTemporaryFile
44

5-
__version__ = '0.1'
5+
__version__ = '0.2'
66

77

88
def execute_wk(*args):
@@ -13,8 +13,7 @@ def execute_wk(*args):
1313
:return: stdout, stderr
1414
"""
1515
this_dir = os.path.dirname(__file__)
16-
on_heroku = 'DYNO' in os.environ
17-
wk_name = 'wkhtmltopdf-heroku' if on_heroku else 'wkhtmltopdf'
16+
wk_name = 'wkhtmltopdf'
1817
wkhtmltopdf_default = os.path.join(this_dir, 'bin', wk_name)
1918
# Reference command
2019
wkhtmltopdf_cmd = os.environ.get('WKHTMLTOPDF_CMD', wkhtmltopdf_default)
@@ -120,7 +119,12 @@ def get_version():
120119
:return: version string
121120
"""
122121
v = 'pydf version: %s\n' % __version__
123-
v += 'wkhtmltopdf version: %s' % execute_wk('-V')[0]
122+
try:
123+
wk_version = execute_wk('-V')[0]
124+
except Exception, e:
125+
# we catch all errors here to make sure we get a version no matter what
126+
wk_version = 'Error: %s' % str(e)
127+
v += 'wkhtmltopdf version: %s' % wk_version
124128
return v
125129

126130

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name='pydf',
11-
version='0.1',
11+
version='0.2',
1212
description=description,
1313
author='Samuel Colvin',
1414
license='MIT',

0 commit comments

Comments
 (0)