[chirp_devel] Fwd: [PATCH] Fixes case where column order setting parsing was calling split on None

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


# HG changeset patch
# User Christopher Hoover <ch at murgatroid.com>
# Date 1510451669 28800
#      Sat Nov 11 17:54:29 2017 -0800
# Node ID daba4a5f7acefe52f5fa4f036c9df59865c8df1e
# Parent  0e0470d3e892bfd4818bfb972b8b85d58f2b00d4
Fixes case where column order setting parsing was calling split on None.

diff -r 0e0470d3e892 -r daba4a5f7ace chirp/ui/memedit.py
--- a/chirp/ui/memedit.py       Fri Nov 03 20:24:29 2017 -0400
+++ b/chirp/ui/memedit.py       Sat Nov 11 17:54:29 2017 -0800
@@ -961,15 +961,19 @@

         default_col_order = [x for x, y, z in self.cols if z]
         try:
-            col_order = self._config.get("column_order_%s" %
-                                         self.__class__.__name__).
split(",")
-            if len(col_order) != len(default_col_order):
-                raise Exception()
-            for i in col_order:
-                if i not in default_col_order:
+            config_setting = self._config.get("column_order_%s" %
+                                              self.__class__.__name__)
+            if config_setting is None:
+                col_order = default_col_order
+            else:
+                col_order = config_setting.split(",")
+                if len(col_order) != len(default_col_order):
                     raise Exception()
+                for i in col_order:
+                    if i not in default_col_order:
+                        raise Exception()
         except Exception, e:
-            LOG.error(e)
+            LOG.error("column order setting: %s", e)
             col_order = default_col_order

         non_editable = [_("Loc")]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20171118/f306155c/attachment-0001.html 


More information about the chirp_devel mailing list