[[!tag cliapp announcement]]
I've just released, to code.liw.fi, version 1.20130313 of cliapp, my Python framework for Unix-like command line programs. It contains the typical stuff such programs need to do, such as parsing the command line for options, and iterating over input files.
Version 1.20130313
- Add
cliapp.Application.compute_setting_valuesmethod. This allows the application to have settings with values that are computed after configuration files and the command line are parsed. - Cliapp now logs the Python version at startup, to aid debugging.
cliapp.runcmdnow logs much less during execution of a command. The verbose logging was useful while developing pipeline support, but has now not been useful for months.- More default settings and options have an option group now, making
--helpoutput prettier. - The
--helpoutput and the output of thehelpsubcommand now only list summaries for subcommands. The full documentation for a subcommand can be seen by giving the name of the subcommand tohelp. - Logging setup is now more overrideable. The
setup_loggingmethod callssetup_logging_handler_for_syslog,setup_logging_handler_for_syslog, orsetup_logging_handler_to_file, and the last one callssetup_logging_formatandsetup_logging_timestampto create the format strings for messages and timestamps. This allows applications to add, for example, more detailed timestamps easily. - The process and system CPU times, and those of the child processes, and the process wall clock duration, are now logged when the memory profiling information is logged.
- Subcommands added with
add_subcommandmay now have aliases. Subcommands defined usingApplicationclass methods namedcmd_*cannot have aliases. - Settings and subcommands may now be hidden from
--helpandhelpoutput. New option--help-alland new subcommandhelp-allshow everything. - cliapp(5) now explains how
--generate-manpageis used. Thanks to Enrico Zini for the suggestion. - New function
cliapp.ssh_runcmdfor executing a command remotely over ssh. The function automatically shell-quotes the argv array given to it so that arguments with spaces and other shell meta-characters work over ssh. - New function
cliapp.shell_quotequotes strings for passing as shell arguments. cliapp.runcmdnow has a new keyword argument:log_error. If set to false, errors are not logged. Defaults to true.
Bug fixes:
- The process title is now set only if
/proc/self/commexists. Previously, on the kernel in Debian squeeze (2.6.32), setting the process title would fail, and the error would be logged to the terminal. Reported by William Boughton. - A setting may no longer have a default value of None.