Attachment 'request_cli.py.patch'

Download

   1 --- request_cli.py	2008-05-10 11:33:38.000000000 +0800
   2 +++ request_cli.py.old	2008-05-10 01:03:13.000000000 +0800
   3 @@ -14,20 +14,18 @@
   4      """ specialized on command line interface and script requests """
   5  
   6      def __init__(self, url='CLI', pagename='', properties={}):
   7 -        from urlparse import urlparse
   8 -        url = urlparse(url)
   9          self.saved_cookie = ''
  10          self.path_info = '/' + pagename
  11 -        self.query_string = url.query
  12 +        self.query_string = ''
  13          self.remote_addr = '127.0.0.1'
  14          self.is_ssl = 0
  15          self.http_user_agent = 'CLI/Script'
  16 -        self.url = url.geturl()
  17 +        self.url = url
  18          self.request_method = 'GET'
  19          self.request_uri = '/' + pagename # TODO check if /pagename works as URI for CLI usage
  20 -        self.http_host = url.netloc
  21 +        self.http_host = 'localhost'
  22          self.http_referer = ''
  23 -        self.script_name = ''
  24 +        self.script_name = '.'
  25          self.if_modified_since = None
  26          self.if_none_match = None
  27          RequestBase.__init__(self, properties)
  28 @@ -70,13 +68,13 @@
  29  
  30      # Accessors --------------------------------------------------------
  31  
  32 -#    def getQualifiedURL(self, uri=None):
  33 -#        """ Return a full URL starting with schema and host
  34 -#        
  35 -#        TODO: does this create correct pages when you render wiki pages
  36 -#              within a cli request?!
  37 -#        """
  38 -#        return uri
  39 +    def getQualifiedURL(self, uri=None):
  40 +        """ Return a full URL starting with schema and host
  41 +        
  42 +        TODO: does this create correct pages when you render wiki pages
  43 +              within a cli request?!
  44 +        """
  45 +        return uri
  46  
  47      # Headers ----------------------------------------------------------
  48  

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2008-05-10 04:03:42, 1.7 KB) [[attachment:request_cli.py.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.