Ejemplo n.º 1
0
 def rename_to(self, other):
     # If we're on the same file system as other, optimize this to a remote
     # side rename
     if isinstance(other, SSHFile) and self._filesystem is other._filesystem:
         self._client.rename(self._path, other._path)
     else:
         return BaseFile.rename_to(self, other)
Ejemplo n.º 2
0
 def rename_to(self, other):
     if isinstance(other, File):
         with Convert():
             os.rename(self._path, other.path)
     else:
         BaseFile.rename_to(self, other)
Ejemplo n.º 3
0
 def same_as(self, other):
     return (BaseFile.same_as(self, other) and
             self._url._replace(path="") == other._url._replace(path=""))