|
1 | 1 | from typing import List, Optional |
2 | 2 | from frost_sta_client.odata_codegen.generator import generate_from_url |
3 | 3 |
|
4 | | -def write_part_of_init(path): |
5 | | - str = """from frost_sta_client import model |
6 | | -from frost_sta_client import dao |
7 | | -from frost_sta_client import query |
8 | | -from frost_sta_client import service |
9 | | -
|
10 | | -import jsonpickle |
11 | | -
|
12 | | -jsonpickle.load_backend('demjson3', 'encode', 'decode', 'JSONDecodeError') |
13 | | -jsonpickle.set_preferred_backend('demjson3') |
14 | | -jsonpickle.set_decoder_options("demjson3", decode_float=float) |
15 | | -
|
16 | | -from .__version__ import (__title__, __version__, __license__, __author__, __contact__, __url__, |
17 | | - __description__, __copyright__) |
18 | | -""" |
19 | | - with open(path, 'w', encoding='utf-8') as file: |
20 | | - file.write(str) |
21 | | - |
22 | | -def write_full_init(path): |
| 4 | +def write_init(path): |
23 | 5 | str = """from frost_sta_client import model |
24 | 6 | from frost_sta_client import dao |
25 | 7 | from frost_sta_client import query |
@@ -64,9 +46,8 @@ def main(argv: Optional[List[str]] = None) -> int: |
64 | 46 | output_dir="frost_sta_client/generated/odata" |
65 | 47 | module="datamodel" |
66 | 48 | auth=None |
67 | | - write_part_of_init(init_path) |
68 | 49 | generate_from_url(url, output_dir, module, auth=auth) |
69 | | - write_full_init(init_path) |
| 50 | + write_init(init_path) |
70 | 51 | return 0 |
71 | 52 |
|
72 | 53 | if __name__ == '__main__': |
|
0 commit comments