本文整理匯總了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