Commit 5307b30a authored by Dan Pascu's avatar Dan Pascu

Fixed including all necessary resources in the distribution

parent 6166c76c
include MANIFEST.in TODO run include MANIFEST.in TODO run
include bin/blink include bin/blink
recursive-include resources *.ui graft doc
recursive-include resources/chat style.xml *.style *.html *.css *.png *.svg *.jpg *.py graft resources
recursive-include resources/icons *.png *.svg *.ico *.mng prune resources/icons/work
recursive-include resources/sounds *.wav
recursive-include resources/tls *.crt
recursive-include doc *.txt *.html install.*
...@@ -13,6 +13,9 @@ def get_version(): ...@@ -13,6 +13,9 @@ def get_version():
def find_packages(toplevel): def find_packages(toplevel):
return [directory.replace(os.path.sep, '.') for directory, subdirs, files in os.walk(toplevel) if '__init__.py' in files] return [directory.replace(os.path.sep, '.') for directory, subdirs, files in os.walk(toplevel) if '__init__.py' in files]
def list_resources(directory, destination_directory):
return [(dir.replace(directory, destination_directory), [os.path.join(dir, file) for file in files]) for dir, subdirs, files in os.walk(directory)]
setup(name = "blink", setup(name = "blink",
version = get_version(), version = get_version(),
author = "AG Projects", author = "AG Projects",
...@@ -29,10 +32,7 @@ setup(name = "blink", ...@@ -29,10 +32,7 @@ setup(name = "blink",
"Programming Language :: Python" "Programming Language :: Python"
], ],
packages = find_packages('blink'), packages = find_packages('blink'),
data_files = [('share/blink', glob.glob('resources/*.ui')), data_files = list_resources('resources', destination_directory='share/blink'),
('share/blink/icons', list(chain(*(glob.glob('resources/icons/*.%s' % ext) for ext in ('png', 'svg', 'mng', 'ico'))))),
('share/blink/sounds', glob.glob('resources/sounds/*.wav'))
],
scripts = ['bin/blink'] scripts = ['bin/blink']
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment