def update_all(): _info('starting daily update procedure..') with open('stok.list', 'r') as f: ids = f.readlines() f.close() for i in ids: u = ogerutil(i) ### TODO, FIXME, this is bad to decide init() by check db file. ### we do immediatedly merge to db when download only one month data.... if u.isDBFileExist(): _info('updating #%d' % int(i)) update(i) else: _info('initialize #%d' % int(i)) _info('it may take times to download, please be patient') _info('%s' % time.strftime('%c')) init(int(i))
def __init__(self, sid): self.stock_id = sid self.u = ogerutil(sid) self.d = ogerdate() self.dl = ogerdownloader(sid) #build rfields - <n>:'name' for i in self.fields: self.rfields[self.fields[i][0]] = i #we do register all extend fields cal function here... self.fields['Volume'][1] = self.calVolume self.fields['MA5'][1] = self.calMA5 self.fields['MA10'][1] = self.calMA10 self.fields['MA20'][1] = self.calMA20 self.fields['MA60'][1] = self.calMA60 self.fields['MA120'][1] = self.calMA120 self.fields['9RSV'][1] = self.cal9RSV self.fields['9K'][1] = self.cal9K self.fields['9D'][1] = self.cal9D
def __init__(self, sid): self.stock_id = sid self.u = ogerutil(sid) self.d = ogerdate()