Skip to content
Browse files

Remove hardcoded theme prefix and use theme.prefix instead

  • Loading branch information...
1 parent 058e39a commit b08fb8ec4b80eaedc49e63c3f0e1eb6c74af7426 @FichteFoll FichteFoll committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 livecss/file_operations.py
View
8 livecss/file_operations.py
@@ -13,6 +13,7 @@
from os import remove as rm
from os.path import exists, basename, join
from glob import glob
+from .theme import theme
import sublime
@@ -22,7 +23,7 @@
def clean_junk():
"""Cleans `Color Scheme - Default` directory"""
packages_path = sublime.packages_path()
- old_themes = [glob(join(packages_path, f, 'Colorized-*')) for f in listdir(packages_path)]
+ old_themes = [glob(join(packages_path, f, theme.prefix + '*')) for f in listdir(packages_path)]
for path in compact(flatten(old_themes)):
rm_if_exists(path)
@@ -34,7 +35,8 @@ def rm_if_exists(path):
def rm_theme(path):
- """Removes given `path` and .cache file for it"""
- if basename(path).startswith('Colorized-'):
+ """Removes given `path` and .cache file for it;
+ if it is a generateted theme file"""
+ if basename(path).startswith(theme.prefix):
rm_if_exists(path)
rm_if_exists(path + '.cache')

0 comments on commit b08fb8e

Please sign in to comment.
Something went wrong with that request. Please try again.