diff options
| author | Dylan Araps <dylanaraps@users.noreply.github.com> | 2017-08-12 18:42:27 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-12 18:42:27 +1000 |
| commit | 8be48c07fff889ed085744cc0cf585b6d0b71a89 (patch) | |
| tree | 839edfa96574721cc6fc82ef18059d75ebef792e /pywal/export.py | |
| parent | f14aaf5a4fd1847a5316f9c41965daebc23db818 (diff) | |
| parent | c743cab4f0b74e928496c2a5052906da52acc8f7 (diff) | |
Merge pull request #79 from dylanaraps/35
general: Add support for Python 3.5
Diffstat (limited to 'pywal/export.py')
| -rw-r--r-- | pywal/export.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/pywal/export.py b/pywal/export.py index 748e3a9..d2db143 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -2,7 +2,6 @@ Export colors in various formats. """ import os -import pathlib from .settings import CACHE_DIR, MODULE_DIR from . import util @@ -43,10 +42,10 @@ def get_export_type(export_type): def every(colors, output_dir=CACHE_DIR): """Export all template files.""" all_colors = flatten_colors(colors) - output_dir = pathlib.Path(output_dir) + template_dir = os.path.join(MODULE_DIR, "templates") - for file in os.scandir(MODULE_DIR / "templates"): - template(all_colors, file.path, output_dir / file.name) + for file in os.scandir(template_dir): + template(all_colors, file.path, os.path.join(output_dir, file.name)) print("export: Exported all files.") @@ -56,11 +55,11 @@ def color(colors, export_type, output_file=None): all_colors = flatten_colors(colors) template_name = get_export_type(export_type) - template_file = MODULE_DIR / "templates" / template_name - output_file = output_file or CACHE_DIR / template_name + template_file = os.path.join(MODULE_DIR, "templates", template_name) + output_file = output_file or os.path.join(CACHE_DIR, template_name) - if template_file.is_file(): + if os.path.isfile(template_file): template(all_colors, template_file, output_file) - print(f"export: Exported {export_type}.") + print("export: Exported %s." % export_type) else: - print(f"[!] warning: template '{export_type}' doesn't exist.") + print("warning: template '%s' doesn't exist." % export_type) |
