From 248ecb7c01b5b6e29134a62094441b383dad31a6 Mon Sep 17 00:00:00 2001 From: Luke Macken Date: Thu, 17 Jan 2008 12:07:14 -0500 Subject: Switch from kid to genshi as our templating engine for FuncWeb --- funcweb/funcweb/config/app.cfg | 10 +-- funcweb/funcweb/controllers.py | 27 +++++--- funcweb/funcweb/model.py | 10 +-- funcweb/funcweb/templates/login.html | 114 +++++++++++++++++++++++++++++++++ funcweb/funcweb/templates/login.kid | 114 --------------------------------- funcweb/funcweb/templates/master.html | 58 +++++++++++++++++ funcweb/funcweb/templates/master.kid | 47 -------------- funcweb/funcweb/templates/minions.html | 27 ++++++++ 8 files changed, 223 insertions(+), 184 deletions(-) create mode 100644 funcweb/funcweb/templates/login.html delete mode 100644 funcweb/funcweb/templates/login.kid create mode 100644 funcweb/funcweb/templates/master.html delete mode 100644 funcweb/funcweb/templates/master.kid create mode 100644 funcweb/funcweb/templates/minions.html (limited to 'funcweb') diff --git a/funcweb/funcweb/config/app.cfg b/funcweb/funcweb/config/app.cfg index 5734a78..24e0807 100644 --- a/funcweb/funcweb/config/app.cfg +++ b/funcweb/funcweb/config/app.cfg @@ -10,15 +10,7 @@ # which view (template engine) to use if one is not specified in the # template name -# tg.defaultview = "kid" - -# The following kid settings determine the settings used by the kid serializer. - -# Kid output method (e.g. html, html-strict, xhtml, xhtml-strict, xml, json) -# and formatting (e.g. default, straight, compact, newlines, wrap, nice) -# kid.outputformat="html default" - -# kid.encoding="utf-8" +tg.defaultview = "genshi" # The sitetemplate is used for overall styling of a site that # includes multiple TurboGears applications diff --git a/funcweb/funcweb/controllers.py b/funcweb/funcweb/controllers.py index 5206727..0754526 100644 --- a/funcweb/funcweb/controllers.py +++ b/funcweb/funcweb/controllers.py @@ -1,12 +1,21 @@ +import logging +log = logging.getLogger(__name__) + from turbogears import controllers, expose, flash -# from model import * -# import logging -# log = logging.getLogger("funcweb.controllers") +from func.overlord.client import Client class Root(controllers.RootController): - @expose(template="funcweb.templates.welcome") - def index(self): - import time - # log.debug("Happy TurboGears Controller Responding For Duty") - flash("Your application is now running") - return dict(now=time.ctime()) + + @expose(template="funcweb.templates.minions") + def minions(self): + """ Return a list of our minions """ + fc = Client("*") + return dict(minions=fc.system.list_methods()) + + @expose(template="funcweb.templates.minion") + def minion(self, name): + """ View all modules for a given minion """ + fc = Client(name) + return dict(modules=fc.system.list_modules()) + + index = minions diff --git a/funcweb/funcweb/model.py b/funcweb/funcweb/model.py index 28f2b02..230daf0 100644 --- a/funcweb/funcweb/model.py +++ b/funcweb/funcweb/model.py @@ -1,8 +1,8 @@ -from turbogears.database import PackageHub -from sqlobject import * - -hub = PackageHub('funcweb') -__connection__ = hub +#from turbogears.database import PackageHub +#from sqlobject import * +# +#hub = PackageHub('funcweb') +#__connection__ = hub # class YourDataClass(SQLObject): # pass diff --git a/funcweb/funcweb/templates/login.html b/funcweb/funcweb/templates/login.html new file mode 100644 index 0000000..4fd6755 --- /dev/null +++ b/funcweb/funcweb/templates/login.html @@ -0,0 +1,114 @@ + + + + + + Login + + + + +
+

Login

+

${message}

+
+ + + + + + + + + + + + +
+ + + +
+ + + +
+ +
+ + + +
+ +
+
+
+ + diff --git a/funcweb/funcweb/templates/login.kid b/funcweb/funcweb/templates/login.kid deleted file mode 100644 index 4fd6755..0000000 --- a/funcweb/funcweb/templates/login.kid +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - Login - - - - -
-

Login

-

${message}

-
- - - - - - - - - - - - -
- - - -
- - - -
- -
- - - -
- -
-
-
- - diff --git a/funcweb/funcweb/templates/master.html b/funcweb/funcweb/templates/master.html new file mode 100644 index 0000000..6029a9f --- /dev/null +++ b/funcweb/funcweb/templates/master.html @@ -0,0 +1,58 @@ + + + + + + +