def _format_key(self, key, values): """Determines the stats for key, formats it and calls the pre-determined print function """ if self.exact: _key = "=" + key else: parts = split_cpv(key) _key = '/'.join(parts[:2]) values.sort() self.data[_key] = values self.print_fn(_key, values)
def _format_key(self, key, values): """Determines the stats for key, formats it and calls the pre-determined print function """ if self.exact: _key = "=" + key else: parts = split_cpv(key) _key = "/".join(parts[:2]) values.sort() self.data[_key] = values self.print_fn(_key, values)
def _remove_uninstalled_packages(self): from gentoolkit.helpers import get_installed_cpvs for cpv in self._cpvs.keys(): from gentoolkit.cpv import split_cpv scpv = cpv.split('=')[-1].split('<')[-1].split('>')[-1] try: (category, pkg_name, version, revision) = split_cpv(scpv) scpv = category + "/" + pkg_name except: continue if self._debug: output.debug(__file__, "scpv: %s", scpv) pred = lambda x: x.startswith(scpv) if self._debug: output.debug(__file__, "len(set(get_installed_cpvs(pred))): %s", len(set(get_installed_cpvs(pred)))) if len(set(get_installed_cpvs(pred))) <= 0: self._cpvs.pop(cpv)
def _remove_uninstalled_packages(self): from gentoolkit.helpers import get_installed_cpvs for cpv in self._cpvs.keys(): from gentoolkit.cpv import split_cpv scpv = rcpv = cpv.split('=')[-1].split('<')[-1].split('>')[-1] try: (category, pkg_name, version, revision) = split_cpv(rcpv) scpv = category + "/" + pkg_name except: continue if self._debug: output.debug(__file__, "scpv: %s", scpv) pred = lambda x: x.startswith(scpv) if self._debug: output.debug(__file__, "list(get_installed_cpvs(pred)): %s", list(get_installed_cpvs(pred))) output.debug(__file__, "rcpv: %s", rcpv) output.debug(__file__, "''.join(list(get_installed_cpvs(pred))): %s", ''.join(list(get_installed_cpvs(pred)))) import re if not re.search(rcpv, ''.join(list(get_installed_cpvs(pred)))): if self._verbose: output.verbose("Could not find %s installed on the system!", rcpv) self._cpvs.pop(cpv)