Esempio n. 1
0
    def spawn(self, binary=None, args=[]):
        """
        Calls the baseclass spawn but returns a deferred that's fired when the daemon
        announces it is ready.
        Then it can be used in a chain.
        """

        EnvOSProcess.spawn(self, binary, args)

        return self.ready_deferred
Esempio n. 2
0
    def spawn(self, binary=None, args=[]):
        """
        Calls the baseclass spawn but returns a deferred that's fired when the daemon
        announces it is ready.
        Then it can be used in a chain.
        """

        EnvOSProcess.spawn(self, binary, args)

        return self.ready_deferred
Esempio n. 3
0
    def spawn(self, binary=None, args=[]):
        """
        Spawns the sqllineClient process.
        This override is to dump our sqlcommands into a file and tell sqllineClient to
        run that file. We modify the args keyword arg and send it up to the baseclass
        spawn implementation.
        """
        newargs = args[:]  # XXX must copy becuase otherwise, args keep appending to some
        # shared args var?!?! makes no sense
        if len(args) == 0:
            newargs.extend(self.spawnargs)

        if self.sqlcommands != None:

            # dump sqlcommands into a temporary file
            f = tempfile.NamedTemporaryFile(
                delete=False)  # TODO: requires python 2.6
            f.write(self.sqlcommands)
            f.close()

            self.temp_file = f.name

            newargs.insert(0, "--run=%s" % self.temp_file)

        return EnvOSProcess.spawn(self, binary, newargs)
Esempio n. 4
0
    def spawn(self, binary=None, args=[]):
        """
        Spawns the sqllineClient process.
        This override is to dump our sqlcommands into a file and tell sqllineClient to
        run that file. We modify the args keyword arg and send it up to the baseclass
        spawn implementation.
        """
        newargs = args[:] # XXX must copy becuase otherwise, args keep appending to some 
                          # shared args var?!?! makes no sense
        if len(args) == 0:
            newargs.extend(self.spawnargs)

        if self.sqlcommands != None:

            # dump sqlcommands into a temporary file
            f = tempfile.NamedTemporaryFile(delete=False)   # TODO: requires python 2.6
            f.write(self.sqlcommands)
            f.close()

            self.temp_file = f.name

            newargs.insert(0, "--run=%s" % self.temp_file)

        return EnvOSProcess.spawn(self, binary, newargs)