From d1df651b4035e9f6130658e8c1fd2d0fc92dc8a7 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 16 Jul 2019 12:34:29 +0800 Subject: [PATCH] [Mod] improve code quality --- vnpy/api/mini/generator/generate_struct.py | 11 +++-------- vnpy/gateway/bitmex/bitmex_gateway.py | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/vnpy/api/mini/generator/generate_struct.py b/vnpy/api/mini/generator/generate_struct.py index 612faa4e..a7dbb658 100644 --- a/vnpy/api/mini/generator/generate_struct.py +++ b/vnpy/api/mini/generator/generate_struct.py @@ -28,13 +28,7 @@ class StructGenerator: self.f_struct = open(f"{self.prefix}_struct.py", "w") for line in self.f_cpp: - try: - self.process_line(line) - except: - print("--------------------------") - print(line) - import traceback - traceback.print_exc() + self.process_line(line) self.f_cpp.close() self.f_struct.close() @@ -86,5 +80,6 @@ class StructGenerator: if __name__ == "__main__": - generator = StructGenerator("../include/mini/ThostFtdcUserApiStruct.h", "mini") + generator = StructGenerator( + "../include/mini/ThostFtdcUserApiStruct.h", "mini") generator.run() diff --git a/vnpy/gateway/bitmex/bitmex_gateway.py b/vnpy/gateway/bitmex/bitmex_gateway.py index 549200a1..ca62365f 100644 --- a/vnpy/gateway/bitmex/bitmex_gateway.py +++ b/vnpy/gateway/bitmex/bitmex_gateway.py @@ -252,7 +252,7 @@ class BitmexRestApi(RestClient): def send_order(self, req: OrderRequest): """""" if not self.check_rate_limit(): - return "" + return "" orderid = str(self.connect_time + self._new_order_id())