1 """ pokedex.defaults - logic for finding default paths """
5 def get_default_db_uri_with_origin():
6 uri
= os
.environ
.get('POKEDEX_DB_ENGINE', None)
11 sqlite_path
= pkg_resources
.resource_filename('pokedex',
12 'data/pokedex.sqlite')
13 uri
= 'sqlite:///' + sqlite_path
18 def get_default_index_dir_with_origin():
19 index_dir
= os
.environ
.get('POKEDEX_INDEX_DIR', None)
20 origin
= 'environment'
24 index_dir
= pkg_resources
.resource_filename('pokedex',
28 return index_dir
, origin
30 def get_default_csv_dir_with_origin():
32 csv_dir
= pkg_resources
.resource_filename('pokedex', 'data/csv')
35 return csv_dir
, origin
38 def get_default_db_uri():
39 return get_default_db_uri_with_origin()[0]
41 def get_default_index_dir():
42 return get_default_index_dir_with_origin()[0]
44 def get_default_csv_dir():
45 return get_default_csv_dir_with_origin()[0]