general: Don't hardcode cache location in api

This commit is contained in:
Dylan Araps 2017-12-30 07:31:45 +11:00
parent 35ce506563
commit 31eb532843
2 changed files with 4 additions and 3 deletions

View File

@ -94,9 +94,6 @@ def process_args(args):
sys.exit(0)
if args.r:
sys.stderr.write("'wal -r' is deprecated: "
"Use 'cat ~/.cache/wal/sequences' instead.\n")
reload.colors()
sys.exit(0)

View File

@ -4,6 +4,7 @@ Reload programs.
import os
import shutil
import subprocess
import sys
from .settings import CACHE_DIR, HOME, MODULE_DIR, OS
from . import util
@ -60,6 +61,9 @@ def colors(cache_dir=CACHE_DIR):
"""Reload colors. (Deprecated)"""
sequences = os.path.join(cache_dir, "sequences")
sys.stderr.write("'wal -r' is deprecated: "
"Use 'cat %s' instead.\n" % sequences)
if os.path.isfile(sequences):
print("".join(util.read_file(sequences)), end="")