ordigi/ordigi/constants.py

32 lines
740 B
Python
Raw Permalink Normal View History

2016-01-08 23:49:06 +01:00
"""
Settings.
2016-01-08 23:49:06 +01:00
"""
from os import environ
from pathlib import Path
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-12-05 13:39:02 +01:00
# Ordigi settings directory.
def get_config_dir(name):
if 'XDG_CONFIG_HOME' in environ:
confighome = Path(environ['XDG_CONFIG_HOME'])
elif 'APPDATA' in environ:
confighome = Path(environ['APPDATA'])
else:
confighome = Path(environ['HOME'], '.config')
2021-08-13 21:11:24 +02:00
return confighome / name
2021-04-16 20:02:14 +02:00
2021-12-05 13:39:02 +01:00
APPLICATION_DIRECTORY = get_config_dir('ordigi')
2022-04-18 08:57:47 +02:00
DEFAULT_PATH = '<%Y-%m-%b>/<album>|<city>'
DEFAULT_NAME = '<%Y-%m-%d_%H-%M-%S>-<name>-<title>.%l<ext>'
2021-11-13 10:03:53 +01:00
DEFAULT_PATH_FORMAT = DEFAULT_PATH + '/' + DEFAULT_NAME
DEFAULT_GEOCODER = 'Nominatim'
CONFIG_FILE = APPLICATION_DIRECTORY / 'ordigi.conf'