本文整理汇总了Python中ClusterShell.Event.EventHandler类的典型用法代码示例。如果您正苦于以下问题:Python EventHandler类的具体用法?Python EventHandler怎么用?Python EventHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EventHandler类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, task=task_self()):
EventHandler.__init__(self)
self.task = task
# Action duration
self.start = None
self.duration = None
示例2: __init__
def __init__(self, task, total):
EventHandler.__init__(self)
self.task = task
self.total = total
self.cnt_last = -1
self.tslen = len(str(self.total))
self.wholelen = 0
self.started = False
示例3: __init__
def __init__(self, task, total):
EventHandler.__init__(self)
self.task = task
self.total = total
self.cnt_last = -1
self.tslen = len(str(self.total))
self.wholelen = 0
self.started = False
# updated by worker handler for progress
self.start_time = 0
self.bytes_written = 0
示例4: __init__
def __init__(self):
"""
"""
EventHandler.__init__(self)
self.exit = False
self.worker = None
self._xml_reader = XMLReader()
self._parser = xml.sax.make_parser(["IncrementalParser"])
self._parser.setContentHandler(self._xml_reader)
self.logger = logging.getLogger(__name__)
示例5: __init__
def __init__(self, error_response=False):
"""
"""
EventHandler.__init__(self)
self.worker = None
# channel state flags
self.opened = False
self.setup = False
# will this channel send communication error responses?
self.error_response = error_response
self._xml_reader = XMLReader()
self._parser = xml.sax.make_parser(["IncrementalParser"])
self._parser.setContentHandler(self._xml_reader)
self.logger = logging.getLogger(__name__)
示例6: __init__
def __init__(self, task, gwchan, srcwkr):
EventHandler.__init__(self)
self.gwchan = gwchan # gateway channel
self.srcwkr = srcwkr # id of distant parent TreeWorker
self.worker = None # local TreeWorker instance
self.retcodes = {} # self-managed retcodes
self.logger = logging.getLogger(__name__)
# Grooming initialization
self.timer = None
qdelay = task.info("grooming_delay")
if qdelay > 1.0e-3:
# Enable messages and rc grooming - enable msgtree (#181)
task.set_default("stdout_msgtree", True)
task.set_default("stderr_msgtree", True)
# create auto-closing timer object for grooming
self.timer = task.timer(qdelay, self, qdelay, autoclose=True)
self.logger.debug("TreeWorkerResponder initialized grooming=%f", qdelay)
示例7: __init__
def __init__(self, action):
EventHandler.__init__(self)
assert action, "should not be be None"
# Current action hooked to the handler
self._action = action
示例8: __init__
def __init__(self, worker):
EventHandler.__init__(self)
self.ext_worker = worker
self.testtimer = False
示例9: __init__
def __init__(self, result):
"""Initialize our event handler with a ref to our result object."""
EventHandler.__init__(self)
self.result = result