util: Update docs

This commit is contained in:
Dylan Araps 2017-07-07 10:51:14 +10:00
parent 7ac8099b96
commit a288d35ef7

View File

@ -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):