[chirp_devel] [PATCH 1 of 3] [chirpc] Add --list-special-mem
Marco Filippi IZ3GME
Wed Mar 18 07:11:23 PDT 2015
# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1426686272 -3600
# Wed Mar 18 14:44:32 2015 +0100
# Node ID 8d57cc100059afe033fd4d3daf27a94f4a17cb4d
# Parent 5c8ac5597f34af143915667c51ed5882e97e30f7
[chirpc] Add --list-special-mem
Add to chirpc the capability to list special channels if any
The string memory representation have been changed to print the extd_number when
present instead of number
Improves #2343
diff --git a/chirp/chirp_common.py b/chirp/chirp_common.py
--- a/chirp/chirp_common.py
+++ b/chirp/chirp_common.py
@@ -364,8 +364,9 @@
else:
dup = self.duplex
- return "Memory %i: %s%s%s %s (%s) r%.1f%s c%.1f%s d%03i%s%s [%.2f]" % \
- (self.number,
+ return \
+ "Memory %s: %s%s%s %s (%s) r%.1f%s c%.1f%s d%03i%s%s [%.2f]" % \
+ (self.number if self.extd_number == "" else self.extd_number,
format_freq(self.freq),
dup,
format_freq(self.offset),
diff --git a/chirpc b/chirpc
--- a/chirpc
+++ b/chirpc
@@ -105,6 +105,9 @@
memarg.add_argument("--list-mem", action="store_true",
help="List all memory locations")
+ memarg.add_argument("--list-special-mem", action="store_true",
+ help="List all special memory locations")
+
memarg.add_argument("--raw", action="store_true",
help="Dump raw memory location")
@@ -233,6 +236,15 @@
print mem
sys.exit(0)
+ if options.list_special_mem:
+ rf = radio.get_features()
+ for i in sorted(rf.valid_special_chans):
+ mem = radio.get_memory(i)
+ if mem.empty and not logger.is_visible(logging.INFO):
+ continue
+ print mem
+ sys.exit(0)
+
if options.copy_mem:
src = parse_memory_number(radio, args)
dst = parse_memory_number(radio, args[1:])
More information about the chirp_devel
mailing list