예제 #1
0
파일: utils.py 프로젝트: imclab/BatchQ
 def __init__(self, server = None, username = "", password = "", port = 22, accept_figerprint = False):
     super(FileCommander,self).__init__(server, username, password, port, accept_figerprint)
     self._local_bash = BashTerminal()
     self._syncroisation_cache = {}
     if server:
         self._remote_bash = SSHTerminal(server, username, password, port, accept_figerprint) 
     else:
         self._remote_bash = BashTerminal()
예제 #2
0
class CreateFileBash(object):
    def __init__(self,directory, command):
        self.directory = directory
        self.command = command
        self.terminal = BashTerminal()        

    def create_dir(self):
        home = self.terminal.home()
        self.terminal.chdir(home)

        if not self.terminal.exists(self.directory):
            self.terminal.mkdir(self.directory,True)
        
        self.terminal.chdir(self.directory)
        return self

    def create_file(self):
        self.create_dir()
        self.terminal.send_command(self.command)
        return self
예제 #3
0
 def __init__(self,directory, command):
     self.directory = directory
     self.command = command
     self.terminal = BashTerminal()