def init(self, local, remote): self.prepare_for_init_or_clone(local, remote) working_copy = WorkingCopy(self, local, remote) working_copy.init() return working_copy
def clone(self, local, remote): """Creates the appropriate directories, ensures the target folder is empty, and initiates a clone operaiton.""" self.prepare_for_init_or_clone(local, remote) # except TypeError: # if local is not a string working_copy = WorkingCopy(self, local, remote) try: working_copy.clone() return working_copy except InvalidWorkingCopyError as e: try: working_copy.destroy() os.rmdir(local) except OSError: pass raise e
def working_copy(self, local): working_copy = WorkingCopy(self, local) return working_copy