Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
plone.app.portlets.portlets.feedparser._FeedURLHandler Class Reference

List of all members.

Public Member Functions

def http_error_default
def http_error_302
def http_error_301
def http_error_401

Static Public Attributes

 http_error_300 = http_error_302
 http_error_303 = http_error_302
 http_error_307 = http_error_302

Detailed Description

Definition at line 1689 of file feedparser.py.


Member Function Documentation

def plone.app.portlets.portlets.feedparser._FeedURLHandler.http_error_301 (   self,
  req,
  fp,
  code,
  msg,
  headers 
)

Definition at line 1706 of file feedparser.py.

01706 
01707     def http_error_301(self, req, fp, code, msg, headers):
01708         if headers.dict.has_key('location'):
01709             infourl = urllib2.HTTPRedirectHandler.http_error_301(self, req, fp, code, msg, headers)
01710         else:
01711             infourl = urllib.addinfourl(fp, headers, req.get_full_url())
01712         if not hasattr(infourl, 'status'):
01713             infourl.status = code
01714         return infourl

def plone.app.portlets.portlets.feedparser._FeedURLHandler.http_error_302 (   self,
  req,
  fp,
  code,
  msg,
  headers 
)

Definition at line 1697 of file feedparser.py.

01697 
01698     def http_error_302(self, req, fp, code, msg, headers):
01699         if headers.dict.has_key('location'):
01700             infourl = urllib2.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
01701         else:
01702             infourl = urllib.addinfourl(fp, headers, req.get_full_url())
01703         if not hasattr(infourl, 'status'):
01704             infourl.status = code
01705         return infourl

Here is the caller graph for this function:

def plone.app.portlets.portlets.feedparser._FeedURLHandler.http_error_401 (   self,
  req,
  fp,
  code,
  msg,
  headers 
)

Definition at line 1719 of file feedparser.py.

01719 
01720     def http_error_401(self, req, fp, code, msg, headers):
01721         # Check if
01722         # - server requires digest auth, AND
01723         # - we tried (unsuccessfully) with basic auth, AND
01724         # - we're using Python 2.3.3 or later (digest auth is irreparably broken in earlier versions)
01725         # If all conditions hold, parse authentication information
01726         # out of the Authorization header we sent the first time
01727         # (for the username and password) and the WWW-Authenticate
01728         # header the server sent back (for the realm) and retry
01729         # the request with the appropriate digest auth headers instead.
01730         # This evil genius hack has been brought to you by Aaron Swartz.
01731         host = urlparse.urlparse(req.get_full_url())[1]
01732         try:
01733             assert sys.version.split()[0] >= '2.3.3'
01734             assert base64 != None
01735             user, passw = base64.decodestring(req.headers['Authorization'].split(' ')[1]).split(':')
01736             realm = re.findall('realm="([^"]*)"', headers['WWW-Authenticate'])[0]
01737             self.add_password(realm, host, user, passw)
01738             retry = self.http_error_auth_reqed('www-authenticate', host, req, headers)
01739             self.reset_retry_count()
01740             return retry
01741         except:
01742             return self.http_error_default(req, fp, code, msg, headers)

Here is the call graph for this function:

def plone.app.portlets.portlets.feedparser._FeedURLHandler.http_error_default (   self,
  req,
  fp,
  code,
  msg,
  headers 
)

Definition at line 1690 of file feedparser.py.

01690 
01691     def http_error_default(self, req, fp, code, msg, headers):
01692         if ((code / 100) == 3) and (code != 304):
01693             return self.http_error_302(req, fp, code, msg, headers)
01694         infourl = urllib.addinfourl(fp, headers, req.get_full_url())
01695         infourl.status = code
01696         return infourl

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1715 of file feedparser.py.

Definition at line 1716 of file feedparser.py.

Definition at line 1717 of file feedparser.py.


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