Skip to content

Commit

Permalink
__init__: remove some hardcoded magic strings
Browse files Browse the repository at this point in the history
  • Loading branch information
hlef committed Jul 7, 2019
1 parent 43ec397 commit 04e1cab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions juliet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ def init(args):
logging.debug("Installing default theme")
default_theme_path = os.path.join(args.dir, paths.THEMES_PATH, defaults.DEFAULT_THEME_NAME)
os.makedirs(default_theme_path, exist_ok=True)
with zipfile.ZipFile(resource_filename(__name__, "resources/gram.zip")) as zipped_theme:
with zipfile.ZipFile(resource_filename(__name__, "resources/" +
defaults.DEFAULT_THEME_NAME + ".zip")) as zipped_theme:
zipped_theme.extractall(path=default_theme_path)

logging.debug("Importing default config file")
shutil.copyfile(os.path.join(default_theme_path, "config.yml.EX"), os.path.join(args.dir, paths.CFG_FILE))
shutil.copyfile(os.path.join(default_theme_path, paths.EXAMPLE_CFG_FILE),
os.path.join(args.dir, paths.CFG_FILE))

def parse_arguments(args):
""" Parse and return arguments. """
Expand Down
3 changes: 3 additions & 0 deletions juliet/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@
PAGES_BUILDDIR = ""
DATA_BUILDDIR = ""
ASSETS_BUILDDIR = "assets"

# theme dirs
EXAMPLE_CFG_FILE = CFG_FILE + ".EX"

0 comments on commit 04e1cab

Please sign in to comment.