MCPcopy
hub / github.com/Guovin/iptv-api / update_file

Function update_file

utils/tools.py:121–131  ·  view source on GitHub ↗

Update the file

(final_file, old_file, copy=False)

Source from the content-addressed store, hash-verified

119
120
121def update_file(final_file, old_file, copy=False):
122 """
123 Update the file
124 """
125 old_file_path = resource_path(old_file, persistent=True)
126 final_file_path = resource_path(final_file, persistent=True)
127 if os.path.exists(old_file_path):
128 if copy:
129 shutil.copyfile(old_file_path, final_file_path)
130 else:
131 os.replace(old_file_path, final_file_path)
132
133
134def filter_by_date(data):

Callers

nothing calls this directly

Calls 1

resource_pathFunction · 0.90

Tested by

no test coverage detected