From b57599ead428ebc18cc297843d5d5950cd765b7a Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 11 Oct 2011 20:49:04 +0200 Subject: only import web module from webpy --- index.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/index.py b/index.py index bdb569d..b7236b4 100755 --- a/index.py +++ b/index.py @@ -4,8 +4,8 @@ # own modules import config, util -import sys, os, re, time, socket, subprocess -from web import template, form, application, ctx, wsgi, config, sendmail +import sys, os, re, time, socket, subprocess, web +from web import form from Mailman.Utils import list_exists urls = ( @@ -16,8 +16,8 @@ urls = ( r'/help/unsubscribe\.([a-z]+).*', 'unsubscribe', ) -render = template.render('templates/', base='layout'); -app = application(urls, globals(), autoreload=False) +render = web.template.render('templates/', base='layout'); +app = web.application(urls, globals(), autoreload=False) create_form = form.Form( form.Textbox('name', @@ -69,13 +69,13 @@ class new: def get_user_information(self): try: - host = socket.gethostbyaddr(ctx.ip)[0] + host = socket.gethostbyaddr(web.ctx.ip)[0] except: - host = ctx.ip + host = web.ctx.ip - return {'ip': ctx.ip, + return {'ip': web.ctx.ip, 'host': host, - 'valid': self.validate(ctx.ip)} + 'valid': self.validate(web.ctx.ip)} def GET(self): form = create_form() @@ -107,10 +107,10 @@ if __name__ == "__main__": if '--debug' in sys.argv: sys.argv.remove('--debug') else: - config.debug = False + web.config.debug = False if '--fastcgi' in sys.argv: - wsgi.runwsgi = lambda func, addr=None: wsgi.runfcgi(func, addr) + web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr) sys.argv.remove('--fastcgi') app.run() -- cgit v1.2.3-1-g7c22