changeset 4258:3f8be25b79cc

Replaced use of request_cli with ScriptContext (all occurrences)
author Florian Krupicka <florian.krupicka@googlemail.com>
date Fri, 01 Aug 2008 00:06:14 +0200
parents 29e81e73fe67
children e1a63fb9bb4d
files MoinMoin/action/SubscribeUser.py MoinMoin/mail/mailimport.py MoinMoin/packages.py MoinMoin/script/cli/show.py MoinMoin/search/builtin.py
diffstat 5 files changed, 12 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/SubscribeUser.py	Thu Jul 31 16:01:55 2008 +0200
+++ b/MoinMoin/action/SubscribeUser.py	Fri Aug 01 00:06:14 2008 +0200
@@ -117,9 +117,8 @@
         request_url = "localhost/"
 
     # Setup MoinMoin environment
-    from MoinMoin.request import request_cli
-    request = request_cli.Request(url=request_url)
-    request.form = request.args = request.setup_args()
+    from MoinMoin.web.contexts import ScriptContext
+    request = ScriptContext(url=request_url)
 
     from MoinMoin.formatter.text_plain import Formatter
     formatter = Formatter(request)
--- a/MoinMoin/mail/mailimport.py	Thu Jul 31 16:01:55 2008 +0200
+++ b/MoinMoin/mail/mailimport.py	Fri Aug 01 00:06:14 2008 +0200
@@ -17,7 +17,6 @@
 from MoinMoin.action.AttachFile import add_attachment, AttachmentAlreadyExists
 from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
-from MoinMoin.request.request_cli import Request as RequestCLI
 # python, at least up to 2.4, ships a broken parser for headers
 from MoinMoin.support.HeaderFixed import decode_header
 
@@ -313,11 +312,12 @@
 
 if __name__ == "__main__":
     if len(sys.argv) > 1:
-        url = sys.argv[1]
+        request_url = sys.argv[1]
     else:
-        url = 'localhost/'
+        request_url = 'localhost/'
 
-    request = RequestCLI(url=url)
+    from MoinMoin.web.contexts import ScriptContext
+    request = ScriptContext(url=request_url)
 
     try:
         import_mail_from_file(request, infile)
--- a/MoinMoin/packages.py	Thu Jul 31 16:01:55 2008 +0200
+++ b/MoinMoin/packages.py	Fri Aug 01 00:06:14 2008 +0200
@@ -533,9 +533,8 @@
         request_url = "localhost/"
 
     # Setup MoinMoin environment
-    from MoinMoin.request import request_cli
-    request = request_cli.Request(url=request_url)
-    request.form = request.args = request.setup_args()
+    from MoinMoin.web.contexts import ScriptContext
+    request = ScriptContext(url=request_url)
 
     package = ZipPackage(request, packagefile)
     if not package.isPackage():
--- a/MoinMoin/script/cli/show.py	Thu Jul 31 16:01:55 2008 +0200
+++ b/MoinMoin/script/cli/show.py	Fri Aug 01 00:06:14 2008 +0200
@@ -7,6 +7,7 @@
 """
 
 from MoinMoin.script import MoinScript
+from MoinMoin.wsgiapp import run
 
 class PluginScript(MoinScript):
     """\
@@ -27,4 +28,4 @@
 
     def mainloop(self):
         self.init_request()
-        self.request.run()
+        run(self.request)
--- a/MoinMoin/search/builtin.py	Thu Jul 31 16:01:55 2008 +0200
+++ b/MoinMoin/search/builtin.py	Fri Aug 01 00:06:14 2008 +0200
@@ -401,9 +401,9 @@
 
         @param request: current request
         """
-        from MoinMoin.request.request_cli import Request
+        from MoinMoin.web.contexts import ScriptContext
         from MoinMoin.security import Permissions
-        request = Request(request.url)
+        request = ScriptContext(request.url)
         class SecurityPolicy(Permissions):
             def read(self, *args, **kw):
                 return True