当前位置: 首页>>代码示例>>Python>>正文


Python XMLFilterBase.__init__方法代码示例

本文整理汇总了Python中xml.sax.saxutils.XMLFilterBase.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python XMLFilterBase.__init__方法的具体用法?Python XMLFilterBase.__init__怎么用?Python XMLFilterBase.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xml.sax.saxutils.XMLFilterBase的用法示例。


在下文中一共展示了XMLFilterBase.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
    def __init__(
            self, upstream, downstream, tag_name,
            layers_blacklist=None, layers_whitelist=None):
        XMLFilterBase.__init__(self, upstream)
        self._downstream = downstream
        self._accumulator = []

        assert layers_blacklist is not None or layers_whitelist is not None, \
            "either layers_blacklist OR layers_whitelist must be set"
        assert not (
            layers_blacklist is not None and
            layers_whitelist is not None), \
            "only either layers_blacklist OR layers_whitelist can be set"

        if layers_blacklist is not None:
            layers_blacklist = [layer.lower() for layer in layers_blacklist]
        if layers_whitelist is not None:
            layers_whitelist = [layer.lower() for layer in layers_whitelist]
        self.layers_blacklist = layers_blacklist
        self.layers_whitelist = layers_whitelist

        self.layers_path = []
        self.in_name = False
        self.tag_name = tag_name
        self.level = 0
开发者ID:yjacolin,项目名称:c2cgeoportal,代码行数:27,代码来源:filter_capabilities.py

示例2: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
 def __init__(self, file):
     XMLFilterBase.__init__(self)
     self.generator = XMLGenerator(file, 'UTF-8')
     self.generator.startPrefixMapping(u'', u'http://www.eucalyptus.com/ns/reporting/export/2012-08-24/')
     self.replyData = StringIO()
     self.replyGenerator = XMLGenerator( self.replyData, 'UTF-8' )
     self.switchTarget( self.replyGenerator )
开发者ID:eucalyptus,项目名称:eucalyptus,代码行数:9,代码来源:exportreportdata.py

示例3: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
  def __init__ (self, upstream, SkipEvents = False):

    self.EventCounters = {}
    self.TotalEventCount = 0
    self.SkipEvents = SkipEvents
    self.NewEventType = True
    self.AccumulatingEventContent = False
    self.CurrentEventContent = ''
    self.StreamCopyEnabled = False

    # This buffer will be used to compile a copy of the incoming EDXML
    # stream that has all event data filtered out. We use this stripped
    # copy to do RelaxNG validation, as Python has no incremental XML
    # validator like for instance PHP does.
    self.DefinitionsXMLStringIO = StringIO()

    # And this is the XMLGenerator instance that we will use
    # to fill the buffer.
    self.DefinitionsXMLGenerator = XMLGenerator(self.DefinitionsXMLStringIO, 'utf-8')

    """EDXMLDefinitions instance"""
    self.Definitions = EDXMLDefinitions()

    # We want the EDXMLDefinitions instance to call our
    # error handler, so anyone who wishes to extend the EDXMLParser
    # class can reimplement it to handle all generated errors.
    self.Definitions.Error = self.Error

    XMLFilterBase.__init__(self, upstream)
    EDXMLBase.__init__(self)
开发者ID:dtakken,项目名称:edxml-sdk,代码行数:32,代码来源:EDXMLParser.py

示例4: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
    def __init__(self, upstream, downstream, text_filter, manualOverride = False):
        XMLFilterBase.__init__(self, upstream)
        self._downstream = downstream
        self._accumulator = []
        self.text_filter = text_filter
        self.should_filter = False
	self.manualOverride = manualOverride # Set this to True if you want text_filter never to run
        return
开发者ID:sethwoodworth,项目名称:wikipedia-style-edits,代码行数:10,代码来源:text_normalize_filter.py

示例5: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
	def __init__(self, upstream, downstream):
		XMLFilterBase.__init__(self, upstream)
		self._downstream = downstream
		self._accumulator = []
		#self.padding_level = -1  # for pretty debug printing
		self.current_element = None  # what element are we inside?
		self.passthrough = False  # allow current element through the filter?
		# Placeholders for the attributes for the builder and shape elements...
		self.builder_info = None
		self.shape_info = None
开发者ID:matatk,项目名称:agrip,代码行数:12,代码来源:04-d-buildermac.py

示例6: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
 def __init__(self, upstream, downstream, filename,chunksize = 100):
     XMLFilterBase.__init__(self, upstream)
     self.handlers = []
     self.pushHandler(downstream)
     self.filename = filename
     self.chunksize = int(chunksize)
     self.rec_count = 0
     self.chunknames = []
     self.tempdir = ''
     self.verbose = False
开发者ID:olac,项目名称:olac,代码行数:12,代码来源:saxsplit2.py

示例7: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
 def __init__(self, *args):
     XMLFilterBase.__init__(self, *args)
     self._accumulator = []
     return
开发者ID:ninemoreminutes,项目名称:openassign-server,代码行数:6,代码来源:saxtools.py

示例8: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
 def __init__(self, parser=None, downstream=None, iso639=None):
     XMLFilterBase.__init__(self, parser)
     self.__downstream = downstream
     self.__iso639 = iso639
     self.__is_language = False
开发者ID:Archer-sys,项目名称:ibus,代码行数:7,代码来源:iso639converter.py

示例9: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
 def __init__(self, rules):
     XMLFilterBase.__init__(self)
     self.rules = rules
     self.prefixes = {None:None}
     self.prefixesStack = {}
     self.contexts = [FilterContext()]
开发者ID:H1d3r,项目名称:binary_blobs,代码行数:8,代码来源:FragmentFilter.py

示例10: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
	def __init__(self, upstream, downstream):
		XMLFilterBase.__init__(self, upstream)
		self.__downstream = downstream
		self.__isUni = False
		self.__uniText = u""
开发者ID:impactcentre,项目名称:pol,代码行数:7,代码来源:page_normalizer.py

示例11: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
 def __init__(self, upstream, downstream, stereo, kind):
     XMLFilterBase.__init__(self, upstream)
     self._downstream = downstream
     self._stereotype = stereo
     self._kind = kind
     return
开发者ID:hitej,项目名称:meta-core,代码行数:8,代码来源:remove_tag.py

示例12: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
 def __init__(self, parent):
     self.in_universe = -1
     self.recording = None
     self.cell = None
     self.cell_active = None
     XMLFilterBase.__init__(self, parent)
开发者ID:molmod,项目名称:zeobuilder,代码行数:8,代码来源:zml.py

示例13: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
 def __init__(self, upstream, downstream, limit=200):
     XMLFilterBase.__init__(self, upstream)
     self._count = 0
     self._limit = limit
     self._downstream = downstream
开发者ID:sitn,项目名称:crdppf_core,代码行数:7,代码来源:wfsparsing.py

示例14: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
	def __init__(self, upstream, downstream):
		XMLFilterBase.__init__(self, upstream)
		self.__downstream = downstream
		self.__isOrth = False
		self.__isBase = False
		self.__orthText = u""
开发者ID:impactcentre,项目名称:pol,代码行数:8,代码来源:xces_normalizer.py

示例15: __init__

# 需要导入模块: from xml.sax.saxutils import XMLFilterBase [as 别名]
# 或者: from xml.sax.saxutils.XMLFilterBase import __init__ [as 别名]
 def __init__(self, upstream, downstream):
     XMLFilterBase.__init__(self, upstream)
     self._downstream=downstream
     self._accumulator=[]
开发者ID:atiassa,项目名称:recommend-2011,代码行数:6,代码来源:page_parser.py


注:本文中的xml.sax.saxutils.XMLFilterBase.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。