diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-08-10 09:17:11 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-08-10 09:17:11 +1000 |
| commit | 05c271c3a7faf0e31c28df4a7743c8ce4369c670 (patch) | |
| tree | 4a415c27c24f9441e49f7339847e17c002623376 /pywal/export.py | |
| parent | 979ec3ee1025e90c536ec013aa8b8fa29bed3a21 (diff) | |
general: Remove all pathlib usage
Diffstat (limited to 'pywal/export.py')
| -rw-r--r-- | pywal/export.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pywal/export.py b/pywal/export.py index d621672..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(str(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,10 +55,10 @@ 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("export: Exported %s." % export_type) else: |
