diff options
author | Brian Dolbec <dolsen@gentoo.org> | 2014-09-16 22:54:13 -0700 |
---|---|---|
committer | Brian Dolbec <dolsen@gentoo.org> | 2014-09-16 23:02:21 -0700 |
commit | 1feee4c3627bcf33565bde1f1dc906c1326a76ba (patch) | |
tree | 958d9622437f9f7b55e0cf2784040212c8f51df5 | |
parent | Update NEWS and RELEASE-NOTES (diff) | |
download | portage-1feee4c3627bcf33565bde1f1dc906c1326a76ba.tar.gz portage-1feee4c3627bcf33565bde1f1dc906c1326a76ba.tar.bz2 portage-1feee4c3627bcf33565bde1f1dc906c1326a76ba.zip |
emaint: Assign all module __init__.py's __doc__ to a variable intsead
Due to distutils-r1 eclass optimization level, __doc__ strings are removed, breaking the
plugin system's use of __doc__ for it's module description(s).
This causes tracebacks when trying to run emaint.
brian@big_daddy $ emaint -h
Traceback (most recent call last):
File "/usr/lib/python-exec/python2.7/emaint", line 36, in <module>
emaint_main(sys.argv[1:])
File "/usr/lib64/python2.7/site-packages/portage/emaint/main.py", line 161, in emaint_main
parser = ArgumentParser(usage=usage(module_controller))
File "/usr/lib64/python2.7/site-packages/portage/emaint/main.py", line 78, in usage
desc = textwrap.wrap(module_controller.get_description(mod), 65)
File "/usr/lib64/python2.7/textwrap.py", line 354, in wrap
return w.wrap(text)
File "/usr/lib64/python2.7/textwrap.py", line 325, in wrap
text = self._munge_whitespace(text)
File "/usr/lib64/python2.7/textwrap.py", line 154, in _munge_whitespace
text = text.expandtabs()
AttributeError: 'NoneType' object has no attribute 'expandtabs'
brian@big_daddy $
Problem found by: Zac Medico <zmedica@gentoo.org>
-rw-r--r-- | pym/portage/emaint/modules/binhost/__init__.py | 8 | ||||
-rw-r--r-- | pym/portage/emaint/modules/config/__init__.py | 8 | ||||
-rw-r--r-- | pym/portage/emaint/modules/logs/__init__.py | 8 | ||||
-rw-r--r-- | pym/portage/emaint/modules/merges/__init__.py | 7 | ||||
-rw-r--r-- | pym/portage/emaint/modules/move/__init__.py | 8 | ||||
-rw-r--r-- | pym/portage/emaint/modules/resume/__init__.py | 6 | ||||
-rw-r--r-- | pym/portage/emaint/modules/world/__init__.py | 8 |
7 files changed, 27 insertions, 26 deletions
diff --git a/pym/portage/emaint/modules/binhost/__init__.py b/pym/portage/emaint/modules/binhost/__init__.py index c60e8bcb4..f2220e9d0 100644 --- a/pym/portage/emaint/modules/binhost/__init__.py +++ b/pym/portage/emaint/modules/binhost/__init__.py @@ -1,18 +1,18 @@ # Copyright 2005-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -"""Scan and generate metadata indexes for binary packages. -""" +doc = """Scan and generate metadata indexes for binary packages.""" +__doc__ = doc module_spec = { 'name': 'binhost', - 'description': __doc__, + 'description': doc, 'provides':{ 'module1': { 'name': "binhost", 'class': "BinhostHandler", - 'description': __doc__, + 'description': doc, 'functions': ['check', 'fix'], 'func_desc': {} } diff --git a/pym/portage/emaint/modules/config/__init__.py b/pym/portage/emaint/modules/config/__init__.py index f0585b39a..0277d3998 100644 --- a/pym/portage/emaint/modules/config/__init__.py +++ b/pym/portage/emaint/modules/config/__init__.py @@ -1,18 +1,18 @@ # Copyright 2005-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -"""Check and clean the config tracker list for uninstalled packages. -""" +doc = """Check and clean the config tracker list for uninstalled packages.""" +__doc__ = doc module_spec = { 'name': 'config', - 'description': __doc__, + 'description': doc, 'provides':{ 'module1': { 'name': "cleanconfmem", 'class': "CleanConfig", - 'description': __doc__, + 'description': doc, 'functions': ['check', 'fix'], 'func_desc': {} } diff --git a/pym/portage/emaint/modules/logs/__init__.py b/pym/portage/emaint/modules/logs/__init__.py index 0407efe2b..a7891fd5b 100644 --- a/pym/portage/emaint/modules/logs/__init__.py +++ b/pym/portage/emaint/modules/logs/__init__.py @@ -1,18 +1,18 @@ # Copyright 2005-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -"""Check and clean old logs in the PORT_LOGDIR. -""" +doc = """Check and clean old logs in the PORT_LOGDIR.""" +__doc__ = doc module_spec = { 'name': 'logs', - 'description': __doc__, + 'description': doc, 'provides':{ 'module1': { 'name': "logs", 'class': "CleanLogs", - 'description': __doc__, + 'description': doc, 'functions': ['check','clean'], 'func_desc': { 'clean': { diff --git a/pym/portage/emaint/modules/merges/__init__.py b/pym/portage/emaint/modules/merges/__init__.py index 96ee71b91..bcb2ac8ee 100644 --- a/pym/portage/emaint/modules/merges/__init__.py +++ b/pym/portage/emaint/modules/merges/__init__.py @@ -1,17 +1,18 @@ # Copyright 2005-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -"""Scan for failed merges and fix them.""" +doc = """Scan for failed merges and fix them.""" +__doc__ = doc module_spec = { 'name': 'merges', - 'description': __doc__, + 'description': doc, 'provides': { 'merges': { 'name': "merges", 'class': "MergesHandler", - 'description': __doc__, + 'description': doc, 'functions': ['check', 'fix', 'purge'], 'func_desc': { 'purge': { diff --git a/pym/portage/emaint/modules/move/__init__.py b/pym/portage/emaint/modules/move/__init__.py index d31d7b346..51624306c 100644 --- a/pym/portage/emaint/modules/move/__init__.py +++ b/pym/portage/emaint/modules/move/__init__.py @@ -1,18 +1,18 @@ # Copyright 2005-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -"""Perform package move updates for installed and binary packages. -""" +doc = """Perform package move updates for installed and binary packages.""" +__doc__ = doc module_spec = { 'name': 'move', - 'description': __doc__, + 'description': doc, 'provides':{ 'module1': { 'name': "moveinst", 'class': "MoveInstalled", - 'description': __doc__, + 'description': doc, 'options': ['check', 'fix'], 'functions': ['check', 'fix'], 'func_desc': { diff --git a/pym/portage/emaint/modules/resume/__init__.py b/pym/portage/emaint/modules/resume/__init__.py index 965e8f945..ebe4a37df 100644 --- a/pym/portage/emaint/modules/resume/__init__.py +++ b/pym/portage/emaint/modules/resume/__init__.py @@ -1,13 +1,13 @@ # Copyright 2005-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -"""Check and fix problems in the resume and/or resume_backup files. -""" +doc = """Check and fix problems in the resume and/or resume_backup files.""" +__doc__ = doc module_spec = { 'name': 'resume', - 'description': __doc__, + 'description': doc, 'provides':{ 'module1': { 'name': "cleanresume", diff --git a/pym/portage/emaint/modules/world/__init__.py b/pym/portage/emaint/modules/world/__init__.py index 3f62270ee..0af73d4e8 100644 --- a/pym/portage/emaint/modules/world/__init__.py +++ b/pym/portage/emaint/modules/world/__init__.py @@ -1,18 +1,18 @@ # Copyright 2005-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -"""Check and fix problems in the world file. -""" +doc = """Check and fix problems in the world file.""" +__doc__ = doc module_spec = { 'name': 'world', - 'description': __doc__, + 'description': doc, 'provides':{ 'module1':{ 'name': "world", 'class': "WorldHandler", - 'description': __doc__, + 'description': doc, 'functions': ['check', 'fix'], 'func_desc': {} } |