diff options
author | Tim Harder <radhermit@gmail.com> | 2015-02-08 13:08:46 -0800 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2015-02-08 13:17:33 -0800 |
commit | 875ae22014ebbadff49fa85dcc9b7e469d19fbc7 (patch) | |
tree | 01f70c672dbd744595a06b8a46bae746b13a58d7 | |
parent | add initial repos.conf support (diff) | |
download | pkgcore-875ae22014ebbadff49fa85dcc9b7e469d19fbc7.tar.gz pkgcore-875ae22014ebbadff49fa85dcc9b7e469d19fbc7.tar.bz2 pkgcore-875ae22014ebbadff49fa85dcc9b7e469d19fbc7.zip |
lint: various whitespace, indentation, and naming consistency fixes
-rw-r--r-- | pkgcore/config/errors.py | 7 | ||||
-rw-r--r-- | pkgcore/ebuild/portage_conf.py | 26 | ||||
-rw-r--r-- | pkgcore/ebuild/repo_objs.py | 3 |
3 files changed, 18 insertions, 18 deletions
diff --git a/pkgcore/config/errors.py b/pkgcore/config/errors.py index ba38faa57..a5c83b7ac 100644 --- a/pkgcore/config/errors.py +++ b/pkgcore/config/errors.py @@ -24,6 +24,7 @@ def _identify_functor_source(functor): return functor.__name__ return '%s.%s' % (module, functor.__name__) + class BaseError(Exception): pass @@ -87,12 +88,12 @@ class ParsingError(ConfigurationError): self.exc = exception def __str__(self): - return "Parsing Failed: %s\n%s" % (self.message, self.exc) + return "Parsing failed: %s\n%s" % (self.message, self.exc) @classmethod def wrap_exception(cls, message): - return currying.wrap_exception(cls, message=message, - pass_error='exception') + return currying.wrap_exception( + cls, message=message, pass_error='exception') class CollapseInheritOnly(ConfigurationError): diff --git a/pkgcore/ebuild/portage_conf.py b/pkgcore/ebuild/portage_conf.py index 89720cd31..30f6390de 100644 --- a/pkgcore/ebuild/portage_conf.py +++ b/pkgcore/ebuild/portage_conf.py @@ -40,9 +40,7 @@ def my_convert_hybrid(manager, val, arg_type): """Modified convert_hybrid using a sequence of strings for section_refs.""" if arg_type.startswith('refs:'): subtype = 'ref:' + arg_type.split(':', 1)[1] - return list( - basics.LazyNamedSectionRef(manager, subtype, name) - for name in val) + return [basics.LazyNamedSectionRef(manager, subtype, name) for name in val] return basics.convert_hybrid(manager, val, arg_type) @@ -68,8 +66,8 @@ def add_layman_syncers(new_config, rsync_opts, overlay_paths, config_root='/', with open(pjoin(config_root, default_loc)) as f: c = configparser.ConfigParser() c.read_file(f) - except IOError as ie: - if ie.errno != errno.ENOENT: + except IOError as e: + if e.errno != errno.ENOENT: raise return {} @@ -79,8 +77,8 @@ def add_layman_syncers(new_config, rsync_opts, overlay_paths, config_root='/', try: xmlconf = etree.parse(overlay_xml) - except IOError as ie: - if ie.errno != errno.ENOENT: + except IOError as e: + if e.errno != errno.ENOENT: raise return {} overlays = xmlconf.getroot() @@ -305,11 +303,11 @@ def load_make_config(vars_dict, path, allow_sourcing=False, required=True, try: new_vars = read_bash_dict( path, vars_dict=vars_dict, sourcing_command=sourcing_command) - except EnvironmentError as ie: - if ie.errno == errno.EACCES: + except EnvironmentError as e: + if e.errno == errno.EACCES: raise_from(errors.PermissionDeniedError(path, write=False)) - if ie.errno != errno.ENOENT or required: - raise_from(errors.ParsingError("parsing %r" % (path,), exception=ie)) + if e.errno != errno.ENOENT or required: + raise_from(errors.ParsingError("parsing %r" % (path,), exception=e)) return if incrementals: @@ -392,7 +390,7 @@ def config_from_make_conf(location="/etc/", profile_override=None): load_make_config(conf_dict, pjoin(base_path, 'make.globals')) except errors.ParsingError as e: if not getattr(getattr(e, 'exc', None), 'errno', None) == errno.ENOENT: - raise + raise try: load_make_config( conf_dict, @@ -410,8 +408,8 @@ def config_from_make_conf(location="/etc/", profile_override=None): allow_sourcing=True, incrementals=True) root = os.environ.get("ROOT", conf_dict.get("ROOT", "/")) - gentoo_mirrors = list( - x.rstrip("/")+"/distfiles" for x in conf_dict.pop("GENTOO_MIRRORS", "").split()) + gentoo_mirrors = [ + x.rstrip("/") + "/distfiles" for x in conf_dict.pop("GENTOO_MIRRORS", "").split()] # this is flawed... it'll pick up -some-feature features = conf_dict.get("FEATURES", "").split() diff --git a/pkgcore/ebuild/repo_objs.py b/pkgcore/ebuild/repo_objs.py index c802c4fb3..50ed1bc22 100644 --- a/pkgcore/ebuild/repo_objs.py +++ b/pkgcore/ebuild/repo_objs.py @@ -406,7 +406,8 @@ class RepoConfig(syncable.tree): v = set(['pms']) unknown = v.difference(['pms', 'portage-1', 'portage-2']) if unknown: - logger.warning("repository at %r has an unsupported profile format: %s" % + logger.warning( + "repository at %r has an unsupported profile format: %s" % (self.location, ', '.join(repr(x) for x in sorted(v)))) v = 'pms' sf(self, 'profile_format', list(v)[0]) |