summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2017-06-29 19:56:09 +1000
committerDylan Araps <dylan.araps@gmail.com>2017-06-29 19:56:09 +1000
commitd9a22726cbb260cae7e7fdaf1fe4b8d69caab80f (patch)
tree18513ee5a74def418bd3c9b9d048004cd45391e0
parent5e5908a01360ba36bd1c7ab3223dfef3dfedd02a (diff)
template: Don't make dir a constant.
-rwxr-xr-xpywal/export_colors.py11
-rwxr-xr-xpywal/settings.py2
2 files changed, 7 insertions, 6 deletions
diff --git a/pywal/export_colors.py b/pywal/export_colors.py
index b3c4025..7af9741 100755
--- a/pywal/export_colors.py
+++ b/pywal/export_colors.py
@@ -4,13 +4,13 @@ Export colors in various formats.
import os
import pathlib
-from pywal.settings import CACHE_DIR, TEMPLATE_DIR
+from pywal.settings import CACHE_DIR
from pywal import util
def template(colors, input_file, output_dir):
"""Read template file, substitute markers and
- save the file elsewhere."""
+ save the file elsewhere."""
# Get the template name.
template_file = os.path.basename(input_file)
@@ -30,6 +30,9 @@ def template(colors, input_file, output_dir):
def export_all_templates(colors):
"""Export all template files."""
+ # Add the template dir to module path.
+ template_dir = os.path.join(os.path.dirname(__file__), "templates")
+
# Exclude these templates from the loop.
# The excluded templates need color
# conversion or other intervention.
@@ -44,10 +47,10 @@ def export_all_templates(colors):
# pylint: disable=W0106
[template(colors["colors"], file.path, CACHE_DIR)
- for file in os.scandir(TEMPLATE_DIR)
+ for file in os.scandir(template_dir)
if file.name not in exclude]
# Call 'putty' manually since it needs RGB
# colors.
- putty_file = TEMPLATE_DIR / pathlib.Path("colors-putty.reg")
+ putty_file = template_dir / pathlib.Path("colors-putty.reg")
template(colors_rgb, putty_file, CACHE_DIR)
diff --git a/pywal/settings.py b/pywal/settings.py
index d920103..d94b7eb 100755
--- a/pywal/settings.py
+++ b/pywal/settings.py
@@ -1,7 +1,6 @@
"""
Global Constants.
"""
-import os
import pathlib
@@ -11,4 +10,3 @@ __version__ = "0.2.6"
# Internal variables.
COLOR_COUNT = 16
CACHE_DIR = pathlib.Path.home() / ".cache/wal/"
-TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), "templates")