本文整理汇总了Python中Acspy.Common.Log.stopPeriodicFlush方法的典型用法代码示例。如果您正苦于以下问题:Python Log.stopPeriodicFlush方法的具体用法?Python Log.stopPeriodicFlush怎么用?Python Log.stopPeriodicFlush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acspy.Common.Log
的用法示例。
在下文中一共展示了Log.stopPeriodicFlush方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: shutdown
# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import stopPeriodicFlush [as 别名]
def shutdown(self, action):
'''
Shutdown the Container.
Normally invoked via CORBA but can also "self terminate" so to speak.
Parameters:
- action is an encrypted value that tells the container what action to take
oneway void shutdown (in unsigned long action)
'''
action = (action >> 8) & 0xFF
if (action == ACTIVATOR_EXIT) or (action == ACTIVATOR_REBOOT) or (action == ACTIVATOR_RELOAD):
self.logger.logTrace("Shutting down container: " + self.name)
#Logout from manager
ACSCorba.getManager().logout(self.token.h)
if (action == ACTIVATOR_REBOOT) or (action == ACTIVATOR_RELOAD):
print "Container.shutdown(): Action may not work correctly...-", str(action)
self.__init__(self.name)
else:
#tell the main thread of execution to stop
self.running = 0
Log.stopPeriodicFlush()
else:
self.logger.logWarning("Unable to process 'shutdown' request at this time: " + str(action))
# Close the alarm interface factory
Acsalarmpy.AlarmSystemInterfaceFactory.done()
示例2: testSetFlushInterval
# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import stopPeriodicFlush [as 别名]
def testSetFlushInterval(self):
"""PeriodicFlushCheck updates flush interval correctly"""
Log.startPeriodicFlush()
now = time.time()
next = Log.NEXTEVENT
Log.setFlushInterval(5)
self.assertNotEqual(next, Log.NEXTEVENT)
self.assertAlmostEqual(now + Log.INTERVAL, Log.NEXTEVENT[0],1)
Log.stopPeriodicFlush()
示例3: testCycleStartStop
# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import stopPeriodicFlush [as 别名]
def testCycleStartStop(self):
"""PeriodicFlushCheck flushing thread start and stops correctly."""
Log.startPeriodicFlush()
self.assertEqual(Log.DEFAULT_FLUSH_PERIOD, Log.INTERVAL)
self.assertEqual(True, isinstance(Log.SCHEDULER, sched.scheduler))
self.assertEqual(True, isinstance(Log.FLUSHTHREAD, threading.Thread))
self.assertEqual(True, Log.FLUSHTHREAD.isAlive())
self.assertEqual(False, Log.NEXTEVENT is None)
Log.stopPeriodicFlush()
self.assertEqual(False, Log.FLUSHTHREAD.isAlive())
示例4: testDoubleStart
# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import stopPeriodicFlush [as 别名]
def testDoubleStart(self):
"""PeriodicFlushCheck only one thread is created if start is called twice."""
Log.startPeriodicFlush()
ft = Log.FLUSHTHREAD
sc = Log.SCHEDULER
ne = Log.NEXTEVENT
Log.startPeriodicFlush()
self.assertEqual(ft, Log.FLUSHTHREAD)
self.assertEqual(sc, Log.SCHEDULER)
self.assertEqual(ne, Log.NEXTEVENT)
Log.stopPeriodicFlush()
示例5: testSetFlushIntervalInvalid
# 需要导入模块: from Acspy.Common import Log [as 别名]
# 或者: from Acspy.Common.Log import stopPeriodicFlush [as 别名]
def testSetFlushIntervalInvalid(self):
"""PeriodicFlushCheck flush thread stopped when invalid interval is set"""
Log.startPeriodicFlush()
Log.setFlushInterval(-5)
self.assertEqual(False, Log.FLUSHTHREAD.isAlive())
Log.stopPeriodicFlush()