Use xdg config path
This commit is contained in:
@@ -3,9 +3,6 @@ import os
|
||||
|
||||
import toml
|
||||
|
||||
# TODO: proper path loading
|
||||
CONFIG_PATH = os.path.expanduser("~/.config/emulsion/config.toml")
|
||||
|
||||
# Default Schema
|
||||
# This defines the "First Class" feel of the app, but is fully overridable.
|
||||
DEFAULT_CONFIG = {
|
||||
@@ -56,9 +53,17 @@ DEFAULT_CONFIG = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def get_config_path():
|
||||
xdg_config_home = os.environ.get(
|
||||
'XDG_CONFIG_HOME', os.path.expanduser('~/.config')
|
||||
)
|
||||
return os.path.join(xdg_config_home, 'emulsion', 'config.toml')
|
||||
|
||||
|
||||
class ConfigLoader:
|
||||
def __init__(self, path=CONFIG_PATH):
|
||||
self.path = path
|
||||
def __init__(self, path=None):
|
||||
self.path = path or get_config_path()
|
||||
self.config = copy.deepcopy(DEFAULT_CONFIG)
|
||||
|
||||
def load(self):
|
||||
|
||||
Reference in New Issue
Block a user