本文整理汇总了Python中win32serviceutil.ServiceFramework方法的典型用法代码示例。如果您正苦于以下问题:Python win32serviceutil.ServiceFramework方法的具体用法?Python win32serviceutil.ServiceFramework怎么用?Python win32serviceutil.ServiceFramework使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类win32serviceutil
的用法示例。
在下文中一共展示了win32serviceutil.ServiceFramework方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
socket.setdefaulttimeout(60)
self.isAlive = True
示例2: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = CreateEvent(None, 0, 0, None)
self.overlapped = pywintypes.OVERLAPPED()
self.overlapped.hEvent = CreateEvent(None,0,0,None)
self.thread_handles = []
示例3: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
# register for a device notification - we pass our service handle
# instead of a window handle.
filter = win32gui_struct.PackDEV_BROADCAST_DEVICEINTERFACE(
GUID_DEVINTERFACE_USB_DEVICE)
self.hdn = win32gui.RegisterDeviceNotification(self.ssh, filter,
win32con.DEVICE_NOTIFY_SERVICE_HANDLE)
# Override the base class so we can accept additional events.
示例4: GetAcceptedControls
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def GetAcceptedControls(self):
# say we accept them all.
rc = win32serviceutil.ServiceFramework.GetAcceptedControls(self)
rc |= win32service.SERVICE_ACCEPT_PARAMCHANGE \
| win32service.SERVICE_ACCEPT_NETBINDCHANGE \
| win32service.SERVICE_CONTROL_DEVICEEVENT \
| win32service.SERVICE_ACCEPT_HARDWAREPROFILECHANGE \
| win32service.SERVICE_ACCEPT_POWEREVENT \
| win32service.SERVICE_ACCEPT_SESSIONCHANGE
return rc
# All extra events are sent via SvcOtherEx (SvcOther remains as a
# function taking only the first args for backwards compat)
示例5: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
'''
Constructor of the winservice
'''
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
socket.setdefaulttimeout(60)
示例6: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
self._running = True
socket.setdefaulttimeout(60)
示例7: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, *args):
self.controller = None
win32serviceutil.ServiceFramework.__init__(self, *args)
self._stop_event = win32event.CreateEvent(None, 0, 0, None)
示例8: SvcOther
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def SvcOther(self, control):
# See if the control signal is our custom one, otherwise dispatch it to the superclass.
if _SERVICE_CONTROL_DETAILED_REPORT_ == control:
self.controller.invoke_status_handler()
else:
win32serviceutil.ServiceFramework.SvcOther(self, control)
示例9: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
# The exe-file has messages for the Event Log Viewer.
# Register the exe-file as event source.
#
# Probably it would be better if this is done at installation time,
# so that it also could be removed if the service is uninstalled.
# Unfortunately it cannot be done in the 'if __name__ == "__main__"'
# block below, because the 'frozen' exe-file does not run this code.
#
win32evtlogutil.AddSourceToRegistry(
self._svc_display_name_, servicemanager.__file__, "Application"
)
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
self.WAIT_TIME = 1000 # in milliseconds
示例10: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.isAlive = True
示例11: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
示例12: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
# create an event to listen for stop requests on
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
# core logic of the service
示例13: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
socket.setdefaulttimeout(60)
示例14: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
svcutil.ServiceFramework.__init__(self, args)
PowerMonitor.__init__(self, name=self._svc_display_name_,
classname=self._svc_name_)
示例15: __init__
# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)