diff options
author | Julien Jehannet <julien.jehannet@logilab.fr> | 2010-06-04 19:08:44 +0200 |
---|---|---|
committer | Julien Jehannet <julien.jehannet@logilab.fr> | 2010-06-04 19:08:44 +0200 |
commit | 334418282f420740660cfec646ffa57035d67af7 (patch) | |
tree | f3a42f885da77d8b681557e0eda96940e5bc054b | |
parent | 6f86a782546f095bb513a40630e653f37680030d (diff) | |
download | logilab-common-334418282f420740660cfec646ffa57035d67af7.tar.gz |
add COPYRIGHT section in man page only if copyright was filled
-rw-r--r-- | __pkginfo__.py | 2 | ||||
-rw-r--r-- | optik_ext.py | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/__pkginfo__.py b/__pkginfo__.py index 8f20807..00248a2 100644 --- a/__pkginfo__.py +++ b/__pkginfo__.py @@ -27,7 +27,7 @@ version = '.'.join([str(num) for num in numversion]) license = 'LGPL' # 2.1 or later author = "Logilab" -author_email = "devel@logilab.fr" +author_email = "contact@logilab.fr" description = "collection of low-level Python packages and modules used by Logilab projects" web = "http://www.logilab.org/project/%s" % distname diff --git a/optik_ext.py b/optik_ext.py index ba2c3a5..44d0504 100644 --- a/optik_ext.py +++ b/optik_ext.py @@ -353,21 +353,25 @@ class ManHelpFormatter(HelpFormatter): ''' % (pgm, long_desc.strip()) def format_tail(self, pkginfo): - return '''.SH SEE ALSO + tail = '''.SH SEE ALSO /usr/share/doc/pythonX.Y-%s/ -.SH COPYRIGHT -%s - .SH BUGS Please report bugs on the project\'s mailing list: %s .SH AUTHOR %s <%s> -''' % (getattr(pkginfo, 'debian_name', pkginfo.modname), pkginfo.copyright, +''' % (getattr(pkginfo, 'debian_name', pkginfo.modname), pkginfo.mailinglist, pkginfo.author, pkginfo.author_email) + if hasattr(pkginfo, "copyright"): + tail += ''' +.SH COPYRIGHT +%s +''' % pkginfo.copyright + + return tail def generate_manpage(optparser, pkginfo, section=1, stream=sys.stdout, level=0): """generate a man page from an optik parser""" |