From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [[PATCH flasher] 2/6] Separate out validation of config name
Date: Thu, 13 Jun 2013 20:36:23 +0200 [thread overview]
Message-ID: <20130613183622.GD32574@mithrandir> (raw)
In-Reply-To: <1371079807-16541-2-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]
On Wed, Jun 12, 2013 at 05:30:03PM -0600, Stephen Warren wrote:
[...]
> diff --git a/tegra-uboot-flasher b/tegra-uboot-flasher
> index 447ff37..ef73e2f 100755
> --- a/tegra-uboot-flasher
> +++ b/tegra-uboot-flasher
> @@ -75,6 +75,17 @@ gen_flashcmds = {
> 'spi': gen_flashcmd_spi,
> }
>
> +def find_config_dir():
> + if not configs.has_key(args.configname):
> + print 'Unknown config "%s"' % args.configname
> + sys.exit(1)
> +
> + global boardname, socname, out_board_dir
Python supports returning touples, so maybe globals can be avoided here?
> +
> + boardname = configs[args.configname]['board']
> + socname = boards[boardname]['soc']
> + out_board_dir = os.path.join(args.data_dir, boardname)
> +
> 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')
> @@ -122,14 +133,7 @@ if args.list_confignames:
> print configname
> sys.exit(0)
>
> -if not configs.has_key(args.configname):
> - print 'Unknown config "%s"' % args.configname
> - sys.exit(1)
> -
> -boardname = configs[args.configname]['board']
> -socname = boards[boardname]['soc']
> -
> -out_board_dir = os.path.join(args.data_dir, boardname)
> +find_config_dir()
So this'll turn into something like:
boardname, socname, out_board_dir = find_config_dir()
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-06-13 18:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-12 23:30 [[PATCH flasher] 1/6] Move functions and data to start of file Stephen Warren
[not found] ` <1371079807-16541-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-06-12 23:30 ` [[PATCH flasher] 2/6] Separate out validation of config name Stephen Warren
[not found] ` <1371079807-16541-2-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-06-13 18:36 ` Thierry Reding [this message]
2013-06-12 23:30 ` [[PATCH flasher] 3/6] Split list-confignames implementation into a separate function Stephen Warren
2013-06-12 23:30 ` [[PATCH flasher] 4/6] Add parameters to gen_flashcmd_* Stephen Warren
2013-06-12 23:30 ` [[PATCH flasher] 5/6] Split flashing implementation into a separate function Stephen Warren
2013-06-12 23:30 ` [[PATCH flasher] 6/6] Rework cmdline to use sub-commands Stephen Warren
2013-06-13 22:15 ` [[PATCH flasher] 1/6] Move functions and data to start of file Stephen Warren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130613183622.GD32574@mithrandir \
--to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox