From f29759ac7af129cef58e2e9f706530b15f05065e Mon Sep 17 00:00:00 2001 From: florent Date: Sun, 28 Aug 2011 00:02:26 +0000 Subject: enhance url management --- diff --git a/nutrinoweb/activity.py b/nutrinoweb/activity.py index 7722908..0ece4a7 100644 --- a/nutrinoweb/activity.py +++ b/nutrinoweb/activity.py @@ -16,7 +16,11 @@ from server import config from server.flask import logger -URL_BASE = 'http://localhost:5000/' +# get port from config +_port = config.Config().get('server>port', type_=int) +_port = '5000' if _port is None or _port == '' else _port +# .. +URL_BASE = 'http://localhost:%s' % _port def _toolbar_changed(toolbox, page, activity_): @@ -56,7 +60,7 @@ class NutrinoWebActivity(run.Server, activity.Activity): return self._toolbox def change_screen(self, name): - self.web_view.load_uri(URL_BASE + name) + self.web_view.load_uri('%s/%s' % (URL_BASE, name)) def __init_toolbar(self): """Keep an example of how to manage toolbar in our webapp ... -- cgit v0.9.1