summaryrefslogtreecommitdiffstats
path: root/src/root.py
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-12-13 21:56:52 -0500
committerSimo Sorce <simo@redhat.com>2013-12-18 23:05:57 -0500
commit13a58ef5cb599d3e8e3a9484bd84fa6fae3f3390 (patch)
tree894aa3da2d6dc0a0003f797a42e5861e05c239da /src/root.py
parent1e97d03807bd893152bf2cbd0f20102af9c8f80d (diff)
downloadipsilon.git-13a58ef5cb599d3e8e3a9484bd84fa6fae3f3390.tar.gz
ipsilon.git-13a58ef5cb599d3e8e3a9484bd84fa6fae3f3390.tar.xz
ipsilon.git-13a58ef5cb599d3e8e3a9484bd84fa6fae3f3390.zip
Add page class handler
This also adds support for sessions and a somewhat custom page dispatcher. Signed-off-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'src/root.py')
-rwxr-xr-xsrc/root.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/root.py b/src/root.py
index 0c6cd41..50247f7 100755
--- a/src/root.py
+++ b/src/root.py
@@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from util import data
+from util import page
import cherrypy
class Site(object):
@@ -78,16 +79,8 @@ class User(object):
#TODO: implement setting sites via the user object ?
raise AttributeError
-class Root(object):
+class Root(page.Page):
- def __init__(self, template_env):
- self._env = template_env
-
- @cherrypy.expose
- def index_html(self):
+ def root(self):
tmpl = self._env.get_template('index.html')
- return tmpl.render(title='Root', user=User(None))
-
- @cherrypy.expose
- def index(self):
- return self.index_html()
+ return tmpl.render(title='Root', user=User(self.username))