diff options
| author | Dylan Araps <dylanaraps@users.noreply.github.com> | 2017-12-20 21:28:16 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-20 21:28:16 +1100 |
| commit | b39df715ff2365d8d1c9fa670d8e571d69373c87 (patch) | |
| tree | 42feb98a57aff3210d311c2c72a65b159b2781a4 /pywal/export.py | |
| parent | 7407a260dac91ff94d655d6838ba9a12ba14d128 (diff) | |
| parent | 4d20ea1e51a24d7b8000529d8f73b9dbd7f262a4 (diff) | |
Merge pull request #142 from dylanaraps/user_temp
general: Added user template support.
Diffstat (limited to 'pywal/export.py')
| -rw-r--r-- | pywal/export.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pywal/export.py b/pywal/export.py index 5aaf2c6..92e64fe 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -3,7 +3,7 @@ Export colors in various formats. """ import os -from .settings import CACHE_DIR, MODULE_DIR +from .settings import CACHE_DIR, MODULE_DIR, CONF_DIR from . import util @@ -42,13 +42,19 @@ def get_export_type(export_type): def every(colors, output_dir=CACHE_DIR): """Export all template files.""" - all_colors = flatten_colors(colors) + colors = flatten_colors(colors) template_dir = os.path.join(MODULE_DIR, "templates") + template_dir_user = os.path.join(CONF_DIR, "templates") + util.create_dir(template_dir_user) for file in os.scandir(template_dir): - template(all_colors, file.path, os.path.join(output_dir, file.name)) + template(colors, file.path, os.path.join(output_dir, file.name)) + + for file in os.scandir(template_dir_user): + template(colors, file.path, os.path.join(output_dir, file.name)) print("export: Exported all files.") + print("export: Exported all user files.") def color(colors, export_type, output_file=None): |
