Added some protection on loading bad views
svn: r14602
This commit is contained in:
parent
cd0d479ec1
commit
8546dc91e5
@ -32,7 +32,6 @@ Manages the main window and the pluggable views
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from gen.ggettext import gettext as _
|
from gen.ggettext import gettext as _
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
@ -884,7 +883,13 @@ class ViewManager(CLIManager):
|
|||||||
self.pages.append([])
|
self.pages.append([])
|
||||||
nrpage = 0
|
nrpage = 0
|
||||||
for pdata, page_def in cat_views:
|
for pdata, page_def in cat_views:
|
||||||
|
try:
|
||||||
page = page_def(self.dbstate, self.uistate)
|
page = page_def(self.dbstate, self.uistate)
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
LOG.warn("View '%s' failed to load." % pdata.id)
|
||||||
|
traceback.print_exc()
|
||||||
|
continue
|
||||||
# Category is (string, trans):
|
# Category is (string, trans):
|
||||||
page.set_category(pdata.category)
|
page.set_category(pdata.category)
|
||||||
page.set_ident(page.get_category() + '_' + pdata.id)
|
page.set_ident(page.get_category() + '_' + pdata.id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user