commit: 4485a6e491b7df9fa54314bae87df4d29318867e Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Mon Jan 5 01:01:08 2015 +0000 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> CommitDate: Mon Jan 5 22:15:18 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=4485a6e4
py2man: Make authors configurable --- py2man/command.template | 5 +---- py2man/manpages.py | 15 +++++++++++++-- py2man/sub-command.template | 5 +---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/py2man/command.template b/py2man/command.template index 71ee35e..5879a05 100644 --- a/py2man/command.template +++ b/py2man/command.template @@ -22,10 +22,7 @@ Please assign bug to <gk...@gentoo.org> email alias. Gentoo Keys project is under GPL-2 License. .SH AUTHORS -.br -Brian Dolbec <dol...@gentoo.org> -.br -Pavlos Ratis <daster...@gentoo.org> +%(authors) .SH "SEE ALSO" .BR gkeys.conf (1), diff --git a/py2man/manpages.py b/py2man/manpages.py index 2490fcc..0fd82ed 100644 --- a/py2man/manpages.py +++ b/py2man/manpages.py @@ -22,11 +22,12 @@ SubCmdHdr = '.SH \\ %s' class ManPage(object): - def __init__(self, prog, version, template, path): + def __init__(self, prog, version, template, docpath, authors): self.prog = prog self.version = version self.template = template - self.path = path + self.path = docpath + self.authors = authors @staticmethod @@ -62,6 +63,14 @@ class ManPage(object): @staticmethod + def gen_brlist(_list): + output = [] + for member in _list: + output.append(BreakStr % member) + return '\n'.join(output) + + + @staticmethod def gen_actions(actions): acts = [] for act in actions: @@ -113,6 +122,7 @@ class ManPage(object): data['prog'] = self.prog data['version'] = self.version data['date'] = datetime.strftime(datetime.today(),'%B %d, %Y') + data['authors'] = self.gen_brlist(self.authors) data['action'] = action data['actions'] = self.gen_actions(actions) data['options'] = self.gen_options(Action_Map[action]['options']) @@ -154,6 +164,7 @@ class ManPage(object): data['prog'] = self.prog data['version'] = self.version data['date'] = datetime.strftime(datetime.today(),'%B %d, %Y') + data['authors'] = self.gen_brlist(self.authors) data['actions'] = self.gen_actions(list(prog_map['sub-cmds'])) data['options'] = self.gen_options(prog_map['options']) data['desc'] = prog_map['desc'] diff --git a/py2man/sub-command.template b/py2man/sub-command.template index 41de926..89d1b1b 100644 --- a/py2man/sub-command.template +++ b/py2man/sub-command.template @@ -25,10 +25,7 @@ Please assign bug to <gk...@gentoo.org> email alias. Gentoo Keys project is under GPL-2 License. .SH AUTHORS -.br -Brian Dolbec <dol...@gentoo.org> -.br -Pavlos Ratis <daster...@gentoo.org> +%(authors) .SH "SEE ALSO" .BR gkeys (1),