MCPcopy Create free account
hub / github.com/CloudPolis/webdav-client-python / rename

Method rename

webdav/client.py:1051–1059  ·  view source on GitHub ↗
(self, new_name)

Source from the content-addressed store, hash-verified

1049 return self.client.is_dir(self.urn.path())
1050
1051 def rename(self, new_name):
1052
1053 old_path = self.urn.path()
1054 parent_path = self.urn.parent()
1055 new_name = Urn(new_name).filename()
1056 new_path = "{directory}{filename}".format(directory=parent_path, filename=new_name)
1057
1058 self.client.move(remote_path_from=old_path, remote_path_to=new_path)
1059 self.urn = Urn(new_path)
1060
1061 def move(self, remote_path):
1062

Callers

nothing calls this directly

Calls 5

UrnClass · 0.90
pathMethod · 0.80
parentMethod · 0.80
filenameMethod · 0.80
moveMethod · 0.45

Tested by

no test coverage detected