From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: location@lists.ipfire.org Subject: Re: Error in ' list-networks-by-cc' Date: Thu, 01 Apr 2021 13:33:43 +0100 Message-ID: In-Reply-To: <4b20a845-4674-71d1-84f6-b0da2e4c87c1@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8963356931860017908==" List-Id: --===============8963356931860017908== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, > On 1 Apr 2021, at 12:36, Gisle Vanem wrote: >=20 > When issuing: > location.py list-networks-by-cc XX >=20 > I get this error: > for n in db.search_networks(country_code=3Dcountry_code, family=3Dns.famil= y): > TypeError: 'country_code' is an invalid keyword argument for this function >=20 > But this works better: > @@ -506,7 +506,7 @@ > f =3D writer(sys.stdout, prefix=3Dcountry_code) >=20 > # Print all matching networks > - for n in db.search_networks(country_code=3Dcountry_code, family=3Dns.f= amily): > + for n in db.search_networks(country_codes=3D[country_code.upper()], fa= mily=3Dns.family): > f.write(n) >=20 > --- >=20 > with the added bonus that I can do 'no' or 'NO'. =E2=80=9Cno=E2=80=9D is not a valid country code. =E2=80=9CNO=E2=80=9D is. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 -Michael >=20 > --=20 > --gv --===============8963356931860017908==--