Skip to content

Commit

Permalink
[Mod] flak8代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy committed Jul 31, 2022
1 parent d9fd597 commit bddbc0a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vnpy_uft/api/generator/generate_api_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,17 @@ def generate_source_task(self) -> None:
f.write("\t{\n")
f.write(f"\t\t{type_} *task_error = new {type_}();\n")
f.write(f"\t\t*task_error = *{field};\n")
f.write(f"\t\ttask.task_error = task_error;\n")
f.write("\t\ttask.task_error = task_error;\n")
f.write("\t}\n")
else:
f.write(f"\tif ({field})\n")
f.write("\t{\n")
f.write(f"\t\t{type_} *task_data = new {type_}();\n")
f.write(f"\t\t*task_data = *{field};\n")
f.write(f"\t\ttask.task_data = task_data;\n")
f.write("\t\ttask.task_data = task_data;\n")
f.write("\t}\n")

f.write(f"\tthis->task_queue.push(task);\n")
f.write("\tthis->task_queue.push(task);\n")
f.write("};\n\n")

def generate_source_switch(self) -> None:
Expand All @@ -202,7 +202,7 @@ def generate_source_switch(self) -> None:
f.write(f"case {name.upper()}:\n")
f.write("{\n")
f.write(f"\tthis->{process_name}(&task);\n")
f.write(f"\tbreak;\n")
f.write("\tbreak;\n")
f.write("}\n\n")

def generate_source_process(self) -> None:
Expand Down Expand Up @@ -330,7 +330,7 @@ def generate_source_on(self) -> None:
f.write("\t}\n")
f.write("\tcatch (const error_already_set &e)\n")
f.write("\t{\n")
f.write(f"\t\tcout << e.what() << endl;\n")
f.write("\t\tcout << e.what() << endl;\n")
f.write("\t}\n")
f.write("};\n\n")

Expand Down

0 comments on commit bddbc0a

Please sign in to comment.