__init__.py 481 B

123456789101112131415161718192021
  1. import json
  2. from pathlib import Path
  3. __init__ = ['ENGINES_LANGUGAGES', 'CURRENCIES', 'USER_AGENTS', 'bangs_loader']
  4. data_dir = Path(__file__).parent
  5. def load(filename):
  6. # add str(...) for Python 3.5
  7. with open(str(data_dir / filename), encoding='utf-8') as fd:
  8. return json.load(fd)
  9. def bangs_loader():
  10. return load('bangs.json')
  11. ENGINES_LANGUAGES = load('engines_languages.json')
  12. CURRENCIES = load('currencies.json')
  13. USER_AGENTS = load('useragents.json')