當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。