MCPcopy Index your code
hub / github.com/clips/pattern / __init__

Method __init__

pattern/web/feed/feedparser.py:546–589  ·  view source on GitHub ↗
(self, baseuri=None, baselang=None, encoding=u'utf-8')

Source from the content-addressed store, hash-verified

544 html_types = [u'text/html', u'application/xhtml+xml']
545
546 def __init__(self, baseuri=None, baselang=None, encoding=u'utf-8'):
547 if not self._matchnamespaces:
548 for k, v in self.namespaces.items():
549 self._matchnamespaces[k.lower()] = v
550 self.feeddata = FeedParserDict() # feed-level data
551 self.encoding = encoding # character encoding
552 self.entries = [] # list of entry-level data
553 self.version = u'' # feed type/version, see SUPPORTED_VERSIONS
554 self.namespacesInUse = {} # dictionary of namespaces defined by the feed
555
556 # the following are used internally to track state;
557 # this is really out of control and should be refactored
558 self.infeed = 0
559 self.inentry = 0
560 self.incontent = 0
561 self.intextinput = 0
562 self.inimage = 0
563 self.inauthor = 0
564 self.incontributor = 0
565 self.inpublisher = 0
566 self.insource = 0
567 self.sourcedata = FeedParserDict()
568 self.contentparams = FeedParserDict()
569 self._summaryKey = None
570 self.namespacemap = {}
571 self.elementstack = []
572 self.basestack = []
573 self.langstack = []
574 self.baseuri = baseuri or u''
575 self.lang = baselang or None
576 self.svgOK = 0
577 self.title_depth = -1
578 self.depth = 0
579 if baselang:
580 self.feeddata['language'] = baselang.replace('_','-')
581
582 # A map of the following form:
583 # {
584 # object_that_value_is_set_on: {
585 # property_name: depth_of_node_property_was_extracted_from,
586 # other_property: depth_of_node_property_was_extracted_from,
587 # },
588 # }
589 self.property_depth_map = {}
590
591 def _normalize_attributes(self, kv):
592 k = kv[0].lower()

Callers

nothing calls this directly

Calls 2

FeedParserDictClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected