Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
plone.app.portlets.portlets.feedparser.FeedParserDict Class Reference
Inheritance diagram for plone.app.portlets.portlets.feedparser.FeedParserDict:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.portlets.feedparser.FeedParserDict:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __getitem__
def __setitem__
def get
def setdefault
def has_key
def __getattr__
def __setattr__
def __contains__

Static Public Attributes

dictionary keymap

Detailed Description

Definition at line 172 of file feedparser.py.


Member Function Documentation

Definition at line 244 of file feedparser.py.

00244 
00245     def __contains__(self, key):
00246         return self.has_key(key)

Here is the call graph for this function:

Definition at line 227 of file feedparser.py.

00227 
00228     def __getattr__(self, key):
00229         try:
00230             return self.__dict__[key]
00231         except KeyError:
00232             pass
00233         try:
00234             assert not key.startswith('_')
00235             return self.__getitem__(key)
00236         except:
00237             raise AttributeError, "object has no attribute '%s'" % key

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 188 of file feedparser.py.

00188 
00189     def __getitem__(self, key):
00190         if key == 'category':
00191             return UserDict.__getitem__(self, 'tags')[0]['term']
00192         if key == 'categories':
00193             return [(tag['scheme'], tag['term']) for tag in UserDict.__getitem__(self, 'tags')]
00194         realkey = self.keymap.get(key, key)
00195         if type(realkey) == types.ListType:
00196             for k in realkey:
00197                 if UserDict.has_key(self, k):
00198                     return UserDict.__getitem__(self, k)
00199         if UserDict.has_key(self, key):
00200             return UserDict.__getitem__(self, key)
00201         return UserDict.__getitem__(self, realkey)

Here is the caller graph for this function:

Definition at line 238 of file feedparser.py.

00238 
00239     def __setattr__(self, key, value):
00240         if key.startswith('_') or key == 'data':
00241             self.__dict__[key] = value
00242         else:
00243             return self.__setitem__(key, value)

Here is the call graph for this function:

Definition at line 202 of file feedparser.py.

00202 
00203     def __setitem__(self, key, value):
00204         for k in self.keymap.keys():
00205             if key == k:
00206                 key = self.keymap[k]
00207                 if type(key) == types.ListType:
00208                     key = key[0]
00209         return UserDict.__setitem__(self, key, value)

Here is the caller graph for this function:

def plone.app.portlets.portlets.feedparser.FeedParserDict.get (   self,
  key,
  default = None 
)

Definition at line 210 of file feedparser.py.

00210 
00211     def get(self, key, default=None):
00212         if self.has_key(key):
00213             return self[key]
00214         else:
00215             return default

Here is the call graph for this function:

Definition at line 221 of file feedparser.py.

00221 
00222     def has_key(self, key):
00223         try:
00224             return hasattr(self, key) or UserDict.has_key(self, key)
00225         except AttributeError:
00226             return False
        

Here is the caller graph for this function:

Definition at line 216 of file feedparser.py.

00216 
00217     def setdefault(self, key, value):
00218         if not self.has_key(key):
00219             self[key] = value
00220         return self[key]
        

Here is the call graph for this function:


Member Data Documentation

Initial value:
{'channel': 'feed',
              'items': 'entries',
              'guid': 'id',
              'date': 'updated',
              'date_parsed': 'updated_parsed',
              'description': ['subtitle', 'summary'],
              'url': ['href'],
              'modified': 'updated',
              'modified_parsed': 'updated_parsed',
              'issued': 'published',
              'issued_parsed': 'published_parsed',
              'copyright': 'rights',
              'copyright_detail': 'rights_detail',
              'tagline': 'subtitle',
              'tagline_detail': 'subtitle_detail'}

Definition at line 173 of file feedparser.py.


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