prevent double listsings of apps in widget, thanks Marin

This commit is contained in:
mdipierro
2012-08-07 09:15:58 -05:00
parent f55c00b323
commit dd03908a02
2 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.00.0 (2012-08-06 23:01:45) dev Version 2.00.0 (2012-08-07 09:15:55) dev
+9 -7
View File
@@ -394,13 +394,15 @@ class web2pyDialog(object):
def connect_pages(self): def connect_pages(self):
""" Connect pages """ """ Connect pages """
#reset the menu
for arq in os.listdir('applications/'): available_apps = [arq for arq in os.listdir('applications/')
if os.path.exists('applications/%s/__init__.py' % arq): if os.path.exists('applications/%s/__init__.py' % arq)]
url = self.url + '/' + arq self.pagesmenu.delete(0, len(available_apps))
start_browser = lambda u = url: try_start_browser(u) for arq in available_apps:
self.pagesmenu.add_command(label=url, url = self.url + '/' + arq
command=start_browser) start_browser = lambda u = url: try_start_browser(u)
self.pagesmenu.add_command(label=url,
command=start_browser)
def quit(self, justHide=False): def quit(self, justHide=False):
""" Finish the program execution """ """ Finish the program execution """