1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-10 10:04:21 +01:00

Properly handle extra source files

This commit is contained in:
rnhmjoj 2015-08-31 02:12:07 +00:00
parent b15eb1031d
commit 03bf5e618f
4 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,13 @@
import json
import pkgutil
categories = json.load(open('data/categories.json'))
sorts = json.load(open('data/sorts.json'))
def get_resource(filename):
return pkgutil.get_data(__package__, 'data/' + filename)
categories = json.loads(get_resource('categories.json').decode())
sorts = json.loads(get_resource('sorts.json').decode())
default_headers = {'User-Agent': 'pirate get'}
default_timeout = 10

View File

@ -9,6 +9,7 @@ setup(name='pirate-get',
author_email='me@viktorstanchev.com',
license='GPL',
packages=find_packages(),
package_data={'': ["data/*.json"]},
entry_points={
'console_scripts': ['pirate-get = pirate.pirate:main']
},