当前位置: 首页>>代码示例>>Python>>正文


Python win32serviceutil.ServiceFramework方法代码示例

本文整理汇总了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 
开发者ID:AutohomeRadar,项目名称:Windows-Agent,代码行数:7,代码来源:agent.py

示例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 = [] 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:8,代码来源:pipeTestService.py

示例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. 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:serviceEvents.py

示例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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:15,代码来源:serviceEvents.py

示例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) 
开发者ID:frappe,项目名称:biometric-attendance-sync-tool,代码行数:9,代码来源:SMWinservice.py

示例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) 
开发者ID:architecture-building-systems,项目名称:CityEnergyAnalyst,代码行数:7,代码来源:ceajenkins.py

示例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) 
开发者ID:scalyr,项目名称:scalyr-agent-2,代码行数:6,代码来源:platform_windows.py

示例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) 
开发者ID:scalyr,项目名称:scalyr-agent-2,代码行数:8,代码来源:platform_windows.py

示例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 
开发者ID:pytest-dev,项目名称:execnet,代码行数:17,代码来源:socketserverservice.py

示例10: __init__

# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
        win32serviceutil.ServiceFramework.__init__(self, args)
        self.isAlive = True 
开发者ID:ibmresilient,项目名称:resilient-python-api,代码行数:5,代码来源:service_wrapper.py

示例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) 
开发者ID:postgrespro,项目名称:mamonsu,代码行数:5,代码来源:service_win32.py

示例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 
开发者ID:naparuba,项目名称:opsbro,代码行数:7,代码来源:windows_service.py

示例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) 
开发者ID:target,项目名称:grease,代码行数:6,代码来源:DaemonCmd.py

示例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_) 
开发者ID:grawity,项目名称:code,代码行数:6,代码来源:powermonitor.py

示例15: __init__

# 需要导入模块: import win32serviceutil [as 别名]
# 或者: from win32serviceutil import ServiceFramework [as 别名]
def __init__(self, args):
        win32serviceutil.ServiceFramework.__init__(self, args) 
开发者ID:grawity,项目名称:code,代码行数:4,代码来源:win32-identd.py


注:本文中的win32serviceutil.ServiceFramework方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。