def save(self,fn=None): # generate list of strings TO;FROM;RATE curs = [] for eachCurrency in self.m_currencies: used,rate = self.m_currencies[eachCurrency] curs.append("%s;%s;%.8f"%(eachCurrency[:3],eachCurrency[3:],rate)) # open and write the file with these currencies information itrade_csv.write(fn,os.path.join(itrade_config.dirCacheData,'currencies.txt'),curs)
def save(self,fn=None): # open and write the file with these alerts information itrade_csv.write(fn,os.path.join(itrade_config.dirUserData,'alerts.txt'),self.m_alerts.values()) for eachAlert in self.listAlerts(): ref = eachAlert.reference() self.saveFile(ref,'lnk',eachAlert.link()) self.saveFile(ref,'txt',eachAlert.desc()) self.m_dirty = False
def save(self,fn=None): # open and write the file with these alerts information itrade_csv.write(fn, itrade_config.default_alerts_file(), self.m_alerts.values()) for eachAlert in self.listAlerts(): ref = eachAlert.reference() self.saveFile(ref,'lnk',eachAlert.link()) self.saveFile(ref,'txt',eachAlert.desc()) self.m_dirty = False
def save(self,outfile=None): #debug('Trades::save %s %s' % (self.m_quote.ticker(),self.m_quote.key())) if self.m_trades.keys(): # do not save today trade ajd = date.today() if self.m_trades.has_key(ajd): tr = self.m_trades[ajd] del self.m_trades[ajd] if itrade_config.verbose: info('Do not save ajd=%s:%s' % (ajd,tr)) else: tr = None # save all trades (except today) itrade_csv.write(outfile,os.path.join(itrade_config.dirCacheData,'%s.txt' % self.m_quote.key()),self.m_trades.values()) self.m_dirty = False # restore today trade if tr: self.m_trades[ajd] = tr
def save(self, fn): itrade_csv.write( None, os.path.join(itrade_config.dirUserData, '%s.matrix.txt' % fn), self.m_quotes.values())
def save(self,fn): itrade_csv.write(None,os.path.join(itrade_config.dirUserData,'%s.matrix.txt' % fn),self.m_quotes.values())