def get_ui(self): ui = self.app.inflate('dashboard:main') self._mgr.refresh() self.fill('l', self._mgr.list_left(), ui, 'cleft') self.fill('r', self._mgr.list_right(), ui, 'cright') ui.insertText('host', platform.node()) ui.insertText('distro', detect_distro()) ui.find('icon').set('src', '/dl/dashboard/distributor-logo-%s.png'%detect_platform(mapping=False)) if self._adding_widget == True: dlg = self.app.inflate('dashboard:add-widget') idx = 0 for prov in sorted(self.app.grab_plugins(apis.dashboard.IWidget)): if hasattr(prov, 'hidden'): continue dlg.append('list', UI.ListItem( UI.HContainer( UI.Image(file=prov.icon), UI.Label(text=prov.name), ), id=prov.plugin_id, )) idx += 1 ui.append('main', dlg) elif self._adding_widget != None: ui.append('main', self._mgr.get_by_name(self._adding_widget).get_config_dialog()) return ui
def update_list(self): """ Downloads fresh list of plugins and rebuilds installed/available lists """ from ajenti import generation, version if not os.path.exists('/var/lib/ajenti'): os.mkdir('/var/lib/ajenti') send_stats(self.server, PluginLoader.list_plugins().keys()) data = download('http://%s/api/plugins?pl=%s&gen=%i' % (self.server,detect_platform(),generation)) try: open('/var/lib/ajenti/plugins.list', 'w').write(data) except: pass self.update_installed() self.update_available() self.update_upgradable()
def __init__(self): ConfigParser.__init__(self) self.set('platform', detect_platform()) # TODO: move this out
def __init__(self): ConfigParser.__init__(self) self.add_section('ajenti') self.set('platform', detect_platform())