本文整理汇总了Python中xml.sax.ContentHandler.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ContentHandler.__init__方法的具体用法?Python ContentHandler.__init__怎么用?Python ContentHandler.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml.sax.ContentHandler
的用法示例。
在下文中一共展示了ContentHandler.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self):
ContentHandler.__init__(self)
self.isItem = False
self.isTitle = False
self.isLink = False
self.tuples = []
self.ndx = 0
示例2: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self):
ContentHandler.__init__(self)
self.__level = -1
self.__main_menus = []
self.__parent_menus = []
self.__actions_specs = []
self.__menuItem = None
示例3: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self):
ContentHandler.__init__(self) # can't use super() here !?
self.modelVariables = []
self.ruleConstants = []
self.moleculeConstants = []
self.rewardConstants = []
self.switch1 = ""
self.switch2 = ""
示例4: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self):
ContentHandler.__init__(self)
self.__inItem = False
self.__inTitle = False
self.__inIssued = False
self.title = ""
self.issued = ""
self.entries = []
示例5: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self):
"""
@param override: erase existing database?
"""
ContentHandler.__init__(self)
self.tag = "row"
self.answer_type = "2"
self.question_type = "1"
self.on_post = []
示例6: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self):
ContentHandler.__init__(self)
self.chars = u""
self.currentTag = None
self.rootObject = None
self.objectPath = []
self.styles = {}
self.schemas = {}
self.resources = set()
示例7: CasperMobileDeviceListHandler
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
# This class is used to parse the /mobiledevices list to get all of the ids and usernames
class CasperMobileDeviceListHandler(ContentHandler):
def __init__(self, grabber, deviceMap, unmanagedDeviceMap):
ContentHandler.__init__(self)
self.grabber = grabber
self.deviceMap = deviceMap
self.unmanagedDeviceMap = unmanagedDeviceMap
self.currentID = ""
self.inID = False
示例8: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self, handler):
ContentHandler.__init__(self)
# get a logger
self.__logger = logging.getLogger("chattest.common.MessageParser")
self.__logger.debug("Created a new MessageParser object...")
# init member variables
self.__handler = handler
self.__state = []
self.__message = ""
示例9: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self):
ContentHandler.__init__(self)
self.current_track = None # holds data for the current track
self.parsed = {} # holds all tracks
self.content = "" # accumulator for character data
self.numeric = re.compile('\d+\.?\d*$')
self.float_required = ['file_size', 'duration', 'overall_bit_rate', 'stream_size',
'ID', 'file_size', 'bit_rate', 'width', 'height',
'frame_rate', 'resolution', 'bit_depth', 'delay',]
# duration is in milliseconds, we want seconds
self.conversions = { 'duration': lambda x: str(float(x)/1000.) }
示例10: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self, parameters_dictionary, parameter_set_name):
self.parameters_dictionary = parameters_dictionary
# self.expected_parameters_name = parameters_name
# self.has_expected_parameters_name = False
self.expected_parameter_set_name = parameter_set_name
self.has_expected_parameter_set_name = False
# super(ParamsXMLReader, self).__init__() # doesn't work! Use below instead.
ContentHandler.__init__(self)
示例11: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self, env={}):
ContentHandler.__init__(self)
# output file
self.out = StringIO()
# stack of (action, environment, release tag) for each current context
self.stack = [('', env, '')]
# stack of (id, tag) for each tag. Used to match tags on self.stack
self.tag_stack = []
# flag when we are in a singleton tag
# used by self.showStartElement(), self.showEndElement
self.singleton = False
示例12: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self, content):
ContentHandler.__init__(self)
self.content = False
self.tree = []
self.stack = []
self.stack_usage = []
self.strong = False
self.emphasis = False
saxify(content, self)
示例13: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self):
ContentHandler.__init__(self)
self.rootAttributes = None
self.__parser = make_parser()
# Init the parser's handlers
self.restoreParser()
# No container at this time
self.__container = None
# Reset all the containers, to make sure previous runs don't leave
# garbage data
for container in self.container_dispatch.values():
container.reset()
示例14: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self):
ContentHandler.__init__(self)
self.map = Map()
self.dataBuffer = ''
self.dataEncoding = ''
self.inMap = False
self.inTileset = False
self.inLayer = False
self.inData = False
self.inProperties = False
示例15: __init__
# 需要导入模块: from xml.sax import ContentHandler [as 别名]
# 或者: from xml.sax.ContentHandler import __init__ [as 别名]
def __init__(self, delegate):
ContentHandler.__init__(self)
self.currentTag = ''
self.currentChannel = ''
self.event = ''
self.horizontalUnit = ''
self.verticalUnit = ''
self.eventTime = ''
self.chanData = {}
self.chanData['CHN1'] = {}
self.chanData['CHN2'] = {}
self.chanData['CHN3'] = {}
self.chanData['CHN4'] = {}
self.numEvents = 0
self.delegate = delegate