def annex_ssh_indirect(self, username, host, path): password = [] connection = Ssh(host, username, password) command = "cd " + path + " && git annex indirect" cmdAnswer, cmdErr = connection.git_Command2(command) print(cmdErr) print(cmdAnswer)
def annex_ssh_add(self, username, host, path): print('git annex add ' + path) password = [] connection = Ssh(host, username, password) command = "cd " + path + " && git annex add ." cmdAnswer, cmdErr = connection.git_Command2(command) print(cmdAnswer)
def annex_ssh_drop(self, username, host, path_local, path='.'): password = [] connection = Ssh(host, username, password) command = "cd " + path_local + " && git annex drop " + path cmdAnswer, cmdErr = connection.git_Command2(command) print(cmdErr) print(cmdAnswer) print('getting finished') return 0
def annex_ssh_get(self, username, host, path_local, source, path='.'): print('git annex get -f ' + source.name + ' ' + path) password = [] connection = Ssh(host, username, password) command = "cd " + path_local + " && git annex get -f " + source.name + " " + path cmdAnswer, cmdErr = connection.git_Command2(command) print(cmdErr) print(cmdAnswer) print('getting finished')
def annex_ssh_sync(self, username, host, path, remote): print("annex synccccccccccc") password = [] connection = Ssh(host, username, password) command = "cd " + path + " && git annex sync " + remote.name cmdAnswer, cmdErr = connection.git_Command2(command) print(cmdErr) print(cmdAnswer) return 0
def annex_ssh_sync(new_repo, remote): print('git annex sync ' + remote.name) username, host, path = split_data(new_repo.path) password = [] connection = Ssh(host, username, password) command = "cd " + path + " && git annex sync " + remote.name cmdAnswer, cmdErr = connection.git_Command2(command) if (cmdAnswer[:-1] == '') & (cmdErr == ''): print('Repo synced') else: print('Failed repo synced') return 0
def remote_ssh_add(new_repo, local_repo): name = local_repo.name if name not in new_repo.remote_names: local_user = getpass.getuser() username, host, path = split_data(new_repo.path) password = [] hostname = socket.gethostname() ip = socket.gethostbyname(hostname) connection = Ssh(host, username, password) command = "cd " + path + " && git remote add " + name + " ssh://" + local_user + "@" + ip + local_repo.path cmdAnswer, cmdErr = connection.git_Command2(command) if (cmdAnswer[:-1] == '') & (cmdErr == ''): print('Remote added') new_repo.remotes.append(local_repo) new_repo.remote_names.append(name) return 0 return 1