moksha/controllers/apps.py | 31 +++++++++++++++++++++++++++++++ moksha/controllers/root.py | 14 ++++---------- start-moksha | 1 - 3 files changed, 35 insertions(+), 11 deletions(-)
New commits: commit 4a2cc2c80696c07b558fdc87e4c2d237226bfd6c Author: Luke Macken lmacken@redhat.com Date: Fri Feb 6 02:05:51 2009 -0500
App the app lookup method out into it's own controller.
diff --git a/moksha/controllers/apps.py b/moksha/controllers/apps.py new file mode 100644 index 0000000..1b92be9 --- /dev/null +++ b/moksha/controllers/apps.py @@ -0,0 +1,31 @@ +# This file is part of Moksha. +# +# Moksha is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Moksha is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Moksha. If not, see http://www.gnu.org/licenses/. +# +# Copyright 2008, Red Hat, Inc. +# Authors: Luke Macken lmacken@redhat.com + +import moksha + +from tg import expose +from moksha.lib.base import Controller + +class AppController(Controller): + + @expose() + def lookup(self, app, *remainder): + print locals() + if app not in moksha.apps: + raise AppNotFoundException(app) + return moksha.apps[app]['controller'], remainder diff --git a/moksha/controllers/root.py b/moksha/controllers/root.py index a626260..2938dc1 100644 --- a/moksha/controllers/root.py +++ b/moksha/controllers/root.py @@ -28,9 +28,10 @@ from widgetbrowser import WidgetBrowser from moksha import _ from moksha.model import DBSession from moksha.lib.base import BaseController -#from moksha.controllers.secc import AdminController from moksha.exc import ApplicationNotFound from moksha.controllers.error import ErrorController +from moksha.controllers.apps import AppController +#from moksha.controllers.secc import AdminController
from moksha.widgets.container import MokshaContainer container = MokshaContainer('moksha_container') @@ -40,8 +41,9 @@ container = MokshaContainer('moksha_container')
class RootController(BaseController):
- #admin = AdminController() + appz = AppController() error = ErrorController() + #admin = AdminController()
# ToscaWidgets WidgetBrowser integration widget = WSGIAppController( @@ -50,14 +52,6 @@ class RootController(BaseController): full_stack=False, docs_dir=config.get('docs_dir', 'docs')))
- @expose() - def lookup(self, resource, *remainder): - if resource == 'appz': - app = remainder[0] - if app not in moksha.apps: - raise AppNotFoundException(app) - return moksha.apps[app]['controller'], remainder[1:] - @expose('mako:moksha.templates.index') def index(self): tmpl_context.menu_widget = moksha.menus['default_menu']
commit 43604fa09cf3ea5d4d3afa53d6a70fb5bdf0818b Author: Luke Macken lmacken@redhat.com Date: Fri Feb 6 01:50:01 2009 -0500
Remove obsolete TG2 b5 link
diff --git a/start-moksha b/start-moksha index 78b8e32..166f494 100755 --- a/start-moksha +++ b/start-moksha @@ -7,7 +7,6 @@ if [ ! $VIRTUAL_ENV ]; then virtualenv --no-site-packages tg2env #virtualenv tg2env source tg2env/bin/activate - #easy_install -i http://www.turbogears.org/2.0/downloads/2.0b5/index tg.devtools easy_install -i http://www.turbogears.org/2.0/downloads/current/index tg.devtools easy_install "tw.jquery==dev" pushd moksha/widgetbrowser; python setup.py develop; popd