diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2020-03-27 13:38:11 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2020-04-08 09:27:31 -0400 |
commit | 634701f930c091a5e23101af6c9ba79af9c34d1a (patch) | |
tree | c235c08e2feeac60882f1af52744782dd34d4be1 | |
parent | ba9af25038055aec0e24fab103a850d1b823e6b3 (diff) | |
download | sos-634701f930c091a5e23101af6c9ba79af9c34d1a.tar.gz |
[global] PEP8 fixes
Consolidated PEP8 fixes following reorganization and redeisgn work.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/__init__.py | 8 | ||||
-rw-r--r-- | sos/component.py | 5 | ||||
-rw-r--r-- | sos/options.py | 3 | ||||
-rw-r--r-- | sos/report/__init__.py | 8 |
4 files changed, 13 insertions, 11 deletions
diff --git a/sos/__init__.py b/sos/__init__.py index cfd0fac5..895324f6 100644 --- a/sos/__init__.py +++ b/sos/__init__.py @@ -29,9 +29,11 @@ gettext_dir = "/usr/share/locale" gettext_app = "sos" gettext.bindtextdomain(gettext_app, gettext_dir) + def _default(msg): return gettext.dgettext(gettext_app, msg) + _sos = _default @@ -95,8 +97,8 @@ class SoS(): dest="config_file", default="/etc/sos.conf", help="specify alternate configuration file") parser.add_argument("--debug", action="store_true", dest="debug", - help="enable interactive debugging using the " - "python debugger") + help="enable interactive debugging using the " + "python debugger") parser.add_argument("-q", "--quiet", action="store_true", dest="quiet", default=False, help="only print fatal errors") @@ -119,7 +121,7 @@ class SoS(): initialize that component. """ _com = self.args.component - if not _com in self._components.keys(): + if _com not in self._components.keys(): print("Unknown subcommand '%s' specified" % _com) try: self._component = self._components[_com][0](self.parser, self.args, diff --git a/sos/component.py b/sos/component.py index b187330b..7c3c01b8 100644 --- a/sos/component.py +++ b/sos/component.py @@ -84,7 +84,6 @@ class SoSComponent(): self.sys_tmp = tmpdir - self.tmpdir = tempfile.mkdtemp(prefix="sos.", dir=self.sys_tmp) self.tempfile_util = TempFileUtil(self.tmpdir) self._setup_logging() @@ -113,8 +112,8 @@ class SoSComponent(): pass def load_options(self): - """Compile arguments loaded from defaults, config files, and the command - line into a usable set of options + """Compile arguments loaded from defaults, config files, and the + command line into a usable set of options """ # load the defaults defined by the component and the shared options opts = SoSOptions(arg_defaults=self._arg_defaults) diff --git a/sos/options.py b/sos/options.py index 89fa5587..4cadb9a0 100644 --- a/sos/options.py +++ b/sos/options.py @@ -9,6 +9,7 @@ from argparse import ArgumentParser, Action from configparser import ConfigParser, ParsingError, Error + def _is_seq(val): """Return true if val is an instance of a known sequence type. """ @@ -96,7 +97,7 @@ class SoSOptions(): :returns: the new ``SoSOptions`` object. """ self.arg_defaults = arg_defaults - self.arg_names = list(arg_defaults.keys()) + self.arg_names = list(arg_defaults.keys()) self._nondefault = set() # first load the defaults, if supplied for arg in self.arg_defaults: diff --git a/sos/report/__init__.py b/sos/report/__init__.py index 4b19eb24..5285d96f 100644 --- a/sos/report/__init__.py +++ b/sos/report/__init__.py @@ -29,9 +29,9 @@ from sos import __version__ from sos.component import SoSComponent import sos.policies from sos.archive import TarFileArchive -from sos.report.reporting import (Report, Section, Command, CopiedFile, CreatedFile, - Alert, Note, PlainTextReport, JSONReport, - HTMLReport) +from sos.report.reporting import (Report, Section, Command, CopiedFile, + CreatedFile, Alert, Note, PlainTextReport, + JSONReport, HTMLReport) # PYCOMPAT import six @@ -66,6 +66,7 @@ def _format_since(date): date parsing (like '2 days ago') in the future """ return datetime.strptime('{:<014s}'.format(date), '%Y%m%d%H%M%S') + # valid modes for --chroot chroot_modes = ["auto", "always", "never"] @@ -75,7 +76,6 @@ class SoSReport(SoSComponent): future analysis """ - desc = "Collect files and command output in an archive" arg_defaults = { |