[chirp_devel] Fwd: [PATCH] Fixes CSV header, which was missing a column

Christopher Hoover
Sat Nov 18 16:04:09 PST 2017


# HG changeset patch
# User Christopher Hoover <ch at murgatroid.com>
# Date 1510450576 28800
#      Sat Nov 11 17:36:16 2017 -0800
# Node ID c229e2d488fecb516ede6cf12a700c5bbe24bfc2
# Parent  0e0470d3e892bfd4818bfb972b8b85d58f2b00d4
Fixes CSV header, which was missing a column.

Asserts header and rows agree in arity during writing to prevent
future regressions.

diff -r 0e0470d3e892 -r c229e2d488fe chirp/chirp_common.py
--- a/chirp/chirp_common.py     Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/chirp_common.py     Sat Nov 11 17:36:16 2017 -0800
@@ -321,7 +321,7 @@
                   "rToneFreq", "cToneFreq", "DtcsCode",
                   "DtcsPolarity", "Mode", "TStep",
                   "Skip", "Comment",
-                  "URCALL", "RPT1CALL", "RPT2CALL"]
+                  "URCALL", "RPT1CALL", "RPT2CALL", "DVCODE"]

     def __setattr__(self, name, val):
         if not hasattr(self, name):
diff -r 0e0470d3e892 -r c229e2d488fe csvdump/csvapp.py
--- a/csvdump/csvapp.py Fri Nov 03 20:24:29 2017 -0400
+++ b/csvdump/csvapp.py Sat Nov 11 17:36:16 2017 -0800
@@ -119,7 +119,9 @@

         print >>f, chirp.chirp_common.Memory.CSV_FORMAT
         for m in self.radio.get_memories():
-            print >>f, m.to_csv()
+            csv = m.to_csv()
+            assert len(csv) == len(chirp.chirp_common.Memory.CSV_FORMAT)
+            print >>f, csv
             count += 1
         f.close()

@@ -145,7 +147,9 @@

             try:
                 m = self.radio.get_memory(i)
-                print >>f, m.to_csv()
+                csv = m.to_csv()
+                assert len(csv) == len(chirp.chirp_common.Memory.
CSV_FORMAT)
+                print >>f, csv
             except chirp.errors.InvalidMemoryLocation:
                 pass
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20171118/2abc145c/attachment-0001.html 


More information about the chirp_devel mailing list