1. Flo Ledermann
  2. pdfgen

Commits

Flo Ledermann  committed cfaa144

going back to using data_files and working out path to there

  • Participants
  • Parent commits 35279a6
  • 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']
-#    },
     entry_points = {
         'console_scripts': [
             'html2pdf = flyingpython:html_to_pdf',

File src/python/flyingpython/__init__.py

View file
+import subprocess
+import codecs
+import sys
+import os
 
 
 def get_jar_path():
     """Return the full path to the PDFGen Java archive."""
     #return resource_filename(__name__, "pdfgen.jar")
-    return 'bin/pdfgen/pdfgen.jar'
+    return os.path.join(sys.prefix, 'bin/pdfgen/pdfgen.jar')
 
 PDF_COMMAND = 'java -cp %s com.floledermann.pdf.PDFRenderer' % get_jar_path()
 
                          stdout=subprocess.PIPE, 
                          stdin=subprocess.PIPE, 
                          stderr=subprocess.PIPE)
-    
-    import sys, codecs, locale   
-        
+            
     p2 = codecs.getwriter('utf-8')(p.stdin)    
     p2.write(html)
     p2.close()