From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0DB2C1381F3 for ; Tue, 17 Sep 2013 16:41:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 59211E0C56; Tue, 17 Sep 2013 16:41:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DB5E0E0C56 for ; Tue, 17 Sep 2013 16:40:59 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E9D3E33ECEE for ; Tue, 17 Sep 2013 16:40:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 8F677E5465 for ; Tue, 17 Sep 2013 16:40:56 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1379433554.653293a8f68cff4c4c4ec24dd416877e2eec1f6a.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/argparser.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 653293a8f68cff4c4c4ec24dd416877e2eec1f6a X-VCS-Branch: master Date: Tue, 17 Sep 2013 16:40:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0653bb2d-f854-490a-81df-0ab1e9c54ef8 X-Archives-Hash: d541ef9dfec8e6bdfbca49c1f5f58e91 commit: 653293a8f68cff4c4c4ec24dd416877e2eec1f6a Author: André Erdmann mailerd de> AuthorDate: Tue Sep 17 15:50:43 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Tue Sep 17 15:59:14 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=653293a8 argparser: setup subparsers --- roverlay/argparser.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/roverlay/argparser.py b/roverlay/argparser.py index 5a59dd5..81b3300 100644 --- a/roverlay/argparser.py +++ b/roverlay/argparser.py @@ -631,12 +631,18 @@ class RoverlayArgumentParser ( RoverlayArgumentParserBase ): # (required for proper help=...%(default)s, though) #self.parser.set_defaults ( command=self.default_command ) - subparsers = [ - self.add_subparser ( command ) - for command in self.COMMAND_DESCRIPTION - ] - return subparsers + subparsers = [] + + for command in self.COMMAND_DESCRIPTION: + subparser = self.add_subparser ( + command, proxy_cls=self.__class__.COMMAND_SUBPARSERS[command] + ) + if hasattr ( subparser, 'setup' ): + subparser.setup() + subparsers.append ( subparser ) + # -- end if + return subparsers else: raise AssertionError ( "multiple commands with subparsers is not supported." @@ -644,7 +650,6 @@ class RoverlayArgumentParser ( RoverlayArgumentParserBase ): # --- end of setup_actions (...) --- def parse_actions ( self ): - print ( self.parsed ) self.command = self.parsed ['command'] # --- end of parse_actions (...) ---