From 7e93444f28a6790ab66fbdd8cc7eed9ca8970d48 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 25 Apr 2021 20:12:25 +0200 Subject: Add kind of working delete command --- apply/resolv.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'apply/resolv.py') diff --git a/apply/resolv.py b/apply/resolv.py index 93d0566..0073273 100644 --- a/apply/resolv.py +++ b/apply/resolv.py @@ -15,24 +15,24 @@ class Resolver: self.override = override self.state = state - def check_parent(self, path: Path, packagename): + def check_parent(self, path: Path, modulename): """ Check if parents exists, and if we created them mark them - with package name + with module name """ parent = path.parent exists = parent.exists() if (not exists) or parent in self.state.dirs: - self.check_parent(parent, packagename) + self.check_parent(parent, modulename) # Add to state - self.state.add_dir(parent, packagename) + self.state.add_dir(parent, modulename) if not exists: self.writer.create_dir(parent) - def do_link(self, package, ppath: Path): + def do_link(self, module, ppath: Path): dest = Path(self.applydir, ppath) dest_state = FileState.check_location(dest) @@ -41,11 +41,11 @@ class Resolver: raise Exception(f"Destination {ppath} already exists") # Save the link in the statefile - self.state.add_link(dest, package) + self.state.add_link(dest, module) - self.check_parent(dest, package) + self.check_parent(dest, module) - target_abs = Path.cwd().joinpath(Path(package, ppath)) + target_abs = Path.cwd().joinpath(Path(module, ppath)) if dest_state == FileState.Owned and dest_state.link_intact()\ and dest_state.links_to() == target_abs: return @@ -54,6 +54,6 @@ class Resolver: self.writer.delete(dest) self.writer.create_link(target_abs, dest) - def do_folder_link(self, package, ppath: Path) -> bool: - self.do_link(package, ppath) + def do_folder_link(self, module, ppath: Path) -> bool: + self.do_link(module, ppath) return True -- cgit v1.2.3