732129160549c66761f52172c9ef62e2dd067f1f
1 """ pokedex.defaults - logic for finding default paths """
6 def get_default_db_uri_with_origin():
7 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'
23 index_dir
= pkg_resources
.resource_filename('pokedex',
27 return index_dir
, origin
29 def get_default_csv_dir_with_origin():
30 csv_dir
= pkg_resources
.resource_filename('pokedex', 'data/csv')
33 return csv_dir
, origin
36 def get_default_db_uri():
37 return get_default_db_uri_with_origin()[0]
39 def get_default_index_dir():
40 return get_default_index_dir_with_origin()[0]
42 def get_default_csv_dir():
43 return get_default_csv_dir_with_origin()[0]