Setting ARRL section - fixed
Closed this issue · 3 comments
Cannot set section with current code
commands attempted:
.set sect wa-wwa
.set sect wwa-washington
.set sect wa-washington
.set sect wwa-wa
all come back with invalid value, looked through the code and cannot find where the value is checked, best I can find is line 1595, changed the regular expression (I hate regular expressions) from: r'[A-Z]{2,3}-[a-zA-Z ]{2,20}$'
to: r'[a-zA-Z]{2,3}-[a-zA-Z ]{2,20}$'
further note: might want to double check all regex's for cap or lower case only inputs, also cap inputs not allowed in the entry window (says lower caps please)
The section is now set with def initialize(): which is run once with the question asking if this the first time fdlog is being ran. I didn't want this to change by another user once I set it with initialize but if you think the section needs changed we can add it back in.
* So we can add it back in def proc_key(ch) or take it out of the documentation.
For several years we couldn't figure out why the original program would freeze the keyboard input. We had to reboot the system to get it to work. We discovered it was because the original program does not like caps. If the user had their caps lock on it would just freeze at input. So I put a check in to guard against caps instead of freezing.
* If you decide to work on this to accept lower or caps, we might want to pull in Alan's out of order entry enhancement as well.
I'm kinda seeing whats going on. The main issue that's happening is when you try to set the variable (ie global variable) that the program reads it still goes through the set command which has that regex that disregards capital letters, so you still need to change the regex to include both cases, you might also want to check the grid square for the vhf section because i just noticed that it will reject anything that isn't caps, I'll look deeper into the code as i go, but you might want to add to_upper in the grid square initialization section: line 325.
I'll see if i can figure out pull requests and submit at least comment on what needs to be changed (i'll add my call sign kc7sda to the comments to make it easy to find)
I'm thinking the whole "IN-Indiana" is overkill. Anyway we can change this so it's just simply our section like "IN"?
I'm not sure why it was this way and it seems like a hardship for those unfamiliar with how the program wants it entered.
-Scott