From patchwork Wed Jun 12 23:30:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 250928 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3204F2C007A for ; Thu, 13 Jun 2013 09:30:22 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758164Ab3FLXaT (ORCPT ); Wed, 12 Jun 2013 19:30:19 -0400 Received: from avon.wwwdotorg.org ([70.85.31.133]:36699 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756927Ab3FLXaQ (ORCPT ); Wed, 12 Jun 2013 19:30:16 -0400 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 46882635A; Wed, 12 Jun 2013 17:38:46 -0600 (MDT) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 88CEFE47A3; Wed, 12 Jun 2013 17:30:15 -0600 (MDT) From: Stephen Warren To: swarren@wwwdotorg.org Cc: linux-tegra@vger.kernel.org, Stephen Warren Subject: [[PATCH flasher] 3/6] Split list-confignames implementation into a separate function Date: Wed, 12 Jun 2013 17:30:04 -0600 Message-Id: <1371079807-16541-3-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1371079807-16541-1-git-send-email-swarren@wwwdotorg.org> References: <1371079807-16541-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.7 at avon.wwwdotorg.org X-Virus-Status: Clean Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Stephen Warren This moves towards each sub-command being a separate function Signed-off-by: Stephen Warren --- tegra-uboot-flasher | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tegra-uboot-flasher b/tegra-uboot-flasher index ef73e2f..390ae0e 100755 --- a/tegra-uboot-flasher +++ b/tegra-uboot-flasher @@ -86,6 +86,10 @@ def find_config_dir(): socname = boards[boardname]['soc'] out_board_dir = os.path.join(args.data_dir, boardname) +def func_list_configs(): + for configname in sorted(configs.keys()): + print configname + parser = argparse.ArgumentParser(description='Write an image to a Tegra board\'s flash') parser.add_argument('--debug', action='store_true', help='Turn on debugging prints') @@ -129,8 +133,7 @@ if not args.data_dir: load_configs(os.path.join(args.data_dir, 'configs')) if args.list_confignames: - for configname in sorted(configs.keys()): - print configname + func_list_configs() sys.exit(0) find_config_dir()