Skip to content

Commit dc3e13a

Browse files
author
peakwinter
committed
misc fixes
1 parent 5188539 commit dc3e13a

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

Diff for: genesis/plugins/sysconfig/main.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ def get_ui(self):
6464
bestat = 'Not installed'
6565
else:
6666
if self._mgr.get_status('beacon') == 'running':
67-
lrstat = 'Running'
67+
bestat = 'Running'
6868
ui.find('flbeacon').append(UI.Button(text="Stop", id="svc/beacon/stop"))
6969
else:
70-
lrstat = 'Not running'
70+
bestat = 'Not running'
7171
ui.find('flbeacon').append(UI.Button(text="Start", id="svc/beacon/start"))
7272
if self._mgr.get_enabled('beacon') == 'enabled':
73-
lrstat += ' and enabled on boot'
73+
bestat += ' and enabled on boot'
7474
ui.find('flbeacon').append(UI.Button(text="Disable on boot", id="svc/beacon/disable"))
7575
else:
76-
lrstat += ' and not enabled on boot'
76+
bestat += ' and not enabled on boot'
7777
ui.find('flbeacon').append(UI.Button(text="Enable on boot", id="svc/beacon/enable"))
7878
ui.find('logrunner').set('text', lrstat)
7979
ui.find('beacon').set('text', bestat)

Diff for: genesis/plugins/webapps/api.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,21 @@ def get_sites(self):
8383

8484
w.sclass = self.get_interface(w.stype)
8585
w.sinfo = self.get_info(w.stype)
86-
w.dbengine = w.sinfo.dbengine
86+
w.dbengine = w.sinfo.dbengine if hasattr(w.sinfo, 'dbengine') else None
8787
w.ssl_able = w.sinfo.ssl if hasattr(w.sinfo, 'ssl') else False
8888

8989
applist.append(w)
9090
return applist
9191

9292
def get_info(self, name):
93-
return filter(lambda x: x.__class__.__name__ == name,
94-
self.app.grab_plugins(apis.webapps.IWebapp))[0].plugin_info
93+
cs = filter(lambda x: x.__class__.__name__ == name,
94+
self.app.grab_plugins(apis.webapps.IWebapp))
95+
return cs[0].plugin_info if len(cs) else None
9596

9697
def get_interface(self, name):
97-
return filter(lambda x: x.__class__.__name__ == name,
98-
self.app.grab_plugins(apis.webapps.IWebapp))[0]
98+
cs = filter(lambda x: x.__class__.__name__ == name,
99+
self.app.grab_plugins(apis.webapps.IWebapp))
100+
return cs[0] if len(cs) else None
99101

100102
def cert_remove_notify(self, name, stype):
101103
# Called by webapp when removed.

Diff for: genesis/plugins/webapps/main.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def on_init(self):
5454
)
5555
break
5656
if not self._current:
57-
self._current = self.apptypes[0]
57+
self._current = self.apptypes[0] if len(self.apptypes) else None
5858
for apptype in self.apptypes:
5959
ok = False
6060
for site in self.sites:
@@ -130,17 +130,18 @@ def get_main_ui(self):
130130
)
131131

132132
info = self._current
133-
if info.logo is True:
134-
ui.find('logo').set('file', '/dl/'+self._current.id+'/logo.png')
135-
ui.find('appname').set('text', info.name)
136-
ui.find('short').set('text', info.desc)
137-
if info.app_homepage is None:
138-
ui.find('website').set('text', 'None')
139-
ui.find('website').set('url', 'http://localhost')
140-
else:
141-
ui.find('website').set('text', info.app_homepage)
142-
ui.find('website').set('url', info.app_homepage)
143-
ui.find('desc').set('text', info.longdesc)
133+
if info:
134+
if info.logo is True:
135+
ui.find('logo').set('file', '/dl/'+self._current.id+'/logo.png')
136+
ui.find('appname').set('text', info.name)
137+
ui.find('short').set('text', info.desc)
138+
if info.app_homepage is None:
139+
ui.find('website').set('text', 'None')
140+
ui.find('website').set('url', 'http://localhost')
141+
else:
142+
ui.find('website').set('text', info.app_homepage)
143+
ui.find('website').set('url', info.app_homepage)
144+
ui.find('desc').set('text', info.longdesc)
144145

145146
if self._add is None:
146147
ui.remove('dlgAdd')

0 commit comments

Comments
 (0)