def appendTreses(tmp_rates_every_step): tmp_treses = util.getProperty('tmp_treses') if tmp_treses is not None: tmp_treses.append(tmp_rates_every_step) else: tmp_treses = [tmp_rates_every_step] util.setProperty('tmp_treses', tmp_treses)
def pushPosition(position): o = { 'available': True, 'position': position, 'createtime': util.getYMDHMS() } position_flow = util.getProperty('position_flow') if position_flow is None: util.setProperty('position_flow', [o]) else: position_flow.append(o) util.removeProperty('position_flow') util.setProperty('position_flow', position_flow)
def getNowPosition(): position_flow = util.getProperty('position_flow') if position_flow is None: return 0 else: return int(position_flow[-1].get('position'))