From 0d884cab4300d30e2a4c92eda78cae91e1abdfaa Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 16 Sep 2019 08:10:16 -0400 Subject: [PATCH] cleanup --- bake/cli.py | 1 - bake/config.py | 46 ---------------------------------------------- setup.py | 2 +- 3 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 bake/config.py diff --git a/bake/cli.py b/bake/cli.py index 6e689b6..98c47ca 100644 --- a/bake/cli.py +++ b/bake/cli.py @@ -3,7 +3,6 @@ import click import json from .bakefile import Bakefile -from .config import config from .clint import eng_join import pygments diff --git a/bake/config.py b/bake/config.py deleted file mode 100644 index 7f4ca92..0000000 --- a/bake/config.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -import json - -import appdirs - - -class ConfigStore: - CONFIG_DIR = appdirs.user_config_dir("bashr") - CONFIG_FILE = os.path.join(CONFIG_DIR, "config.json") - os.makedirs(CONFIG_DIR, exist_ok=True) - - __data = {"ENVIRON_WHITELIST": []} - - def __repr__(self): - return f"" - - def __getitem__(self, key): - return self.get(key) - - def __setitem__(self, key, value): - return self.set(key, value) - - @property - def data(self): - if not self.__data: - with open(self.CONFIG_FILE, "r") as f: - self.__data = json.load(f) - return self.__data - - @data.setter - def data(self, value): - self.__data = value - self.save() - - def save(self): - with open(self.CONFIG_FILE, "w") as f: - json.dump(self.data, f) - - def get(self, key, default=None): - return self.data.get(key, default) - - def set(self, key, value): - self.data[key] = value - - -config = ConfigStore() diff --git a/setup.py b/setup.py index 9a0afd9..3576716 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ REQUIRES_PYTHON = ">=3.6.0" VERSION = "0.1.0" # What packages are required for this module to be executed? -REQUIRED = ["click", "delegator.py", "pygments", "appdirs"] +REQUIRED = ["click", "delegator.py", "pygments"] # What packages are optional? EXTRAS = {