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:
parent
b15eb1031d
commit
03bf5e618f
@ -1,7 +1,13 @@
|
|||||||
import json
|
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_headers = {'User-Agent': 'pirate get'}
|
||||||
default_timeout = 10
|
default_timeout = 10
|
||||||
|
1
setup.py
1
setup.py
@ -9,6 +9,7 @@ setup(name='pirate-get',
|
|||||||
author_email='me@viktorstanchev.com',
|
author_email='me@viktorstanchev.com',
|
||||||
license='GPL',
|
license='GPL',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
|
package_data={'': ["data/*.json"]},
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': ['pirate-get = pirate.pirate:main']
|
'console_scripts': ['pirate-get = pirate.pirate:main']
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user