Skip to content

Commit

Permalink
[Mod] flake8代码质量优化
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy committed Jul 31, 2022
1 parent ecaee3a commit 956a26b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion vnpy_esunny/api/generator/esunny_md_commen_struct.py
Expand Up @@ -28,4 +28,3 @@
"OldPassword": "string",
"NewPassword": "string",
}

1 change: 0 additions & 1 deletion vnpy_esunny/api/generator/esunny_md_data_struct.py
Expand Up @@ -97,4 +97,3 @@
"QTotalAskQty": "unsigned long long",
"UnderlyContract": "dict",
}

3 changes: 0 additions & 3 deletions vnpy_esunny/api/generator/esunny_td_data_struct.py
Expand Up @@ -1278,6 +1278,3 @@
"ManagerConfigFileLen": "int",
"ManagerConfigFileText": "char",
}

#} 删除1282行

10 changes: 5 additions & 5 deletions vnpy_esunny/api/generator/generate_api_functions.py
Expand Up @@ -93,7 +93,7 @@ def process_line(self, line: str):
elif "virtual TAPIINT32 TAP_CDECL Qry" in line:
self.process_function(line)
elif self.name == "td":
if "virtual void ES_CDECL On" in line:
if "virtual void ES_CDECL On" in line:
self.process_callback(line)
elif "virtual TAPIINT32 ES_CDECL Qry" in line:
self.process_function(line)
Expand Down Expand Up @@ -277,10 +277,10 @@ def generate_source_task(self):
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):
Expand All @@ -292,7 +292,7 @@ def generate_source_switch(self):
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):
Expand Down Expand Up @@ -420,7 +420,7 @@ def generate_source_on(self):
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 956a26b

Please sign in to comment.