Example #1
0
    def _connect(self, command, data=None, env=None, cwd=None):
        command_str = envoy.expand_args(command).pop()

        proc = subprocess.Popen(command_str,
                                cwd=cwd,
                                env=self.environment,
                                stdin=None,
                                stdout=open("%s/bam.stdout.log" % cwd, "w"),
                                stderr=open("%s/bam.stderr.log" % cwd, "w"))

        return envoy.ConnectedCommand(process=proc)
Example #2
0
File: app.py Project: adammck/bam
  def _connect(self, command, data=None, env=None, cwd=None):
    command_str = envoy.expand_args(command).pop()

    proc = subprocess.Popen(
      command_str,
      cwd=cwd,
      env=self.environment,
      stdin=None,
      stdout=open("%s/bam.stdout.log" % cwd, "w"),
      stderr=open("%s/bam.stderr.log" % cwd, "w"))

    return envoy.ConnectedCommand(process=proc)
Example #3
0
 def _run(self, command):
     ''' '''
     ### Pre-processing `command`: #########################################
     #                                                                     #
     if isinstance(command, basestring):
         command = envoy.expand_args(command)
     elif isinstance(command[0], basestring):
         command = [command]
     assert len(command) == 1 and isinstance(command[0][0], basestring)
     #                                                                     #
     ### Finished pre-processing `command`. ################################
     result = envoy.run(
         [['git',
           '--work-tree=%s' % self.path,
           '--git-dir=%s' % self._controldir]
          + command[0]
          ]
     )
     self._last_run_result = result
     return result
Example #4
0
def nohuprun_cmd(cmd):
    cmd_list = envoy.expand_args(cmd)[0]
    subprocess.Popen(cmd_list, shell=False)