2016-01-08 23:49:06 +01:00
|
|
|
"""
|
2021-07-30 07:41:02 +02:00
|
|
|
Settings.
|
2016-01-08 23:49:06 +01:00
|
|
|
"""
|
|
|
|
|
2019-04-01 07:10:38 +02:00
|
|
|
from os import environ, path
|
2017-01-22 06:21:03 +01:00
|
|
|
from sys import version_info
|
2015-10-10 09:02:53 +02:00
|
|
|
|
2016-01-08 23:49:06 +01:00
|
|
|
#: If True, debug messages will be printed.
|
2016-01-27 16:27:12 +01:00
|
|
|
debug = False
|
2016-01-08 23:49:06 +01:00
|
|
|
|
2021-07-30 07:41:02 +02:00
|
|
|
#: Directory in which to store Dozo settings.
|
|
|
|
application_directory = '{}/.dozo'.format(path.expanduser('~'))
|
2019-04-01 07:10:38 +02:00
|
|
|
if (
|
|
|
|
'ELODIE_APPLICATION_DIRECTORY' in environ and
|
|
|
|
path.isdir(environ['ELODIE_APPLICATION_DIRECTORY'])
|
|
|
|
):
|
|
|
|
application_directory = environ['ELODIE_APPLICATION_DIRECTORY']
|
2016-01-08 23:49:06 +01:00
|
|
|
|
2021-07-29 18:42:31 +02:00
|
|
|
default_path = '{%Y-%m-%b}/{album}|{city}|{"Unknown Location"}'
|
|
|
|
default_name = '{%Y-%m-%d_%H-%M-%S}-{original_name}-{title}.{ext}'
|
2021-07-30 07:41:02 +02:00
|
|
|
default_geocoder = 'Nominatim'
|
|
|
|
# Checksum storage file.
|
2021-06-12 19:49:29 +02:00
|
|
|
hash_db = 'hash.json'
|
|
|
|
# TODO will be removed eventualy later
|
|
|
|
# hash_db = '{}/hash.json'.format(application_directory)
|
2016-01-08 23:49:06 +01:00
|
|
|
|
2021-07-30 07:41:02 +02:00
|
|
|
# Geolocation details file.
|
2021-06-12 19:49:29 +02:00
|
|
|
location_db = 'location.json'
|
|
|
|
# TODO will be removed eventualy later
|
|
|
|
# location_db = '{}/location.json'.format(application_directory)
|
2016-01-08 23:49:06 +01:00
|
|
|
|
2021-07-30 07:41:02 +02:00
|
|
|
# Dozo installation directory.
|
2015-10-21 08:51:14 +02:00
|
|
|
script_directory = path.dirname(path.dirname(path.abspath(__file__)))
|
2016-01-08 23:49:06 +01:00
|
|
|
|
2021-07-30 07:41:02 +02:00
|
|
|
#: Path to ExifTool config file.
|
2016-02-12 00:24:42 +01:00
|
|
|
exiftool_config = path.join(script_directory, 'configs', 'ExifTool_config')
|
2016-01-28 19:30:13 +01:00
|
|
|
|
2019-04-01 09:56:37 +02:00
|
|
|
#: Path to MapQuest base URL
|
|
|
|
mapquest_base_url = 'https://open.mapquestapi.com'
|
|
|
|
if (
|
|
|
|
'ELODIE_MAPQUEST_BASE_URL' in environ and
|
|
|
|
environ['ELODIE_MAPQUEST_BASE_URL'] != ''
|
|
|
|
):
|
|
|
|
mapquest_base_url = environ['ELODIE_MAPQUEST_BASE_URL']
|
|
|
|
|
|
|
|
#: MapQuest key from environment
|
|
|
|
mapquest_key = None
|
|
|
|
if (
|
|
|
|
'ELODIE_MAPQUEST_KEY' in environ and
|
|
|
|
environ['ELODIE_MAPQUEST_KEY'] != ''
|
|
|
|
):
|
|
|
|
mapquest_key = environ['ELODIE_MAPQUEST_KEY']
|
|
|
|
|
2016-01-28 19:30:13 +01:00
|
|
|
#: Accepted language in responses from MapQuest
|
|
|
|
accepted_language = 'en'
|
2017-01-22 06:21:03 +01:00
|
|
|
|
|
|
|
# check python version, required in filesystem.py to trigger appropriate method
|
|
|
|
python_version = version_info.major
|
2021-04-16 20:02:14 +02:00
|
|
|
|
|
|
|
CONFIG_FILE = '%s/config.ini' % application_directory
|