1. 3k
  2. pilpal

Commits

3k  committed e97141f

fixed issue with setup and finding files after install

  • Participants
  • Parent commits 34a01dc
  • Branches default

Comments (0)

Files changed (4)

File .hgignore

View file
 .settings
 MANIFEST
 dist
+build
 *.pyc
 *.png
 *.jpg

File bin/pilpal

View file
     print("pilpal {0}".format(pp.__version__))
 
 try:
+    here = os.getcwd()
+    sys.path.append(here)
+    image_file = os.path.join(here, image_file)
     if not os.path.exists(input_file):
         if not args.force_create:
             s = raw_input("Do you want to create '{0}'? [y/n]: ".format(input_file))

File pilpal/pilpal.py

View file
         self.old_label_img = None
         self.running = False
         self.delay = 0.1
-        self.font_book = ImageFont.truetype(Theme.FONT_BOOK, Theme.FONT_SIZE)
-        self.font_bold = ImageFont.truetype(Theme.FONT_BOLD, Theme.FONT_SIZE)
+        self.font_book = ImageFont.truetype(os.path.join(os.path.dirname(__file__), Theme.FONT_BOOK), Theme.FONT_SIZE)
+        self.font_bold = ImageFont.truetype(os.path.join(os.path.dirname(__file__), Theme.FONT_BOLD), Theme.FONT_SIZE)
 
     def log(self, s, deco=None):
         if self.silent:

File setup.py

View file
     download_url="https://bitbucket.org/3k/pilpal/",
     scripts=["bin/pilpal"],
     packages=["pilpal"],
-    data_files=[
-        ("", ["README", "CHANGES", "COPYING"]),
-        ("fonts", [Theme.FONT_BOOK, Theme.FONT_BOLD, "fonts/NOTICE"])],
+    package_data={
+        "pilpal": [Theme.FONT_BOOK, Theme.FONT_BOLD, "fonts/NOTICE"]},
     requires=["PIL"],
     classifiers=[
         "Topic :: Multimedia :: Graphics"