Example #1
0
    def run(self, args, envName=None):
        if not envName:
            envSpec = self._getCurrentEnv()
            if not envSpec:
                return Fail(InvalidEnvError("No env is currently active."))
            envName = envSpec.name

        cmd = subprocess.list2cmdline(args)

        return OK(envName) \
            .bind(self._loadEnvSpec) \
            .map(lambda x: x.envPath) \
            .bind(lambda p: Shell.call(cmd, cwd=p, shell=True))
Example #2
0
 def applyCommand(self, cmd):
     logger.info("Running environment command: %s" % cmd)
     return Shell.call(cmd, cwd=self.envPath, shell=True)
Example #3
0
 def editEngineConfig(self, engine):
     cmd = os.environ.get('EDITOR', 'vi') + ' ' + \
         engine.config.getConfigFile()
     return Shell.call(cmd).map(lambda x: engine)