From 8fedb42ebdd72eaf077b568b3fd533bb849310da Mon Sep 17 00:00:00 2001 From: OKelt Date: Mon, 11 Nov 2019 22:27:01 -0800 Subject: [PATCH] created Config static variables TUIR_CONFIG_HOME, TUIR_DATA_HOME; refactored paths for other static variables to use these values set Config.MAILCAP to TUIR_CONFIG_HOME/mailcap (TUIR_CONFIG_HOME = $XDG_CONFIG_HOME/tuir) --- tuir/config.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tuir/config.py b/tuir/config.py index 69fdd41..7a8a4d5 100644 --- a/tuir/config.py +++ b/tuir/config.py @@ -27,11 +27,13 @@ class Config(object): DEFAULT_THEMES = os.path.join(PACKAGE, 'themes') XDG_CONFIG_HOME = os.getenv('XDG_CONFIG_HOME', os.path.join(HOME, '.config')) XDG_DATA_HOME = os.getenv('XDG_DATA_HOME', os.path.join(HOME, '.local', 'share')) - CONFIG = os.path.join(XDG_CONFIG_HOME, 'tuir', 'tuir.cfg') - MAILCAP = os.path.join(HOME, '.mailcap') - TOKEN = os.path.join(XDG_DATA_HOME, 'tuir', 'refresh-token') - HISTORY = os.path.join(XDG_DATA_HOME, 'tuir', 'history.log') - THEMES = os.path.join(XDG_CONFIG_HOME, 'tuir', 'themes') + TUIR_CONFIG_HOME = os.path.join(XDG_CONFIG_HOME, 'tuir') + TUIR_DATA_HOME = os.path.join(XDG_DATA_HOME, 'tuir') + CONFIG = os.path.join(TUIR_CONFIG_HOME, 'tuir.cfg') + MAILCAP = os.path.join(TUIR_CONFIG_HOME, 'mailcap') + TOKEN = os.path.join(TUIR_DATA_HOME, 'refresh-token') + HISTORY = os.path.join(TUIR_DATA_HOME, 'history.log') + THEMES = os.path.join(TUIR_CONFIG_HOME, 'themes') COMPACT_FORMAT = "%t\n" \ "<%i|%s%v|%cC> %r%e %a %S %F"