def __init__(self, paramDict, **kwargs): super(SDownload, self).__init__(**kwargs) self.paramDict = paramDict self.app = self.paramDict.get(CONSTS.S_APP) self.datatype_dropdown = DatatypeDropDown() self.datatypebtn_id.bind(on_release=self.datatype_dropdown.open) self.datatype_dropdown.bind(on_select=self.datatypeSelect) self.accountIDDropDown = SAccountIDDropDown() firstRecord = True accountIdList = self.app.accountIdList for astr in accountIdList: if firstRecord == True: firstRecord = False self.account_id.text = astr abtn = SButton(text=astr) abtn.size_hint_y = None abtn.height = 30 abtn.bind(on_release=self.accountIDDropDown.select) self.accountIDDropDown.add_widget(abtn) self.account_id.bind(on_release=self.accountIDDropDown.open) self.accountIDDropDown.bind(on_select=self.accountSelect) self.startdate_id.bind(focus=self.onFocus) self.initial_data()
def __init__(self, paramDict, **kwargs): super(SExecTrade, self).__init__(**kwargs) self.paramDict = paramDict self.app = self.paramDict.get(CONSTS.S_APP) self.sysConfDict = self.app.confDict.get(CONSTS.SYS_CONF_DICT) self.strategyDict = {} self.rowdata_id.bind(focus=self.onRowdataFocus) self.strategyDropDown = SStrategyDropDown() firstRecord = True strategyList = None filePath = os.path.join(os.path.dirname(__file__), ".." + os.sep + "conf" + os.sep + "strategy.ini") alist = sutil.getListFromFile(filePath) for astr in alist: strategyList = astr.strip().split(",") if len(strategyList) < 2: continue if firstRecord: firstRecord = False self.strategy_id.text = strategyList[0] self.strategyDict[strategyList[0]] = strategyList abtn = SButton(text=strategyList[0]) abtn.size_hint_y = None abtn.height = 30 abtn.bind(on_release=self.strategyDropDown.select) self.strategyDropDown.add_widget(abtn) self.strategy_id.bind(on_release=self.strategyDropDown.open) self.strategyDropDown.bind(on_select=self.strategySelect) self.savefile_id.bind(focus=self.onSavefileFocus)