mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-06-26 12:31:32 +02:00
util: Cleanup
This commit is contained in:
parent
54486bc905
commit
55503fbc60
@ -41,24 +41,20 @@ class Color:
|
|||||||
def read_file(input_file):
|
def read_file(input_file):
|
||||||
"""Read data from a file and trim newlines."""
|
"""Read data from a file and trim newlines."""
|
||||||
with open(input_file, "r") as file:
|
with open(input_file, "r") as file:
|
||||||
data = file.read().splitlines()
|
return file.read().splitlines()
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
def read_file_json(input_file):
|
def read_file_json(input_file):
|
||||||
"""Read data from a json file."""
|
"""Read data from a json file."""
|
||||||
with open(input_file, "r") as json_file:
|
with open(input_file, "r") as json_file:
|
||||||
data = json.load(json_file)
|
return json.load(json_file)
|
||||||
|
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
def read_file_raw(input_file):
|
def read_file_raw(input_file):
|
||||||
"""Read data from a file as is, don't strip
|
"""Read data from a file as is, don't strip
|
||||||
newlines or other special characters.."""
|
newlines or other special characters.."""
|
||||||
with open(input_file, "r") as file:
|
with open(input_file, "r") as file:
|
||||||
data = file.readlines()
|
return file.readlines()
|
||||||
return data
|
|
||||||
|
|
||||||
|
|
||||||
def save_file(data, export_file):
|
def save_file(data, export_file):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user