public inbox for location@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <michael.tremer@ipfire.org>
To: location@lists.ipfire.org
Subject: Re: Error in ' list-networks-by-cc'
Date: Thu, 01 Apr 2021 13:33:43 +0100	[thread overview]
Message-ID: <D5887EF5-47D4-4686-AD63-E35108A99158@ipfire.org> (raw)
In-Reply-To: <4b20a845-4674-71d1-84f6-b0da2e4c87c1@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 872 bytes --]

Hello,

> On 1 Apr 2021, at 12:36, Gisle Vanem <gisle.vanem(a)gmail.com> wrote:
> 
> When issuing:
> location.py list-networks-by-cc XX
> 
> I get this error:
>  for n in db.search_networks(country_code=country_code, family=ns.family):
>  TypeError: 'country_code' is an invalid keyword argument for this function
> 
> But this works better:
> @@ -506,7 +506,7 @@
>     f = writer(sys.stdout, prefix=country_code)
> 
>     # Print all matching networks
> -    for n in db.search_networks(country_code=country_code, family=ns.family):
> +    for n in db.search_networks(country_codes=[country_code.upper()], family=ns.family):
>       f.write(n)
> 
> ---
> 
> with the added bonus that I can do 'no' or 'NO'.

“no” is not a valid country code. “NO” is.

https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

-Michael

> 
> -- 
> --gv


      reply	other threads:[~2021-04-01 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 11:36 Gisle Vanem
2021-04-01 12:33 ` Michael Tremer [this message]

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=D5887EF5-47D4-4686-AD63-E35108A99158@ipfire.org \
    --to=michael.tremer@ipfire.org \
    --cc=location@lists.ipfire.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