def update_and_open_db(self): if self.analysis_only: self._open_db() else: # #Check if todays price file is created # reader = db_util.open_reader_fixed('names') for row in reader: self.nameArray.append(row) if db_util.check_update('price'): print "Found Update" self._open_db() else: # # Check if today is a market day # if self._today_is_market_day(): print "TODAY IS MARKET DAY" # # Update Price and SMA DB (opens them too) # self.update_price_db() self.update_sma_db() else: self._open_db()
last_quote = retArray[1] last_date = last_quote[0].split('-'); day = last_date[2]; today = date.today().day if int(today) == int(day): return 1 else: return 0 # # Update for today if needed # def _update_and_open_db() # Check if todays file is created if db_util.check_update('price'): priceArray = db_util.open_reader('price') smaArray = db_util.open_reader('sma') else: # Check if today is a market day if today_is_market_day(): # Update Price and SMA DB update_price_db(): update_sma_db(): arrayUpdated = 1 else: priceArray = db_util.open_reader('price') smaArray = db_util.open_reader('sma') def _update_symbol_list() FilePtr = open('.update_symbols')