mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-15 08:26:14 +00:00
write updates back to same file
This commit is contained in:
parent
7fde3f5ab6
commit
f9f67eb6e1
|
@ -57,14 +57,11 @@ def do_hash(file):
|
|||
|
||||
args = argparse.ArgumentParser()
|
||||
args.add_argument("--repo", default=".", help="The directory of the Wesnoth repository to run this script against.")
|
||||
args.add_argument("--output", default="output.csv", help="The file to write the results of this script to.")
|
||||
args.add_argument("--output", default="copyrights.csv", help="The file to write the results of this script to.")
|
||||
args.add_argument("--input", default="copyrights.csv", help="The file to read the existing copyright data from.")
|
||||
options = args.parse_args()
|
||||
os.chdir(options.repo)
|
||||
|
||||
with contextlib.suppress(FileNotFoundError):
|
||||
os.remove(options.output)
|
||||
|
||||
csv_data = {}
|
||||
# Too few fields
|
||||
missing_fields = []
|
||||
|
@ -103,6 +100,9 @@ with open(options.input, encoding="utf-8") as csvfile:
|
|||
|
||||
csv_data[file] = row
|
||||
|
||||
with contextlib.suppress(FileNotFoundError):
|
||||
os.remove(options.output)
|
||||
|
||||
for root, _, files in os.walk(options.repo):
|
||||
for filename in files:
|
||||
filetype = Path(filename).suffix
|
||||
|
|
Loading…
Reference in New Issue
Block a user