def updateMCPFAIList(self): MCPFAI = [] file_def = open("def/MCPFAI_def.dat") file_res = open("def/MCPFAI_res.dat") report_def = file_def.read() report_res = file_res.read() info = self.get.runFundsReport(report_def, report_res, date.today()) for data in info: fund = Fund() fund.Name = data[0][1] fund.ID = data[1][1] fund.DMRR = datetime.strptime(data[2][1], "%m/%d/%Y") fund.incept_date = datetime.strptime(data[3][1], "%m/%d/%Y") fund.IL = "MCP Fund or Index" fund.Class = "MCP Fund or Index" fund.DMRR = self.getActualDMRR(fund.ID, fund.DMRR) MCPFAI.append(fund) tmp_file = open(self.cache_path + "lists/MCPFAI_funds.cache", 'w') cPickle.dump(MCPFAI, tmp_file) tmp_file.close()
def updateMCPFAIList(self): MCPFAI = [] file_def = open("def/MCPFAI_def.dat") file_res = open("def/MCPFAI_res.dat") report_def = file_def.read() report_res = file_res.read() info = self.get.runFundsReport(report_def, report_res, date.today()) for data in info: fund = Fund() fund.Name = data[0][1] fund.ID = data[1][1] fund.DMRR = datetime.strptime(data[2][1],"%m/%d/%Y") fund.incept_date = datetime.strptime(data[3][1],"%m/%d/%Y") fund.IL = "MCP Fund or Index" fund.Class = "MCP Fund or Index" fund.DMRR = self.getActualDMRR(fund.ID, fund.DMRR) MCPFAI.append(fund) tmp_file = open(self.cache_path + "lists/MCPFAI_funds.cache",'w') cPickle.dump(MCPFAI, tmp_file) tmp_file.close()
def updateFundList(self): file_def = open("def/all_funds_def.dat") report_def = file_def.read() report_res = "${true}" t = date.today() info = self.get.runFundsReport(report_def, report_res, self.cur_date) funds = [] active_funds = [] fund_index = {} invested_funds = [] focus_list_funds = [] inv_and_focus_funds = [] ex_focus_funds = [] ex_invested_funds = [] ex_inv_and_focus_funds = [] for data in info: if data[2][1] != 'None': fund = Fund() fund.Name = data[0][1] fund.ID = data[1][1] fund.DMRR = datetime.strptime(data[2][1], "%m/%d/%Y") fund.DMRR = self.getActualDMRR(fund.ID, fund.DMRR) fund.IL = data[4][1] fund.StrengthRating = data[5][1] fund.Class = data[6][1] fund.prime_strat = data[7][1] fund.sub_strat1 = data[8][1] fund.sub_strat2 = data[9][1] fund.city = data[10][1] tmp_state = self.getState(data[12][1]) if tmp_state == "None": fund.state = data[11][1] else: fund.state = tmp_state fund.postal_code = data[12][1] fund.incept_date = datetime.strptime(data[13][1], "%m/%d/%Y") fund.part_of_pmg = str.lower(str(data[14][1])).strip() if fund.part_of_pmg == "yes": fund.part_of_pmg = True else: fund.part_of_pmg = False funds.append(fund) for fund in funds: fund.ListName = fund.Name + " (MRR:" + self.dateFormat( fund.DMRR, "LIST") + ")" fund.ListName += "(Int:" + fund.IL + ")" fund.ListName += "(Str:" + fund.StrengthRating + ")" fund.ListName += "(Cls:" + fund.Class + ")" fund.ListName += "(Strat:" + fund.prime_strat + ")" fund.ListName += "(Sub1:" + fund.sub_strat1 + ")" fund.ListName += "(Sub2:" + fund.sub_strat2 + ")" fund.ListName += "(City:" + fund.city + ")" fund.ListName += "(State:" + fund.state + ")" fund.ListName += "(Zip:" + fund.postal_code + ")" fund_index[fund.ID] = fund if self.equalOrAfter( fund.DMRR, datetime(self.cur_date.year - 1, self.cur_date.month, self.cur_date.day)): active_funds.append(fund) if fund.IL == "Invested" and fund.part_of_pmg: inv_and_focus_funds.append(fund) invested_funds.append(fund) ex_focus_funds.append(fund) elif fund.IL == "Focus List" and fund.part_of_pmg: inv_and_focus_funds.append(fund) focus_list_funds.append(fund) ex_invested_funds.append else: ex_invested_funds.append(fund) ex_focus_funds.append(fund) ex_inv_and_focus_funds.append(fund) invested_funds = sorted(invested_funds, key=lambda Fund: Fund.Name) focus_list_funds = sorted(focus_list_funds, key=lambda Fund: Fund.Name) inv_and_focus_funds = sorted(inv_and_focus_funds, key=lambda Fund: Fund.Name) ex_focus_funds = sorted(ex_focus_funds, key=lambda Fund: Fund.Name) ex_invested_funds = sorted(ex_invested_funds, key=lambda Fund: Fund.Name) ex_inv_and_focus_funds = sorted(ex_inv_and_focus_funds, key=lambda Fund: Fund.Name) active_funds = sorted(active_funds, key=lambda Fund: Fund.Name) funds = sorted(funds, key=lambda Fund: Fund.Name) file = open(self.cache_path + "lists/" + "all_funds.cache", "w") cPickle.dump(funds, file) file.close() file = open(self.cache_path + "lists/" + "active_funds.cache", "w") cPickle.dump(active_funds, file) file.close() file = open(self.cache_path + "lists/invested_funds.cache", "w") cPickle.dump(invested_funds, file) file.close() file = open(self.cache_path + "lists/focus_list_funds.cache", "w") cPickle.dump(focus_list_funds, file) file.close() file = open(self.cache_path + "lists/inv_and_focus_funds.cache", "w") cPickle.dump(inv_and_focus_funds, file) file.close() file = open(self.cache_path + "lists/ex-focus.cache", "w") cPickle.dump(ex_focus_funds, file) file.close() file = open(self.cache_path + "lists/ex-invested.cache", "w") cPickle.dump(ex_invested_funds, file) file.close() file = open(self.cache_path + "lists/ex-invested_and_focus.cache", "w") cPickle.dump(ex_inv_and_focus_funds, file) file.close() file = open(self.cache_path + "lists/all_fund_index.cache", "w") cPickle.dump(fund_index, file) file.close()
def updateFundList(self): file_def = open("def/all_funds_def.dat") report_def = file_def.read() report_res = "${true}" t = date.today() info = self.get.runFundsReport(report_def, report_res, self.cur_date) funds = [] active_funds = [] fund_index = {} invested_funds = [] focus_list_funds = [] inv_and_focus_funds = [] ex_focus_funds = [] ex_invested_funds = [] ex_inv_and_focus_funds = [] for data in info: if data[2][1] != 'None': fund = Fund() fund.Name = data[0][1] fund.ID = data[1][1] fund.DMRR = datetime.strptime(data[2][1],"%m/%d/%Y") fund.DMRR = self.getActualDMRR(fund.ID, fund.DMRR) fund.IL = data[4][1] fund.StrengthRating = data[5][1] fund.Class = data[6][1] fund.prime_strat = data[7][1] fund.sub_strat1 = data[8][1] fund.sub_strat2 = data[9][1] fund.city = data[10][1] tmp_state = self.getState(data[12][1]) if tmp_state == "None": fund.state = data[11][1] else: fund.state = tmp_state fund.postal_code = data[12][1] fund.incept_date = datetime.strptime(data[13][1],"%m/%d/%Y") fund.part_of_pmg = str.lower(str(data[14][1])).strip() if fund.part_of_pmg == "yes": fund.part_of_pmg = True else: fund.part_of_pmg = False funds.append(fund) for fund in funds: fund.ListName = fund.Name + " (MRR:" + self.dateFormat(fund.DMRR,"LIST") + ")" fund.ListName += "(Int:" + fund.IL + ")" fund.ListName += "(Str:" + fund.StrengthRating + ")" fund.ListName += "(Cls:" + fund.Class + ")" fund.ListName += "(Strat:" + fund.prime_strat + ")" fund.ListName += "(Sub1:" + fund.sub_strat1 + ")" fund.ListName += "(Sub2:" + fund.sub_strat2 + ")" fund.ListName += "(City:" + fund.city +")" fund.ListName += "(State:" + fund.state + ")" fund.ListName += "(Zip:" + fund.postal_code + ")" fund_index[fund.ID] = fund if self.equalOrAfter(fund.DMRR,datetime(self.cur_date.year-1,self.cur_date.month,self.cur_date.day)): active_funds.append(fund) if fund.IL == "Invested" and fund.part_of_pmg: inv_and_focus_funds.append(fund) invested_funds.append(fund) ex_focus_funds.append(fund) elif fund.IL == "Focus List" and fund.part_of_pmg: inv_and_focus_funds.append(fund) focus_list_funds.append(fund) ex_invested_funds.append else: ex_invested_funds.append(fund) ex_focus_funds.append(fund) ex_inv_and_focus_funds.append(fund) invested_funds = sorted(invested_funds, key=lambda Fund:Fund.Name) focus_list_funds = sorted(focus_list_funds, key=lambda Fund:Fund.Name) inv_and_focus_funds = sorted(inv_and_focus_funds, key=lambda Fund:Fund.Name) ex_focus_funds = sorted(ex_focus_funds, key=lambda Fund:Fund.Name) ex_invested_funds = sorted(ex_invested_funds, key=lambda Fund:Fund.Name) ex_inv_and_focus_funds = sorted(ex_inv_and_focus_funds, key=lambda Fund:Fund.Name) active_funds = sorted(active_funds, key=lambda Fund:Fund.Name) funds = sorted(funds, key=lambda Fund:Fund.Name) file = open(self.cache_path + "lists/" + "all_funds.cache", "w") cPickle.dump(funds,file) file.close() file = open(self.cache_path + "lists/" + "active_funds.cache", "w") cPickle.dump(active_funds,file) file.close() file = open(self.cache_path + "lists/invested_funds.cache", "w") cPickle.dump(invested_funds,file) file.close() file = open(self.cache_path + "lists/focus_list_funds.cache", "w") cPickle.dump(focus_list_funds,file) file.close() file = open(self.cache_path + "lists/inv_and_focus_funds.cache", "w") cPickle.dump(inv_and_focus_funds,file) file.close() file = open(self.cache_path + "lists/ex-focus.cache", "w") cPickle.dump(ex_focus_funds,file) file.close() file = open(self.cache_path + "lists/ex-invested.cache", "w") cPickle.dump(ex_invested_funds,file) file.close() file = open(self.cache_path + "lists/ex-invested_and_focus.cache", "w") cPickle.dump(ex_inv_and_focus_funds,file) file.close() file = open(self.cache_path + "lists/all_fund_index.cache", "w") cPickle.dump(fund_index,file) file.close()