[chirp_devel] [csv] Friendlier defaults for missingcToneFreq/rToneFreq columns in csv import - Fixes #1577

Tom Hayward
Fri Apr 25 08:58:38 PDT 2014


On Fri, Apr 25, 2014 at 7:56 AM,  <chirp.cordless at xoxy.net> wrote:
> Do you have any hints for making this visible?

My text editor shows whitespace when text is highlighted. I think it's
configurable to have it show whitespace all the time, but this is
annoying. I'm using Sublime Text.

Here's a tip for vim:
http://vim.wikia.com/wiki/Highlight_unwanted_spaces

If you are super cool like Dan Smith and use emacs, you can do it this way:
http://www.emacswiki.org/emacs/ShowWhiteSpace

>> _file_has_rTone = "rToneFreq" in headers
>> _file_has_cTone = "cToneFreq" in headers
>
> I didn't know the idiom, and certainly way more readable.
> I'd actually felt a little guilty about iterating the header line
> for every line in the file, but didn't see a way to factor that
> without creating globals, which I didn't think would be wanted.
> If doubling that again for readability is preferred, I have a
> better calibration of the tradeoffs expected.

How about this...

if not hasattr(self, "_file_has_rTone"):
    self._file_has_rTone = "rToneFreq" in headers
if not hasattr(self, "_file_has_cTone"):
    self._file_has_cTone = "cToneFreq" in headers

Not global, but only checks for rToneFreq once per file.

> You didn't ask for a patch respin, shall I, or is this OK and I should
> just take this as advice for future work?

Yes, please respin.

Tom KD7LXL



More information about the chirp_devel mailing list