-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_infos.py
More file actions
39 lines (29 loc) · 1.08 KB
/
update_infos.py
File metadata and controls
39 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Mise a jour des details de la version 403
python update_ucd_infos.py -v 403 -c data/ucd.json ucd
"""
import argparse
import watchdog
from easy_atom import helpers
def main():
parser = argparse.ArgumentParser()
parser.add_argument("ref", choices=['ucd'], help="referentiel : ucd")
parser.add_argument("-v", "--version", help="""version a mettre a jour""")
parser.add_argument("-c", "--conf", help="""fichier de configuration""")
args = parser.parse_args()
print(f'Ref : {args.ref}')
print(f'version : {args.version}')
print(f'fichier de config : {args.conf}')
print(f'Lecture du fichier {args.conf}')
data = helpers.load_json(args.conf)
for data_vers in data['versions']:
if data_vers['version']==args.version:
html = watchdog.UCDWatchDog.format_html_compl(args.version, data_vers['files'])
print(html)
data_vers['html'] = html
helpers.save_json(args.conf, data)
print(f'Ecriture du fichier {args.conf}')
if __name__ == "__main__":
main()