def __call__(self): # Ensure OWS is enabled if not int(CTK.cfg.get_val("admin!ows!enabled", OWS_ENABLE)): return CTK.HTTP_Redir('/') page = Page_Market() # Check repository is accessible index = Distro.Index() if index.error: page.mainarea += RepoError() return page.Render() # Featured page.mainarea += FeaturedBox() # Top page.mainarea += CTK.RawHTML("<h2>%s</h2>" % (_('Top Applications'))) page.mainarea += TopApps() # Maintanance if Maintenance.does_it_need_maintenance(): refresh_maintenance = CTK.Refreshable({'id': 'market_maintenance'}) refresh_maintenance.register(lambda: Maintenance.Maintenance_Box( refresh_maintenance).Render()) page.sidebar += refresh_maintenance return page.Render()
def __call__ (self): # Ensure OWS is enabled if not int(CTK.cfg.get_val("admin!ows!enabled", OWS_ENABLE)): return CTK.HTTP_Redir('/') page = Page_Market() # Check repository is accessible index = Distro.Index() if index.error: page.mainarea += RepoError() return page.Render() # Featured page.mainarea += FeaturedBox() # Top page.mainarea += CTK.RawHTML("<h2>%s</h2>" %(_('Top Applications'))) page.mainarea += TopApps() # Maintanance if Maintenance.does_it_need_maintenance(): refresh_maintenance = CTK.Refreshable({'id': 'market_maintenance'}) refresh_maintenance.register (lambda: Maintenance.Maintenance_Box(refresh_maintenance).Render()) page.sidebar += refresh_maintenance return page.Render()
def __call__ (self): # Ensure OWS is enabled if not int(CTK.cfg.get_val("admin!ows!enabled", OWS_ENABLE)): return CTK.HTTP_Redir('/') page = Page_Market() # Featured page.mainarea += FeaturedBox() # Top page.mainarea += CTK.RawHTML("<h2>%s</h2>" %(_('Top Applications'))) tabs = CTK.Tab() tabs.Add (_('Paid'), TopApps('paid')) tabs.Add (_('Free'), TopApps('free')) tabs.Add (_('Ranked'), TopApps('any')) page.mainarea += tabs # My Library if OWS_Login.is_logged(): page.sidebar += Library.MyLibrary() # Maintanance if Maintenance.does_it_need_maintenance(): refresh_maintenance = CTK.Refreshable({'id': 'market_maintenance'}) refresh_maintenance.register (lambda: Maintenance.Maintenance_Box(refresh_maintenance).Render()) page.sidebar += refresh_maintenance return page.Render()
def __init__(self, T, K): #t type #k letter self.T = T self.K = K self.maintenance = {} for t in T: self.maintenance[t] = {} for k in K: self.maintenance[t][k] = Maintenance(t, k)
def __call__(self): try: return self.__safe_call__() except Exception, e: # Log the exception exception_str = traceback.format_exc() print exception_str Install_Log.log("EXCEPTION!\n" + exception_str) # Reset 'unfinished installations' cache Maintenance.Invalidate_Cache() # Present an alternative response cont = Exception_Handler(exception_str) return cont.Render().toStr()