Пример #1
0
    def SvcDoRun(self):
        # Write an event log record - in debug mode we will also
        # see this message printed.
        servicemanager.LogMsg(
                servicemanager.EVENTLOG_INFORMATION_TYPE,
                servicemanager.PYS_SERVICE_STARTED,
                (self._svc_name_, '')
                )

        # attempt to retrieve comnfig file name
        self._svc_configFile_ = win32serviceutil.GetServiceCustomOption(
                GatewayService._svc_name_,
                configKey,
                self._svc_configFile_ )

        servicemanager.LogInfoMsg(
                "User configuration file %s"% (self._svc_configFile_)
                )

        start( self._svc_configFile_ )

        # Write another event log record.
        servicemanager.LogMsg(
                servicemanager.EVENTLOG_INFORMATION_TYPE,
                servicemanager.PYS_SERVICE_STOPPED,
                (self._svc_name_, "")
                )
Пример #2
0
# Copyright L.P.Klyne 2013
# Licenced under 3 clause BSD licence

#
#
# $Id: start-WebBrickGateway.py 2611 2008-08-11 20:05:08Z graham.klyne $
#
import sys

from WebBrickGateway.main import start

if __name__ == "__main__":

    # First look on the command line for a desired config file,
    if len(sys.argv) > 1:
        start(sys.argv[1])
    else:
        start()

# End. $Id: start-WebBrickGateway.py 2611 2008-08-11 20:05:08Z graham.klyne $