mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-26 01:43:15 +01:00
colors: Add error handling to reload
This commit is contained in:
parent
b684e1604e
commit
0a64877b1e
7
wal
7
wal
@ -498,7 +498,10 @@ def read_file(input_file):
|
|||||||
|
|
||||||
def reload_colors(vte):
|
def reload_colors(vte):
|
||||||
"""Reload colors."""
|
"""Reload colors."""
|
||||||
with open(CACHE_DIR / "sequences") as file:
|
sequence_file = pathlib.Path(CACHE_DIR / "sequences")
|
||||||
|
|
||||||
|
if sequence_file.is_file():
|
||||||
|
with open(sequence_file, "r") as file:
|
||||||
sequences = file.read()
|
sequences = file.read()
|
||||||
|
|
||||||
# If vte mode was used, remove the problem sequence.
|
# If vte mode was used, remove the problem sequence.
|
||||||
@ -507,8 +510,8 @@ def reload_colors(vte):
|
|||||||
|
|
||||||
# Decode the string.
|
# Decode the string.
|
||||||
sequences = bytes(sequences, "utf-8").decode("unicode_escape")
|
sequences = bytes(sequences, "utf-8").decode("unicode_escape")
|
||||||
|
|
||||||
print(sequences, end="")
|
print(sequences, end="")
|
||||||
|
|
||||||
quit()
|
quit()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user