[chirp_devel] [PATCH 0 of 1 ] Update over bitwise browser
This patch goes over last bitwise browser one from Dan to have item sorted.
Yes Dan, I like that browser!
BTW can't we show a message when developer option is first enabled to warn user that "much damage can be caused to the underlying image if care is not exercised"?
73 de IZ3GME Marco
# HG changeset patch # User Marco Filippi iz3gme.marco@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)
bitwise browser - sort items
Hmm, I intentionally didn't sort them because I wanted things to show up in memory-order. I have plans to make them expose their address and size information. Do you think sorted is better?
...mmm... memory order IS better but they seemed to be mixed up (or in an order I didn't recognize) and it was easier for me to sort them ;)
73 de IZ3GME Marco
On 05/03/2013 15:33, Dan Smith wrote:
bitwise browser - sort items
Hmm, I intentionally didn't sort them because I wanted things to show up in memory-order. I have plans to make them expose their address and size information. Do you think sorted is better?
chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
participants (3)
-
Dan Smith
-
IZ3GME Marco
-
Marco Filippi IZ3GME