Skip to content

Commit 879ffd0

Browse files
committed
chore: simplify generation of built-in model
1 parent 467b8f0 commit 879ffd0

1 file changed

Lines changed: 2 additions & 21 deletions

File tree

frost_sta_client/odata_codegen/install_model_simple.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
from typing import List, Optional
22
from frost_sta_client.odata_codegen.generator import generate_from_url
33

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):
235
str = """from frost_sta_client import model
246
from frost_sta_client import dao
257
from frost_sta_client import query
@@ -64,9 +46,8 @@ def main(argv: Optional[List[str]] = None) -> int:
6446
output_dir="frost_sta_client/generated/odata"
6547
module="datamodel"
6648
auth=None
67-
write_part_of_init(init_path)
6849
generate_from_url(url, output_dir, module, auth=auth)
69-
write_full_init(init_path)
50+
write_init(init_path)
7051
return 0
7152

7253
if __name__ == '__main__':

0 commit comments

Comments
 (0)