142 |
except IOError: |
except IOError: |
143 |
return paramiko.SFTP_NO_SUCH_FILE |
return paramiko.SFTP_NO_SUCH_FILE |
144 |
|
|
145 |
|
def rmdir(self, path): |
146 |
|
try: |
147 |
|
self.client.rmdir(path) |
148 |
|
return paramiko.SFTP_OK |
149 |
|
except IOError: |
150 |
|
return paramiko.SFTP_NO_SUCH_FILE |
151 |
|
|
152 |
|
def mkdir(self, path, *args, **kwargs): |
153 |
|
try: |
154 |
|
print ("mkdir...") |
155 |
|
print args, kwargs |
156 |
|
args = [args[0].st_mode] |
157 |
|
self.client.mkdir(path, *args, **kwargs) |
158 |
|
print ("mkdir OK\n") |
159 |
|
return paramiko.SFTP_OK |
160 |
|
except IOError: |
161 |
|
print 'IOERROR mkdir' |
162 |
|
return paramiko.SFTP_NO_SUCH_FILE |
163 |
|
|
164 |
|
|
165 |
class SFTPServer(paramiko.SFTPServer): |
class SFTPServer(paramiko.SFTPServer): |
166 |
def __init__(self, channel, name, server, sftp_si=SFTPServerInterface, |
def __init__(self, channel, name, server, sftp_si=SFTPServerInterface, |