(self, baseuri=None, baselang=None, encoding='utf-8')
| 510 | html_types = ['text/html', 'application/xhtml+xml'] |
| 511 | |
| 512 | def __init__(self, baseuri=None, baselang=None, encoding='utf-8'): |
| 513 | if _debug: sys.stderr.write('initializing FeedParser\n') |
| 514 | if not self._matchnamespaces: |
| 515 | for k, v in self.namespaces.items(): |
| 516 | self._matchnamespaces[k.lower()] = v |
| 517 | self.feeddata = FeedParserDict() # feed-level data |
| 518 | self.encoding = encoding # character encoding |
| 519 | self.entries = [] # list of entry-level data |
| 520 | self.version = '' # feed type/version, see SUPPORTED_VERSIONS |
| 521 | self.namespacesInUse = {} # dictionary of namespaces defined by the feed |
| 522 | |
| 523 | # the following are used internally to track state; |
| 524 | # this is really out of control and should be refactored |
| 525 | self.infeed = 0 |
| 526 | self.inentry = 0 |
| 527 | self.incontent = 0 |
| 528 | self.intextinput = 0 |
| 529 | self.inimage = 0 |
| 530 | self.inauthor = 0 |
| 531 | self.incontributor = 0 |
| 532 | self.inpublisher = 0 |
| 533 | self.insource = 0 |
| 534 | self.sourcedata = FeedParserDict() |
| 535 | self.contentparams = FeedParserDict() |
| 536 | self._summaryKey = None |
| 537 | self.namespacemap = {} |
| 538 | self.elementstack = [] |
| 539 | self.basestack = [] |
| 540 | self.langstack = [] |
| 541 | self.baseuri = baseuri or '' |
| 542 | self.lang = baselang or None |
| 543 | self.svgOK = 0 |
| 544 | self.hasTitle = 0 |
| 545 | if baselang: |
| 546 | self.feeddata['language'] = baselang.replace('_','-') |
| 547 | |
| 548 | def unknown_starttag(self, tag, attrs): |
| 549 | if _debug: sys.stderr.write('start %s with %s\n' % (tag, attrs)) |
nothing calls this directly
no test coverage detected