def __loadSites(self, event=None): lbox = self.sitelist.component('listbox') lbox.delete(0, 'end') try: for p in self.productlist.getcurselection(): lbox.insert('end', *AvnParser.getTafProductCfg(p)['sites']) lbox.selection_set(0, 'end') except Exception, e: Busy.showerror(e, self.interior())
def listIdents(self, product): self.messagebar().resetmessages('systemerror') cfg = AvnParser.getTafProductCfg(product) if cfg: idents = cfg.get('sites', []) pil = cfg.get('workpil') self.idents.setlist(idents) if pil is None: pil = Avn.TAFWorkPIL self.pil.setvalue(pil) else: self.idents.clear() self.pil.clear() msg = 'Cannot read product %s' % product self.messagebar().message('usererror', msg)
def verify(self): self.messagebar().resetmessages('systemerror') try: product = self.products.getcurselection()[0] cfg = AvnParser.getTafProductCfg(product) if not cfg: raise Avn.AvnError('Cannot parse product definition file') idents = cfg.get('sites', []) for i in idents: if not AvnParser.getTafSiteCfg(i): raise Avn.AvnError('Cannot parse %s info file' % i) for h in [0, 6, 12, 18]: try: AvnParser.getTafTemplate(i, h) except IOError: raise Avn.AvnError('Cannot read %s %02dZ template' % \ (i, h)) self.messagebar().message('userevent', 'Verify succeeded') except IndexError: self.messagebar().message('usererror', 'Select product to verify') except Avn.AvnError, e: self.messagebar().message('usererror', str(e))
def getWorkPIL(self): try: return AvnParser.getTafProductCfg( \ self.productlist.getvalue()[0])['workpil'] except (IndexError, KeyError): return Avn.TAFWorkPIL