예제 #1
0
 def __init__(self):
     Daemon.__init__(
         self,
         get_embedded_filename(mail_config),
         secret_key,
         installation_path,
         directory,
         catcher)
예제 #2
0
 def __init__(self):
     self.start_time = time.time()
     self.max_life = 86400  # 24 hours in seconds
     self.last_run = 0
     Daemon.__init__(
         self,
         get_embedded_filename(mail_config),
         secret_key,
         installation_path,
         directory,
         catcher)
     self.file_cleaner = FileCleaner('/etc/hosts', get_notifier())
예제 #3
0
    def test_parse_config_file(self):
        """ Test parsing the configuration, when it exists. """

        mock_file = self.mox.CreateMockAnything()
        mock_file.name = "xmppmoterc"

        self.mox.StubOutWithMock(__builtin__, "open")
        self.mox.StubOutWithMock(ConfigurationParser, "parse")
        self.mox.StubOutWithMock(xmppmoted.XMPPMoteDaemon,
                                 "_XMPPMoteDaemon__get_pidfile")
        self.mox.StubOutWithMock(Daemon, "__init__")

        config = ConfigurationParser()
        open("xmppmoterc", "a+").AndReturn(mock_file)
        config.parse(mock_file)
        xmppmoted.XMPPMoteDaemon._XMPPMoteDaemon__get_pidfile().AndReturn(None)
        Daemon.__init__(mox.IgnoreArg(), None)

        self.mox.ReplayAll()
    
        daemon = xmppmoted.XMPPMoteDaemon()
예제 #4
0
 def __init__(self, pidfile, stdout='/dev/null', stderr='/dev/null', stdin='/dev/null', cwd='/'):
     Daemon.__init__(self, pidfile, stdout, stderr, stdin)
     self.cwd=cwd
예제 #5
0
    def __init__(self):
        self.__usr = self.__pwd =  None

        self.__parse_config_file()

        Daemon.__init__(self, self.__get_pidfile())
예제 #6
0
 def __init__(self, cfg):
     self._cfg = cfg
     Daemon.__init__(self, self._cfg['pid_path'])
     self._logger = get_logger('snoopy-collector')