mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-02-18 11:11:01 +01:00
General: Cleanup
This commit is contained in:
parent
137d986742
commit
d4c181fa47
13
wal
13
wal
@ -19,7 +19,7 @@ __version__ = "0.1"
|
|||||||
|
|
||||||
# Internal variables.
|
# Internal variables.
|
||||||
COLOR_COUNT = 16
|
COLOR_COUNT = 16
|
||||||
CACHE_DIR = pathlib.Path("%s%s" % (os.path.expanduser("~"), "/.cache/wal/"))
|
CACHE_DIR = pathlib.Path.home() / ".cache/wal/"
|
||||||
|
|
||||||
|
|
||||||
class ColorFormats(object): # pylint: disable=too-few-public-methods
|
class ColorFormats(object): # pylint: disable=too-few-public-methods
|
||||||
@ -78,6 +78,7 @@ def process_args(args):
|
|||||||
# -c
|
# -c
|
||||||
if args.c:
|
if args.c:
|
||||||
shutil.rmtree(CACHE_DIR / "schemes")
|
shutil.rmtree(CACHE_DIR / "schemes")
|
||||||
|
create_cache_dir()
|
||||||
|
|
||||||
# -r
|
# -r
|
||||||
if args.r:
|
if args.r:
|
||||||
@ -86,8 +87,6 @@ def process_args(args):
|
|||||||
# -i
|
# -i
|
||||||
if args.i:
|
if args.i:
|
||||||
image = str(get_image(args.i))
|
image = str(get_image(args.i))
|
||||||
|
|
||||||
# Get the colors.
|
|
||||||
colors = get_colors(image)
|
colors = get_colors(image)
|
||||||
|
|
||||||
# Set the wallpaper.
|
# Set the wallpaper.
|
||||||
@ -465,13 +464,17 @@ def save_file(colors, export_file):
|
|||||||
file.write(colors)
|
file.write(colors)
|
||||||
|
|
||||||
|
|
||||||
|
def create_cache_dir():
|
||||||
|
"""Alias to create the cache dir."""
|
||||||
|
pathlib.Path(CACHE_DIR / "schemes").mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main script function."""
|
"""Main script function."""
|
||||||
# Create colorscheme dir.
|
create_cache_dir()
|
||||||
pathlib.Path(CACHE_DIR / "schemes").mkdir(parents=True, exist_ok=True)
|
|
||||||
|
|
||||||
# Get the args.
|
# Get the args.
|
||||||
args = get_args()
|
args = get_args()
|
||||||
|
Loading…
Reference in New Issue
Block a user