Revision: 8079
http://svn.sourceforge.net/mailman/?rev=8079&view=rev
Author: mindlace23
Date: 2006-10-23 12:10:11 -0700 (Mon, 23 Oct 2006)
Log Message:
-----------
Modified HTTPRunner to run 'classic' or 'new' interfaces via config, and made
some additional changes to make
things work without Webware.
Modified Paths:
--------------
branches/soc2006-webui/Mailman/Queue/HTTPRunner.py
branches/soc2006-webui/Mailman/WebUI/page.py
branches/soc2006-webui/Mailman/WebUI/templates/pieces/signin.html
branches/soc2006-webui/Mailman/WebUI/wsgi_app.py
Modified: branches/soc2006-webui/Mailman/Queue/HTTPRunner.py
===================================================================
--- branches/soc2006-webui/Mailman/Queue/HTTPRunner.py 2006-10-22 20:39:49 UTC
(rev 8078)
+++ branches/soc2006-webui/Mailman/Queue/HTTPRunner.py 2006-10-23 19:10:11 UTC
(rev 8079)
@@ -23,10 +23,15 @@
from cStringIO import StringIO
from wsgiref.simple_server import make_server, WSGIRequestHandler
-from Mailman.Cgi.wsgi_app import mailman_app
from Mailman.Queue.Runner import Runner
from Mailman.configuration import config
+if config.WEB_INTERFACE == 'classic':
+ from Mailman.Cgi.wsgi_app import mailman_app
+if config.WEB_INTERFACE == 'new':
+ from Mailman.WebUI.wsgi_app import WebUI
+ mailman_app = WebUI()
+
hlog = logging.getLogger('mailman.http')
qlog = logging.getLogger('mailman.qrunner')
Modified: branches/soc2006-webui/Mailman/WebUI/page.py
===================================================================
--- branches/soc2006-webui/Mailman/WebUI/page.py 2006-10-22 20:39:49 UTC
(rev 8078)
+++ branches/soc2006-webui/Mailman/WebUI/page.py 2006-10-23 19:10:11 UTC
(rev 8079)
@@ -21,8 +21,10 @@
class Page(object):
def __init__(self, config):
+ sp = join(config.VAR_PREFIX,'Mailman/WebUI/templates')
+ print sp
self.template_loader = TemplateLoader(
- search_path=join(config['VAR_PREFIX'],'Mailman/WebUI/templates'),
+ search_path=sp,
auto_reload=True)
self.context = {'bm': BiteMarks(), 'moderationRequests': doNothing,
'location': doNothing, 'pieces': []
Modified: branches/soc2006-webui/Mailman/WebUI/templates/pieces/signin.html
===================================================================
--- branches/soc2006-webui/Mailman/WebUI/templates/pieces/signin.html
2006-10-22 20:39:49 UTC (rev 8078)
+++ branches/soc2006-webui/Mailman/WebUI/templates/pieces/signin.html
2006-10-23 19:10:11 UTC (rev 8079)
@@ -25,10 +25,10 @@
<fieldset py:match="[EMAIL PROTECTED]" py:attrs="select('@*')">
<legend>Sign In!</legend>
<label>Username or Email Address: <br />
- <input type="text" id="username_or_email" />
+ <input type="text" id="signin:username_or_email" />
</label>
<label>Password: <br />
- <input type="password" id="password" />
+ <input type="password" id="signin:password" />
</label>
<input type="submit" name="signin" value="Log In"/>
</fieldset>
Modified: branches/soc2006-webui/Mailman/WebUI/wsgi_app.py
===================================================================
--- branches/soc2006-webui/Mailman/WebUI/wsgi_app.py 2006-10-22 20:39:49 UTC
(rev 8078)
+++ branches/soc2006-webui/Mailman/WebUI/wsgi_app.py 2006-10-23 19:10:11 UTC
(rev 8079)
@@ -18,7 +18,7 @@
from os.path import join
import cgi
-from wsgiref.utils import shift_path_info
+from wsgiref.util import shift_path_info
from paste.fileapp import FileApp
from genshi.template import TemplateLoader
@@ -38,7 +38,8 @@
environ['HTTP_HOST'] = environ['HTTP_X_FORWARDED_HOST']
if environ.has_key('HTTP_X_FORWARDED_FOR'):
environ['REMOTE_HOST'] = environ['HTTP_X_FORWARDED_FOR']
-
+
+ path = environ['PATH_INFO']
pathparts = path.split('/')
# handle requests for 'static' data with paste's FileApp
@@ -55,6 +56,8 @@
path = environ['PATH_INFO']
# render the lists page
if path == '/':
+ from Mailman.WebUI.lists import Lists
+ lists = Lists(config)
return lists(environ, start_response)
# render the list page
@@ -62,7 +65,7 @@
shift_path_info(environ)
return list(environ, start_response)
- def parse_post_form(environ):
+ def parse_post_form(self, environ):
"""Because we are accepting all form elements on a page, we need
to know which have actually been submitted. Therefore form elements
are prefixed with their associated control, and a dictionary of
@@ -95,7 +98,7 @@
environ['webui.form'] = formvars
- def is_post_request(environ):
+ def is_post_request(self, environ):
if environ['REQUEST_METHOD'].upper() != 'POST':
return False
content_type = environ.get('CONTENT_TYPE',
'application/x-www-form-urlencoded')
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org