Esempio n. 1
0
 def remove(self, files):
     sftp = self.client.open_sftp()
     rfs = sgb.glob(sftp, files)
     for rf in rfs:
         if not sgb.lexists(sftp, rf):
             continue
         if sgb.isdir(sftp, rf):
             self.remove(pp.join(rf+'*'))
             sftp.rmdir(rf)
         else:
             sftp.remove(rf)
Esempio n. 2
0
 def remove(self, files):
     sftp = self.client.open_sftp()
     rfs = sgb.glob(sftp, files)
     for rf in rfs:
         if not sgb.lexists(sftp, rf):
             continue
         if sgb.isdir(sftp, rf):
             self.remove(pp.join(rf + '*'))
             sftp.rmdir(rf)
         else:
             sftp.remove(rf)
Esempio n. 3
0
 def get(self, rfiles, ldir):
     sftp = self.client.open_sftp()
     rfiles = self.convertPath(rfiles)
     rfs = sgb.glob(sftp, rfiles)
     if len(rfs) > 0:
         self.checkLocalPath(ldir)
         print 'get remote:{:}'.format(rfiles),\
               '-> local:{:}'.format(ldir)
     for rf in rfs:
         if not sgb.isdir(sftp, rf):
             lf = op.join(ldir, pp.basename(rf))
             sftp.get(rf, lf)
             os.chmod(lf, sftp.stat(rf).st_mode)
Esempio n. 4
0
 def get(self, rfiles, ldir):
     sftp = self.client.open_sftp()
     rfiles = self.convertPath(rfiles)
     rfs = sgb.glob(sftp, rfiles)
     if len(rfs) > 0:
         self.checkLocalPath(ldir)
         print 'get remote:{:}'.format(rfiles),\
               '-> local:{:}'.format(ldir)
     for rf in rfs:
         if not sgb.isdir(sftp, rf):
             lf = op.join(ldir, pp.basename(rf))
             sftp.get(rf, lf)
             os.chmod(lf, sftp.stat(rf).st_mode)