def remove(self): if not isdir(self.meta_dir): print "Error: Can't find meta data for:", self.cname return self.read_meta() n = 0 nof = len(self.files) # number of files self.progress_callback(0, self.installed_size) self.install_app(remove=True) self.run('pre_egguninst.py') for p in self.files: n += 1 self.progress_callback(n, nof) rm_rf(p) if p.endswith('.py'): rm_rf(p + 'c') self.rm_dirs() rm_rf(self.meta_dir) if self.hook: rm_empty_dir(self.pkg_dir) else: rm_empty_dir(self.egginfo_dir)
def rm_dirs(self): dir_paths = set() len_prefix = len(self.prefix) for path in set(dirname(p) for p in self.files): while len(path) > len_prefix: dir_paths.add(path) path = dirname(path) for path in sorted(dir_paths, key=len, reverse=True): rm_empty_dir(path)
def remove(self): rm_empty_dir(self.path)