GeoView : bug 4168 : avoid parenthesis in const.ROOT_DIR

svn: r15824
This commit is contained in:
Serge Noiraud 2010-08-27 10:22:37 +00:00
parent b0b620df9c
commit b28e9950a0

View File

@ -363,6 +363,10 @@ class GeoView(HtmlView):
self.mru_signal = None
self.nav_group = 0
self.mru_active = DISABLED
self.invalidpath = const.ROOT_DIR.find("(")
if self.invalidpath != -1:
_LOG.debug("\n\nInvalid PATH (avoid parenthesis):\n%s\n\n" %
const.ROOT_DIR)
self.uistate.register(dbstate, self.navigation_type(), self.nav_group)
self.bookmarks = Bookmarks.PersonBookmarks(self.dbstate, self.uistate,
@ -2494,6 +2498,19 @@ class GeoView(HtmlView):
Here, we call really the htmlview and the renderer
"""
if self.endinit and not self.no_network:
if self.invalidpath != -1:
spaces = ""
for i in range(self.invalidpath):
spaces = spaces + ' '
spaces = spaces + '^'
self.open(self._create_message_page('<p>%s<br><br>'
'<pre>%s<br>%s</pre>' % (
_('Invalid path for const.ROOT_DIR:<br>'
' avoid parenthesis into this parameter'),
const.ROOT_DIR, spaces )
)
)
else:
self.open(url)
self.javascript_ready = True