Refine
This commit is contained in:
@@ -387,7 +387,14 @@ def convert_inp_v3_to_v2(inp: str) -> ChangeSet:
|
||||
create_project(project)
|
||||
open_project(project)
|
||||
|
||||
parse_file(project, inp, '3')
|
||||
filename = f'inp/{project}_temp.inp'
|
||||
if os.path.exists(filename):
|
||||
os.remove(filename)
|
||||
|
||||
with open(filename, 'w') as f:
|
||||
f.write(inp)
|
||||
|
||||
parse_file(project, filename, '3')
|
||||
|
||||
'''try:
|
||||
parse_file(project, inp, version)
|
||||
|
||||
6
main.py
6
main.py
@@ -1826,13 +1826,7 @@ async def fastapi_convert_v3_to_v2(req: Request) -> ChangeSet:
|
||||
network = 'v3Tov2'
|
||||
jo_root = await req.json()
|
||||
inp = jo_root['inp']
|
||||
|
||||
print(inp)
|
||||
|
||||
cs = convert_inp_v3_to_v2(inp)
|
||||
|
||||
print(cs)
|
||||
|
||||
op = cs.operations[0]
|
||||
open_project(network)
|
||||
op['vertex'] = json.dumps(get_all_vertices(network))
|
||||
|
||||
Reference in New Issue
Block a user