[chirp_devel] [PATCH 0 of 2] Add Canadian provinces to RepeaterBook import
These two patches are actually independent... they should apply in either order.
Tom KD7LXL
# HG changeset patch # User Tom Hayward tom@tomh.us # Date 1338317476 21600 # Node ID af31b1f3a1a6270a89ce6db40583d2605463e230 # Parent 51a0d9490ced8d3b24ec13a0ed572233185c3560 fips: Pennsylvania FIPS code was wrong. #117
diff -r 51a0d9490ced -r af31b1f3a1a6 chirpui/fips.py --- a/chirpui/fips.py Tue May 22 16:41:27 2012 -0700 +++ b/chirpui/fips.py Tue May 29 12:51:16 2012 -0600 @@ -54,7 +54,7 @@ "Ohio" : 39, "Oklahoma" : 40, "Oregon" : 41, - "Pennsylvania" : 32, + "Pennsylvania" : 42, "Puerto Rico" : 72, "Rhode Island" : 44, "South Carolina" : 45,
# HG changeset patch # User Tom Hayward tom@tomh.us # Date 1338317480 21600 # Node ID f0cf46aff98537eb5b1ef66833b8d0130849fc0b # Parent af31b1f3a1a6270a89ce6db40583d2605463e230 repeaterbook: Add Canadian provinces. #191
diff -r af31b1f3a1a6 -r f0cf46aff985 chirpui/fips.py --- a/chirpui/fips.py Tue May 29 12:51:16 2012 -0600 +++ b/chirpui/fips.py Tue May 29 12:51:20 2012 -0600 @@ -69,6 +69,19 @@ "Wisconsin" : 55, "West Virginia" : 54, "Wyoming" : 56, + "Alberta" : "CA01", + "British Columbia" : "CA02", + "Manitoba" : "CA03", + "New Brunswick" : "CA04", + "Newfoundland and Labrador": "CA05", + "Northwest Territories": "CA13", + "Nova Scotia" : "CA07", + "Nunavut" : "CA14", + "Ontario" : "CA08", + "Prince Edward Island" : "CA09", + "Quebec" : "CA10", + "Saskatchewan" : "CA11", + "Yukon" : "CA12", }
FIPS_COUNTIES = { @@ -6558,7 +6571,20 @@ 'Vieques Municipio, PR': '147', 'Villalba Municipio, PR': '149', 'Yabucoa Municipio, PR': '151', - 'Yauco Municipio, PR': '153'} + 'Yauco Municipio, PR': '153'}, + "CA01": { '--All--': '%', }, + "CA02": { '--All--': '%', }, + "CA03": { '--All--': '%', }, + "CA04": { '--All--': '%', }, + "CA05": { '--All--': '%', }, + "CA13": { '--All--': '%', }, + "CA07": { '--All--': '%', }, + "CA14": { '--All--': '%', }, + "CA08": { '--All--': '%', }, + "CA09": { '--All--': '%', }, + "CA10": { '--All--': '%', }, + "CA11": { '--All--': '%', }, + "CA12": { '--All--': '%', }, }
diff -r af31b1f3a1a6 -r f0cf46aff985 chirpui/mainapp.py --- a/chirpui/mainapp.py Tue May 29 12:51:16 2012 -0600 +++ b/chirpui/mainapp.py Tue May 29 12:51:20 2012 -0600 @@ -702,7 +702,10 @@ default_county = "--All--" default_band = "--All--" try: - code = int(CONF.get("state", "repeaterbook")) + try: + code = int(CONF.get("state", "repeaterbook")) + except: + code = CONF.get("state", "repeaterbook") for k,v in fips.FIPS_STATES.items(): if code == v: default_state = k @@ -762,9 +765,12 @@ return
try: - code = int(CONF.get("state", "repeaterbook")) + code = "%02i" % int(CONF.get("state", "repeaterbook")) except: - code = 41 # Oregon default + try: + code = CONF.get("state", "repeaterbook") + except: + code = '41' # Oregon default
try: county = CONF.get("county", "repeaterbook") @@ -777,7 +783,7 @@ band = 14 # 2m default
query = "http://www.repeaterbook.com/repeaters/downloads/chirp.php?" + \ - "func=default&state_id=%02i&band=%s&freq=%%&band6=%%&loc=%%" + \ + "func=default&state_id=%s&band=%s&freq=%%&band6=%%&loc=%%" + \ "&county_id=%s&status_id=%%&features=%%&coverage=%%&use=%%" query = query % (code, band and band or "%%", county and county or "%%")
participants (2)
-
Dan Smith
-
Tom Hayward