mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-29 11:24:03 +01:00
util: Update docs
This commit is contained in:
parent
7ac8099b96
commit
a288d35ef7
@ -40,29 +40,29 @@ def set_grey(colors):
|
|||||||
|
|
||||||
|
|
||||||
def read_file(input_file):
|
def read_file(input_file):
|
||||||
"""Read colors from a file."""
|
"""Read data from a file."""
|
||||||
with open(input_file) as file:
|
with open(input_file) as file:
|
||||||
colors = file.read().splitlines()
|
data = file.read().splitlines()
|
||||||
return colors
|
return data
|
||||||
|
|
||||||
|
|
||||||
def read_file_json(input_file):
|
def read_file_json(input_file):
|
||||||
"""Read colors from a json file."""
|
"""Read data from a json file."""
|
||||||
with open(input_file) as json_file:
|
with open(input_file) as json_file:
|
||||||
colors = json.load(json_file)
|
data = json.load(json_file)
|
||||||
return colors
|
return data
|
||||||
|
|
||||||
|
|
||||||
def save_file(colors, export_file):
|
def save_file(data, export_file):
|
||||||
"""Write the colors to the file."""
|
"""Write data to a file."""
|
||||||
with open(export_file, "w") as file:
|
with open(export_file, "w") as file:
|
||||||
file.write(colors)
|
file.write(data)
|
||||||
|
|
||||||
|
|
||||||
def save_file_json(colors, export_file):
|
def save_file_json(data, export_file):
|
||||||
"""Write the colors to a json file."""
|
"""Write data to a json file."""
|
||||||
with open(export_file, "w") as file:
|
with open(export_file, "w") as file:
|
||||||
json.dump(colors, file, indent=4)
|
json.dump(data, file, indent=4)
|
||||||
|
|
||||||
|
|
||||||
def create_dir(directory):
|
def create_dir(directory):
|
||||||
|
Loading…
Reference in New Issue
Block a user