Re: [chirp_devel] [developer] Add info re: hex dump modes to "Diff Radios" dialog - #1753
(*blush*). Thanks for noticing the misspelling. Respun patch attached. -dan
On Jul 12, 2014, at 7:27 PM, Dan Smith - dsmith@danplanet.com wrote:
label.set_markup("<b>-1</b> for either Mem # does a hex dump with " +
"diffs higlighted.\n" +
"<b>-2</b> for first Mem # shows <b>only</b> the diffs.")
"highlighted" is misspelled. Also, can you mention "full file" in there somewhere? Otherwise I don't think it's clear that -1 or -2 diff the whole file instead of a single memory.
Thanks!
--Dan
Patch attached. -dan
try:
addrfmt = CONF.get("hexdump_addrfmt", "developer")
except Exception:
addrfmt = "decimal"
if addrfmt == None:
addrfmt = "decimal"
elif (addrfmt != "decimal" and addrfmt != "hex" and addrfmt != "both"):
print "Invalid hexdump_addrfmt value %s. Using decimal." % addrfmt
addrfmt = "decimal"
for i in range(0, (len(data)/line_sz)):
out += "%03i: " % (i * line_sz)
if addrfmt == "hex":
out += "x%04X: " % (i * line_sz)
elif addrfmt == "both":
out += "%04i x%04X: " % ((i * line_sz), (i * line_sz))
else:
out += "%04i: " % (i * line_sz)
Just a thought...
Instead of having them choose from a few different symbolic choices, why not just let them specify the format themselves? So in the config:
hexdump_addrfmt = %0000x
and in the code:
fmt = CONF.get("hexdump_addrfmt", "developer") . . . thing = fmt % addr
I can just see someone coming along and wanting octal or something and if we just let them specify the format, we can avoid adding new symbols. What do you think?
--Dan
participants (2)
-
chirp.cordless@xoxy.net
-
Dan Smith