1 | """ |
||
2 | Settings used by Elodie. |
||
3 | """ |
||
4 | |||
5 | from os import environ, path |
||
6 | from sys import version_info |
||
7 | |||
8 | #: If True, debug messages will be printed. |
||
9 | debug = False |
||
10 | |||
11 | #: Directory in which to store Elodie settings. |
||
12 | application_directory = '{}/.elodie'.format(path.expanduser('~')) |
||
13 | if ( |
||
14 | 'ELODIE_APPLICATION_DIRECTORY' in environ and |
||
15 | path.isdir(environ['ELODIE_APPLICATION_DIRECTORY']) |
||
16 | ): |
||
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
17 | application_directory = environ['ELODIE_APPLICATION_DIRECTORY'] |
||
18 | |||
19 | #: File in which to store details about media Elodie has seen. |
||
20 | hash_db = '{}/hash.json'.format(application_directory) |
||
21 | |||
22 | #: File in which to store geolocation details about media Elodie has seen. |
||
23 | location_db = '{}/location.json'.format(application_directory) |
||
24 | |||
25 | #: Elodie installation directory. |
||
26 | script_directory = path.dirname(path.dirname(path.abspath(__file__))) |
||
27 | |||
28 | #: Path to Elodie's ExifTool config file. |
||
29 | exiftool_config = path.join(script_directory, 'configs', 'ExifTool_config') |
||
30 | |||
31 | #: Path to MapQuest base URL |
||
32 | mapquest_base_url = 'https://open.mapquestapi.com' |
||
33 | if ( |
||
34 | 'ELODIE_MAPQUEST_BASE_URL' in environ and |
||
35 | environ['ELODIE_MAPQUEST_BASE_URL'] != '' |
||
36 | ): |
||
37 | mapquest_base_url = environ['ELODIE_MAPQUEST_BASE_URL'] |
||
38 | |||
39 | #: MapQuest key from environment |
||
40 | mapquest_key = None |
||
41 | if ( |
||
42 | 'ELODIE_MAPQUEST_KEY' in environ and |
||
43 | environ['ELODIE_MAPQUEST_KEY'] != '' |
||
44 | ): |
||
0 ignored issues
–
show
|
|||
45 | mapquest_key = environ['ELODIE_MAPQUEST_KEY'] |
||
46 | |||
47 | #: Accepted language in responses from MapQuest |
||
48 | accepted_language = 'en' |
||
49 | |||
50 | # check python version, required in filesystem.py to trigger appropriate method |
||
51 | python_version = version_info.major |
||
52 |