Feature #2343

chirpc: cleanup and modernize CLI

Added by Zach Welch over 2 years ago. Updated over 2 years ago.

Status:In Progress Start date:02/22/2015
Priority:Normal Due date:
Assignee:Zach Welch % Done:

10%

Category:-
Target version:0.5.0
Chirp Version:daily Model affected:(All models)

Description

I would like to perform fully automated batch transformations of image files. This will best be accomplished via command-line scripting. The chirp.py offers a starting point for such a tool, so it needs to be cleaned up and improved. Ideally, it will allow a users to access much of the same functionality available from the GUI.

I have started working on this and already have a few patches in hand. I expect many more will be required to accomplish my mission. Meanwhile, it would be nice to know what others might expect from this kind of tool, as I would like my results to be as generally useful as possible.

Associated revisions

Revision 2376:3b0ca8e4f6c7
Added by Zach Welch over 2 years ago

Rename chirp.py as chirpc (#2343)

The chirp CLI needs a better name if it ever will be installed in PATH.
It is better to do that early on rather than later.

Revision 2377:acffbbd7f8d7
Added by Zach Welch over 2 years ago

Update chirpc argument parsing (#2343)

The optparse module is deprecated, so this patch converts chirpc to use
the argparse module. This allows chirpc and chirpw to share argument
parsing code.

Revision 2378:81465a9a288b
Added by Zach Welch over 2 years ago

chirpc: add --list-radios option (#2343)

The current list of radios is too long to present to the user in
the --help text, so this splits the list out into its own option.

Revision 2393:d3a3d61f1779
Added by Zach Welch over 2 years ago

Allow run_tests to be run from anywhere (#2343)

Find the path to run_tests, then chdir into the tests directory.

Revision 2513:da24079c6950
Added by Zach Welch over 2 years ago

Make download/upload progress optional (#2343)

This patch prevents the progress bar from appearing on the console if
the user gives the --quiet option. It also changes its destination to
stdout rather than stderr.

Revision 2514:2501735ee438
Added by Zach Welch over 2 years ago

Fix status reporting in UV-5R (#2343)

This patch ensures the UV-5R driver reports 100% completion after
finishing an upload or download.

Revision 2515:9185e6e788cb
Added by Zach Welch over 2 years ago

Improve CLI download/upload (#2343)

This patch adds much-needed checks in the CLI, allowing an unwitting
user to stumble their way toward a working set of options that permits
downloading/uploading an image from/to a radio.

Revision 2516:5d2944c269ee
Added by Zach Welch over 2 years ago

chirpc: add memory option group (#2343)

This patch groups the memory/channel modification options into an
argument group, making the --help text easier to digest. It also
eliminates redundant arguments to the relevant add_argument calls,
since those lines are being touched anyway.

Revision 2517:0f6852e26fa5
Added by Zach Welch over 2 years ago

Improve settings strigification (#2343)

This patch allows a RadioSettings object to be strigified. It also
cleans up the string representation of RadioSettingGroup objects.

Revision 2518:395ad4644861
Added by Zach Welch over 2 years ago

chirpc: add --list-settings (#2343)

This patch allows the CLI to print out the radio's current settings.

Revision 2519:68f956bc4f47
Added by Zach Welch over 2 years ago

chirpc: add --list-mem (#2343)

This patch allows the CLI to print out the entire list of memories.
If --verbose is given, it displays empty slots too; otherwise, only
non-empty memories are displayed.

Revision 2520:94bf6ebc3166
Added by Zach Welch over 2 years ago

chirpc: make mem options more robust (#2343)

This patch makes the memory options more robust to a bad memory number
argument and some other exceptions. It also fixes a bug that prevented
setting an empty channel. Finally, it avoids overwriting the image file
when performaning a memory query.

Revision 2521:8320970dc260
Added by Zach Welch over 2 years ago

chirpc: add --clear-mem option (#2343)

This patch gives the CLI the means of clearing a memory channel.

Revision 2522:ac586d372508
Added by Zach Welch over 2 years ago

chirpc: add --copy-mem option (#2343)

This patch adds an option that permits copying a memory channel.

Revision 2523:b57aabdf7f18
Added by Zach Welch over 2 years ago

README.chirpc: new file (#2343)

This patch adds a new README.chirpc file, providing some basic recipies
for accomplishing tasks using the renovated CLI.

Revision 2528:256ccb5acf24
Added by Zach Welch over 2 years ago

Add newline at end of console status (#2343)

When downloading/uploading on the console, a pretty status bar is
printed on a single line. At the end of the transfer, a newline needs
to be added, or subsequent output will appear on the same line as the
status bar.

Revision 2532:d0afd97ebb04
Added by Dan Smith over 2 years ago

Fix minor bugs in run_tests (#2343, #2347)

This patch contains two fixes for the run_tests.

The first change resolves problems when running the script without a
path component in its name (either as 'python run_tests' or with
PATH="./tests:${PATH}"). Now, we do not try to change directory unless
there is a path component.

The second problem was that the logs directory will not exist in a clean
working copy of the repository. It was being created after the logger
module was called. That is resolved by moving the directory creation
step to occur before the initialization of the logger module options.

Patch originally by Zach Welch, fixed instead of arguing by me.

Revision 2537:8d57cc100059
Added by Filippi Marco over 2 years ago

[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

Revision 2538:06641d7d614d
Added by Filippi Marco over 2 years ago

[chirpc] Allow memnum arg to be a string to access special channels

Special channels are identified by extd_number which can be a string

Improves #2343

Revision 2539:797a3a043831
Added by Filippi Marco over 2 years ago

[chirpc] Allow deleting an already empty memory

On some radio (eg ft817) empty channels can contain valid data, deleting again
such a memory usually clean data

Improves #2343

History

Updated by Zach Welch over 2 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Updated by Zach Welch over 2 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from chirp.py: cleanup and modernize CLI to chirpc: cleanup and modernize CLI

Also available in: Atom PDF