diff options
author | Adam Stokes <adam.stokes@ubuntu.com> | 2015-02-10 10:45:29 -0500 |
---|---|---|
committer | Adam Stokes <adam.stokes@ubuntu.com> | 2015-02-10 10:55:48 -0500 |
commit | 198f32e2fdd91cda93377fcf7fbece57bbc179e5 (patch) | |
tree | 31fd250d81c8055ee5522e7203bc0ede868203a6 | |
parent | 75901ef7906690aadaabc8925ac9a2e8523ed1a3 (diff) | |
download | sos-198f32e2fdd91cda93377fcf7fbece57bbc179e5.tar.gz |
[pep8] fix 2 new pep8 errors
Apparently, there are new pep8 rules out in the wild.
This patch fixes those errors along with additional
formatting to be more compliant with pep8.
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
-rw-r--r-- | sos/__init__.py | 3 | ||||
-rw-r--r-- | sos/sosreport.py | 20 |
2 files changed, 15 insertions, 8 deletions
diff --git a/sos/__init__.py b/sos/__init__.py index c868563f..066e1181 100644 --- a/sos/__init__.py +++ b/sos/__init__.py @@ -21,9 +21,10 @@ This module houses the i18n setup and message function. The default is to use gettext to internationalize messages. """ +import gettext + __version__ = "3.2.0a1" -import gettext gettext_dir = "/usr/share/locale" gettext_app = "sos" diff --git a/sos/sosreport.py b/sos/sosreport.py index e83e7180..2af9907e 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -44,11 +44,12 @@ from sos.reporting import (Report, Section, Command, CopiedFile, CreatedFile, # PYCOMPAT import six from six.moves import zip, input +from six import print_ + if six.PY3: from configparser import ConfigParser else: from ConfigParser import ConfigParser -from six import print_ # file system errors that should terminate a run fatal_fs_errors = (errno.ENOSPC, errno.EROFS) @@ -99,7 +100,9 @@ class TempFileUtil(object): class OptionParserExtended(OptionParser): + """ Show examples """ + def print_help(self, out=sys.stdout): """ Prints help content including examples """ OptionParser.print_help(self, out) @@ -116,6 +119,7 @@ class OptionParserExtended(OptionParser): class SosOption(Option): + """Allow to specify comma delimited list of plugins""" ACTIONS = Option.ACTIONS + ("extend",) STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",) @@ -135,6 +139,7 @@ class SosOption(Option): class XmlReport(object): + """ Report build class """ def __init__(self): @@ -607,6 +612,7 @@ class SoSOptions(object): class SoSReport(object): + """The main sosreport class""" def __init__(self, args): @@ -649,7 +655,7 @@ class SoSReport(object): def print_header(self): self.ui_log.info("\n%s\n" % _("sosreport (version %s)" % - (__version__,))) + (__version__,))) def get_commons(self): return { @@ -664,7 +670,7 @@ class SoSReport(object): 'cmdlineopts': self.opts, 'config': self.config, 'global_plugin_options': self.global_plugin_options, - } + } def get_temp_file(self): return self.tempfile_util.new() @@ -899,7 +905,7 @@ class SoSReport(object): self._load(plugin_class) except Exception as e: self.soslog.warning(_("plugin %s does not install, " - "skipping: %s") % (plug, e)) + "skipping: %s") % (plug, e)) if self.raise_plugins: raise @@ -996,7 +1002,7 @@ class SoSReport(object): if self.skipped_plugins: self.ui_log.info(_("The following plugins are currently " - "disabled:")) + "disabled:")) self.ui_log.info("") for (plugname, plugclass, reason) in self.skipped_plugins: self.ui_log.info(" %-20s %-14s %s" % ( @@ -1221,11 +1227,11 @@ class SoSReport(object): for f in plug.copied_files: section.add(CopiedFile(name=f['srcpath'], - href=".." + f['dstpath'])) + href=".." + f['dstpath'])) for cmd in plug.executed_commands: section.add(Command(name=cmd['exe'], return_code=0, - href="../" + cmd['file'])) + href="../" + cmd['file'])) for content, f in plug.copy_strings: section.add(CreatedFile(name=f)) |