1. Flo Ledermann
  2. pdfgen

Commits

Flo Ledermann  committed 35279a6

tweaking jar path

  • Participants
  • Parent commits b5da35a
  • Branches default

Comments (0)

Files changed (2)

File setup.py

View file
     license='GPL',
     package_dir = {'': 'src/python'},
     packages=['flyingpython'],
-    package_data={
-        'flyingpython': ["scripts/*.jar"]
-    },
+#    package_data={
+#        'flyingpython': ['scripts/*.jar']
+#    },
     entry_points = {
         'console_scripts': [
             'html2pdf = flyingpython:html_to_pdf',
         ],
     },
-    #data_files=[('bin/pdfgen',['scripts/pdfgen.jar'])],
+    data_files=[('bin/pdfgen',['scripts/pdfgen.jar'])],
     classifiers=[
         'Development Status :: 3 - Alpha',
         'Environment :: Web Environment',

File src/python/flyingpython/__init__.py

View file
 
-PDF_COMMAND = 'java -cp bin/pdfgen.jar com.floledermann.pdf.PDFRenderer'
+
+def get_jar_path():
+    """Return the full path to the PDFGen Java archive."""
+    #return resource_filename(__name__, "pdfgen.jar")
+    return 'bin/pdfgen/pdfgen.jar'
+
+PDF_COMMAND = 'java -cp %s com.floledermann.pdf.PDFRenderer' % get_jar_path()
 
 def html_to_pdf(html):
-    p = subprocess.Popen(settings.PDF_COMMAND, 
+    p = subprocess.Popen(PDF_COMMAND, 
                          shell=True, 
                          stdout=subprocess.PIPE, 
                          stdin=subprocess.PIPE,