Skip to content

Commit

Permalink
🐛 init toolbar after login
Browse files Browse the repository at this point in the history
  • Loading branch information
shidenggui committed Jun 26, 2020
1 parent bb1c4d1 commit 2411cee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion easytrader/clienttrader.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def connect(self, exe_path=None, **kwargs):
self._app = pywinauto.Application().connect(path=connect_path, timeout=10)
self._close_prompt_windows()
self._main = self._app.top_window()
self._toolbar = self._main.child_window(class_name="ToolbarWindow32")
self._init_toolbar()

@property
def broker_type(self):
Expand All @@ -127,6 +127,9 @@ def balance(self):

return self._get_balance_from_statics()

def _init_toolbar(self):
self._toolbar = self._main.child_window(class_name="ToolbarWindow32")

def _get_balance_from_statics(self):
result = {}
for key, control_id in self._config.BALANCE_CONTROL_ID_GROUP.items():
Expand Down Expand Up @@ -536,3 +539,4 @@ def prepare(
comm_password,
**kwargs
)
self._init_toolbar()

0 comments on commit 2411cee

Please sign in to comment.