Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
Request Class Reference

Public Member Functions

def __init__
 
def __getattr__
 
def add_data
 
def has_data
 
def get_data
 
def get_full_url
 
def get_type
 
def get_host
 
def get_selector
 
def set_proxy
 
def add_header
 

Data Fields

 type
 
 host
 
 port
 
 data
 
 headers
 

Detailed Description

Definition at line 183 of file urllib2.py.

Constructor & Destructor Documentation

def __init__ (   self,
  url,
  data = None,
  headers = {} 
)

Definition at line 185 of file urllib2.py.

References Request.__original, and urllib.unwrap().

186  def __init__(self, url, data=None, headers={}):
187  # unwrap('<URL:type://host/path>') --> 'type://host/path'
188  self.__original = unwrap(url)
189  self.type = None
190  # self.__r_type is what's left after doing the splittype
191  self.host = None
192  self.port = None
193  self.data = data
194  self.headers = {}
195  self.headers.update(headers)

Member Function Documentation

def __getattr__ (   self,
  attr 
)

Definition at line 196 of file urllib2.py.

197  def __getattr__(self, attr):
198  # XXX this is a fallback mechanism to guard against these
199  # methods getting called in a non-standard order. this may be
200  # too complicated and/or unnecessary.
201  # XXX should the __r_XXX attributes be public?
202  if attr[:12] == '_Request__r_':
203  name = attr[12:]
204  if hasattr(Request, 'get_' + name):
205  getattr(self, 'get_' + name)()
206  return getattr(self, attr)
207  raise AttributeError, attr
def add_data (   self,
  data 
)

Definition at line 208 of file urllib2.py.

References _localized_month.data, _localized_day.data, SubPattern.data, _Hqxcoderengine.data, _Rlecoderengine.data, Request.data, simple_producer.data, _Environ.data, and FormContentDict.data.

209  def add_data(self, data):
210  self.data = data
def add_header (   self,
  key,
  val 
)

Definition at line 241 of file urllib2.py.

References Message.headers, Request.headers, BaseHTTPRequestHandler.headers, MiniFieldStorage.headers, FieldStorage.headers, HTTP.headers, addinfo.headers, and addinfourl.headers.

242  def add_header(self, key, val):
243  # useful for something like authentication
244  self.headers[key] = val
def get_data (   self)

Definition at line 214 of file urllib2.py.

References _localized_month.data, _localized_day.data, SubPattern.data, _Hqxcoderengine.data, _Rlecoderengine.data, Request.data, simple_producer.data, _Environ.data, and FormContentDict.data.

215  def get_data(self):
216  return self.data
def get_full_url (   self)

Definition at line 217 of file urllib2.py.

References Request.__original.

218  def get_full_url(self):
219  return self.__original
def get_host (   self)

Definition at line 227 of file urllib2.py.

References Request.__r_host, Request.__r_type, POP3.host, FTP.host, NNTP.host, Telnet.host, Request.host, HTTPConnection.host, ftpwrapper.host, urllib.splithost(), and rfc822.unquote().

228  def get_host(self):
229  if self.host is None:
230  self.host, self.__r_host = splithost(self.__r_type)
231  if self.host:
232  self.host = unquote(self.host)
233  return self.host
def get_selector (   self)

Definition at line 234 of file urllib2.py.

References Request.__r_host.

235  def get_selector(self):
236  return self.__r_host
def get_type (   self)

Definition at line 220 of file urllib2.py.

References Request.__original, Request.__r_type, urllib.splittype(), Message.type, URLopener.type, Request.type, MiniFieldStorage.type, and FieldStorage.type.

221  def get_type(self):
222  if self.type is None:
223  self.type, self.__r_type = splittype(self.__original)
224  if self.type is None:
225  raise ValueError, "unknown url type: %s" % self.__original
226  return self.type
def has_data (   self)

Definition at line 211 of file urllib2.py.

References _localized_month.data, _localized_day.data, SubPattern.data, _Hqxcoderengine.data, _Rlecoderengine.data, Request.data, simple_producer.data, _Environ.data, and FormContentDict.data.

212  def has_data(self):
213  return self.data is not None
def set_proxy (   self,
  host,
  type 
)

Definition at line 237 of file urllib2.py.

References Request.__original, Request.__r_host, POP3.host, FTP.host, NNTP.host, Telnet.host, Request.host, HTTPConnection.host, ftpwrapper.host, Message.type, URLopener.type, Request.type, MiniFieldStorage.type, and FieldStorage.type.

238  def set_proxy(self, host, type):
239  self.host, self.type = host, type
240  self.__r_host = self.__original

Field Documentation

data

Definition at line 192 of file urllib2.py.

headers

Definition at line 193 of file urllib2.py.

host

Definition at line 190 of file urllib2.py.

port

Definition at line 191 of file urllib2.py.

type

Definition at line 188 of file urllib2.py.


The documentation for this class was generated from the following file: