def repairArchivedMISCache(self, as_of_date): path = self.mis_cache_path + "archived/" + as_of_date.strftime( "%Y-%m-%d") + "/" f = FundManager(path) while True: error = f.checkCache() if not error[0]: m_updater = MISCacheUpdater(path) for e in error[1]: print e[0], "--- missing", e[1] if e[1] == "product_rep": m_updater.loadProductData(as_of_date) elif e[1] == "fund_rep": m_updater.loadFundData(as_of_date) elif e[1] == "meeting": m_updater.loadMeetingsData(as_of_date, e[0]) elif e[1] == "exposure": m_updater.loadExposureData(as_of_date, e[0]) elif e[1] == "aum": m_updater.loadAumData(as_of_date, e[0]) elif e[1] == "return": m_updater.loadReturnsData(as_of_date, e[0]) elif e[1] == "stats": m_updater.loadStatisticsData(as_of_date, e[0]) elif e[1] == "transactions": m_updater.loadInternalTransactionData(as_of_date, e[0]) elif e[1] == "holding": m_updater.loadHoldingsData(as_of_date, e[0]) elif e[1] == "trans_rep": m_updater.loadTransactionData(as_of_date) elif e[1] == "people_org_rep": m_updater.loadContactsData(as_of_date) else: break
def selectColOrder(self, refresh=False): if not refresh: self.fund_win = Toplevel() self.fund_win.title("Fund Order") if not os.access( self.MIS_cache_path + "/reports/product_rep.cache", os.F_OK): m = MISCacheUpdater(self.MIS_cache_path) as_of_date = date.today() m.loadProductData(as_of_date) if self.fundman.cache_path != self.MIS_cache_path: self.fundman.setCachePath(self.MIS_cache_path) self.fundman.loadProductData() elif not self.fundman.loaded[1]: self.fundman.loadProductData() self.fund_win_frame = Frame(self.fund_win) self.entity_frame = Frame(self.fund_win_frame, bd=1, relief=RAISED) tmp_frame = Frame(self.entity_frame) title = Label(tmp_frame, text="Define the Column Order:") title.pack() tmp_frame.pack() self.prods = self.fundman.products self.disp_rank_values = {} final_prods = [] for f in self.final_funds: final_prods.append(self.prods[f]) final_prods = sorted(final_prods, key=lambda product: product.disp_rank) for var in range(0, len(final_prods)): p = final_prods[var] tmp_frame = Frame(self.entity_frame) self.disp_rank_values[p.backstop_id] = StringVar() Label(tmp_frame, text=p.name).pack(side=LEFT) tmp_entry = Spinbox( tmp_frame, textvariable=self.disp_rank_values[p.backstop_id], command=self.saveDispRank, width=2, from_=0, to=(len(final_prods) + 1)) self.disp_rank_values[p.backstop_id].set(var + 1) self.fundman.products[p.backstop_id].disp_rank = var + 1 tmp_entry.pack(side=RIGHT) tmp_frame.pack(fill=X) self.entity_frame.pack(fill=X) Button(self.fund_win_frame, text="OK", command=self.setDispRank, width=10).pack(side=BOTTOM) self.fund_win_frame.pack(fill=BOTH, expand=1) self.resizeWindow(300, len(final_prods) * 22 + 50, self.fund_win)
def repairArchivedMISCache(self,as_of_date): path = self.mis_cache_path + "archived/" + as_of_date.strftime("%Y-%m-%d") + "/" f = FundManager(path) while True: error = f.checkCache() if not error[0]: m_updater = MISCacheUpdater(path) for e in error[1]: print e[0], "--- missing", e[1] if e[1] == "product_rep": m_updater.loadProductData(as_of_date) elif e[1] == "fund_rep": m_updater.loadFundData(as_of_date) elif e[1] == "meeting": m_updater.loadMeetingsData(as_of_date,e[0]) elif e[1] == "exposure": m_updater.loadExposureData(as_of_date,e[0]) elif e[1] == "aum": m_updater.loadAumData(as_of_date,e[0]) elif e[1] == "return": m_updater.loadReturnsData(as_of_date,e[0]) elif e[1] == "stats": m_updater.loadStatisticsData(as_of_date,e[0]) elif e[1] == "transactions": m_updater.loadInternalTransactionData(as_of_date,e[0]) elif e[1] == "holding": m_updater.loadHoldingsData(as_of_date,e[0]) elif e[1] == "trans_rep": m_updater.loadTransactionData(as_of_date) elif e[1] == "people_org_rep": m_updater.loadContactsData(as_of_date) else: break
def selectColOrder(self,refresh=False): if not refresh: self.fund_win = Toplevel() self.fund_win.title("Fund Order") if not os.access(self.MIS_cache_path + "/reports/product_rep.cache",os.F_OK): m = MISCacheUpdater(self.MIS_cache_path) as_of_date = date.today() m.loadProductData(as_of_date) if self.fundman.cache_path != self.MIS_cache_path: self.fundman.setCachePath(self.MIS_cache_path) self.fundman.loadProductData() elif not self.fundman.loaded[1]: self.fundman.loadProductData() self.fund_win_frame = Frame(self.fund_win) self.entity_frame = Frame(self.fund_win_frame,bd=1,relief=RAISED) tmp_frame = Frame(self.entity_frame) title = Label(tmp_frame,text="Define the Column Order:") title.pack() tmp_frame.pack() self.prods = self.fundman.products self.disp_rank_values = {} final_prods = [] for f in self.final_funds: final_prods.append(self.prods[f]) final_prods = sorted(final_prods,key=lambda product: product.disp_rank) for var in range(0,len(final_prods)): p = final_prods[var] tmp_frame = Frame(self.entity_frame) self.disp_rank_values[p.backstop_id] = StringVar() Label(tmp_frame,text=p.name).pack(side=LEFT) tmp_entry = Spinbox(tmp_frame,textvariable=self.disp_rank_values[p.backstop_id],command=self.saveDispRank,width=2,from_=0, to=(len(final_prods)+1)) self.disp_rank_values[p.backstop_id].set(var+1) self.fundman.products[p.backstop_id].disp_rank = var+1 tmp_entry.pack(side=RIGHT) tmp_frame.pack(fill=X) self.entity_frame.pack(fill=X) Button(self.fund_win_frame, text="OK", command=self.setDispRank, width=10).pack(side=BOTTOM) self.fund_win_frame.pack(fill=BOTH,expand=1) self.resizeWindow(300, len(final_prods)*22 + 50, self.fund_win)
def selectFinalFunds(self): self.fund_win = Toplevel() self.fund_win.title("Final Funds") self.entity_frame = Frame(self.fund_win, bd=1, relief=RAISED) tmp_frame = Frame(self.entity_frame) title = Label(tmp_frame, text="Specify the \"Final Funds\":") title.pack() tmp_frame.pack() if not os.access(self.MIS_cache_path + "/reports/product_rep.cache", os.F_OK): m = MISCacheUpdater(self.MIS_cache_path) as_of_date = datetime.strptime(self.as_of_date_entry.get(), "%m/%d/%Y") m.loadProductData(as_of_date) if self.fundman.cache_path != self.MIS_cache_path: self.fundman.setCachePath(self.MIS_cache_path) self.fundman.loadProductData() elif not self.fundman.loaded[1]: self.fundman.loadProductData() self.prods = self.fundman.products self.checkbox_values = {} for p_id in sorted(self.prods.keys()): p = self.prods[p_id] tmp_frame = Frame(self.entity_frame) self.checkbox_values[p_id] = IntVar() tmp_checkbox = Checkbutton(tmp_frame, text=p.name, variable=self.checkbox_values[p_id]) if p_id in [ 370761, 370775, 762605, 762635, 370751, 370753, 370755, 370745, 370759 ]: tmp_checkbox.select() tmp_checkbox.pack(side=LEFT) tmp_frame.pack(fill=X) self.entity_frame.pack(fill=X) Button(self.fund_win, text="OK", command=self.saveFinalFunds, width=10).pack(side=BOTTOM) self.resizeWindow(300, len(self.prods.keys()) * 22 + 50, self.fund_win)
def selectPassThroughFunds(self): self.fund_win = Toplevel() self.fund_win.title("Pass-Through Funds") self.entity_frame = Frame(self.fund_win, bd=1, relief=RAISED) tmp_frame = Frame(self.entity_frame) title = Label(tmp_frame, text="Verify the \"Pass-Through Funds\":") title.pack() tmp_frame.pack() if not os.access(self.MIS_cache_path + "/reports/product_rep.cache", os.F_OK): m = MISCacheUpdater(self.MIS_cache_path) as_of_date = date.today() m.loadProductData(as_of_date) if self.fundman.cache_path != self.MIS_cache_path: self.fundman.setCachePath(self.MIS_cache_path) self.fundman.loadProductData() elif not self.fundman.loaded[1]: self.fundman.loadProductData() self.prods = self.fundman.products self.checkbox_values = {} for p_id in sorted(self.prods.keys()): p = self.prods[p_id] tmp_frame = Frame(self.entity_frame) self.checkbox_values[p_id] = IntVar() tmp_checkbox = Checkbutton(tmp_frame, text=p.name, variable=self.checkbox_values[p_id]) if p_id in self.pass_through_funds: tmp_checkbox.select() tmp_checkbox.pack(side=LEFT) tmp_frame.pack(fill=X) self.entity_frame.pack(fill=X) Button(self.fund_win, text="OK", command=self.savePassThroughFunds, width=10).pack(side=BOTTOM) self.resizeWindow(300, len(self.prods.keys()) * 22 + 50, self.fund_win)
def selectPassThroughFunds(self): self.fund_win = Toplevel() self.fund_win.title("Pass-Through Funds") self.entity_frame = Frame(self.fund_win,bd=1,relief=RAISED) tmp_frame = Frame(self.entity_frame) title = Label(tmp_frame,text="Verify the \"Pass-Through Funds\":") title.pack() tmp_frame.pack() if not os.access(self.MIS_cache_path + "/reports/product_rep.cache",os.F_OK): m = MISCacheUpdater(self.MIS_cache_path) as_of_date = date.today() m.loadProductData(as_of_date) if self.fundman.cache_path != self.MIS_cache_path: self.fundman.setCachePath(self.MIS_cache_path) self.fundman.loadProductData() elif not self.fundman.loaded[1]: self.fundman.loadProductData() self.prods = self.fundman.products self.checkbox_values = {} for p_id in sorted(self.prods.keys()): p = self.prods[p_id] tmp_frame = Frame(self.entity_frame) self.checkbox_values[p_id] = IntVar() tmp_checkbox = Checkbutton(tmp_frame,text = p.name,variable=self.checkbox_values[p_id]) if p_id in self.pass_through_funds: tmp_checkbox.select() tmp_checkbox.pack(side=LEFT) tmp_frame.pack(fill=X) self.entity_frame.pack(fill=X) Button(self.fund_win, text="OK", command=self.savePassThroughFunds, width=10).pack(side=BOTTOM) self.resizeWindow(300, len(self.prods.keys())*22 + 50, self.fund_win)
def selectFinalFunds(self): self.fund_win = Toplevel() self.fund_win.title("Final Funds") self.entity_frame = Frame(self.fund_win,bd=1,relief=RAISED) tmp_frame = Frame(self.entity_frame) title = Label(tmp_frame,text="Specify the \"Final Funds\":") title.pack() tmp_frame.pack() if not os.access(self.MIS_cache_path + "/reports/product_rep.cache",os.F_OK): m = MISCacheUpdater(self.MIS_cache_path) as_of_date = datetime.strptime(self.as_of_date_entry.get(),"%m/%d/%Y") m.loadProductData(as_of_date) if self.fundman.cache_path != self.MIS_cache_path: self.fundman.setCachePath(self.MIS_cache_path) self.fundman.loadProductData() elif not self.fundman.loaded[1]: self.fundman.loadProductData() self.prods = self.fundman.products self.checkbox_values = {} for p_id in sorted(self.prods.keys()): p = self.prods[p_id] tmp_frame = Frame(self.entity_frame) self.checkbox_values[p_id] = IntVar() tmp_checkbox = Checkbutton(tmp_frame,text = p.name,variable=self.checkbox_values[p_id]) if p_id in [370761,370775,762605,762635,370751,370753,370755,370745,370759]: tmp_checkbox.select() tmp_checkbox.pack(side=LEFT) tmp_frame.pack(fill=X) self.entity_frame.pack(fill=X) Button(self.fund_win, text="OK", command=self.saveFinalFunds,width=10).pack(side=BOTTOM) self.resizeWindow(300, len(self.prods.keys())*22 + 50, self.fund_win)