[Hepserver-commits] hep/hep/services http.py,1.2,1.3
Status: Alpha
Brought to you by:
abefettig
|
From: <abe...@us...> - 2003-08-07 03:47:09
|
Update of /cvsroot/hepserver/hep/hep/services
In directory sc8-pr-cvs1:/tmp/cvs-serv17447/hep/services
Modified Files:
http.py
Log Message:
fix the root site object to actually make sense
Index: http.py
===================================================================
RCS file: /cvsroot/hepserver/hep/hep/services/http.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** http.py 7 Aug 2003 03:24:22 -0000 1.2
--- http.py 7 Aug 2003 03:47:07 -0000 1.3
***************
*** 28,42 ****
def getFactory(app):
portal = app.getServiceNamed('Authenticator').portal
- res = resource.Resource()
- site = server.Site(res)
-
- # add static paths
- for staticPath in ('images', 'styles'):
- res.putChild(staticPath, static.File(sibpath(hep.web.__file__, staticPath)))
-
- res.putChild("", Redirect("/messages"))
from twisted.web.woven.guard import UsernamePasswordWrapper, SessionWrapper
! res.putChild("messages", SessionWrapper(
! UsernamePasswordWrapper(portal))) #,lambda _: Redirect("/messages")))))
return site
--- 28,35 ----
def getFactory(app):
portal = app.getServiceNamed('Authenticator').portal
from twisted.web.woven.guard import UsernamePasswordWrapper, SessionWrapper
! res = SessionWrapper(UsernamePasswordWrapper(portal))
! site = server.Site(res)
!
return site
***************
*** 46,57 ****
self.user = user
resource.Resource.__init__(self)
def render(self, request):
- print "RENDERNG!"
request.redirect('/messages')
return ""
def getChild(self, name, request):
! #if name == 'messages':
! return MessagesPage(self.user)
!
\ No newline at end of file
--- 39,53 ----
self.user = user
resource.Resource.__init__(self)
+ # add static paths
+ for staticPath in ('images', 'styles'):
+ self.putChild(staticPath, static.File(sibpath(hep.web.__file__, staticPath)))
def render(self, request):
request.redirect('/messages')
return ""
def getChild(self, name, request):
! if name == 'messages':
! return MessagesPage(self.user)
! else:
! return Redirect('/messages')
\ No newline at end of file
|