[chirp_devel] [PATCH 1 of 1] bitwise browser - sort items
Marco Filippi IZ3GME
Tue Mar 5 01:29:04 PST 2013
# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1362475271 -3600
# Node ID 0cfe1c60eb7edd628deb5a94e29c52050510ed70
# Parent 92679e07fa5bfea0d2daa56957e647e7fca5a074
bitwise browser - sort items
diff --git a/chirpui/radiobrowser.py b/chirpui/radiobrowser.py
--- a/chirpui/radiobrowser.py
+++ b/chirpui/radiobrowser.py
@@ -211,7 +211,7 @@
iter = self._store.append(parent, (name, obj))
if isinstance(obj, bitwise.structDataElement):
- for name, item in obj.items():
+ for name, item in sorted(obj.items(), key=lambda t: t[0]):
if isinstance(item, bitwise.structDataElement):
self._fill(name, item, iter)
elif isinstance(item, bitwise.arrayDataElement):
@@ -245,7 +245,7 @@
self._display.foreach(abandon)
- for name, item in obj.items():
+ for name, item in sorted(obj.items(), key=lambda t: t[0]):
if item.size() % 8 == 0:
name = '<b>%s</b> <small>(%s %i bytes)</small>' % (
name, bitwise_type(classname(item)), item.size() / 8)
More information about the chirp_devel
mailing list