Home | Trees | Index | Help |
|
---|
Package CedarBackup2 :: Module cli |
|
The functionality in this module encapsulates the command-line interface for the cback script. The cback script itself is very short, basically just an invokation of one function implemented here. That, in turn, makes it simpler to validate the command line interface (for instance, it's easier to run pychecker against a module, and unit tests are easier, too).
The objects and functions implemented in this module are probably not useful to any code external to Cedar Backup. Anyone else implementing their own command-line interface would have to reimplement (or at least enhance) all of this anyway.Author: Kenneth J. Pronovici <pronovic@ieee.org>
Classes | |
---|---|
Options |
Class representing command-line options for the cback script. |
Function Summary | |
---|---|
Implements the command-line interface for the cback
script. |
Variable Summary | |
---|---|
str |
DEFAULT_CONFIG : The default configuration file. |
str |
DEFAULT_LOGFILE : The default log file path. |
list |
DEFAULT_OWNERSHIP : Default ownership for the logfile. |
int |
DEFAULT_MODE : Default file permissions mode on the logfile. |
list |
VALID_ACTIONS : List of valid actions. |
list |
COMBINE_ACTIONS : List of actions which can be combined with other actions. |
list |
NONCOMBINE_ACTIONS : List of actions which cannot be combined with other actions. |
int |
COLLECT_INDEX = 100 |
str |
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S %Z'
|
str |
DISK_LOG_FORMAT = '%(asctime)s --> [%(levelname)-7s] %(m...
|
str |
DISK_OUTPUT_FORMAT = '%(message)s'
|
Logger |
logger = <logging.Logger instance at 0x4031f26c>
|
list |
LONG_SWITCHES = ['help', 'version', 'verbose', 'quiet', ...
|
int |
PURGE_INDEX = 400 |
str |
SCREEN_LOG_FORMAT = '%(message)s'
|
_DevNull |
SCREEN_LOG_STREAM = <epydoc.imports._DevNull instance at...
|
str |
SHORT_SWITCHES = 'hVbqc:fl:o:m:Ods'
|
int |
STAGE_INDEX = 200 |
int |
STORE_INDEX = 300 |
Function Details |
---|
cli()Implements the command-line interface for the Essentially, this is the "main routine" for the cback script. It does all of the argument processing for the script, and then sets about executing the indicated actions. As a general rule, only the actions indicated on the command line will be executed. We will accept any of the standard actions and any of the configured extended actions (which makes action list verification a two- step process). The Raised exceptions always result in an immediate return. Otherwise, we generally return when all specified actions have been completed. Actions are ignored if the help, version or validate flags are set. A different error code is returned for each type of failure:
|
Variable Details |
---|
DEFAULT_CONFIGThe default configuration file.
|
DEFAULT_LOGFILEThe default log file path.
|
DEFAULT_OWNERSHIPDefault ownership for the logfile.
|
DEFAULT_MODEDefault file permissions mode on the logfile.
|
VALID_ACTIONSList of valid actions.
|
COMBINE_ACTIONSList of actions which can be combined with other actions.
|
NONCOMBINE_ACTIONSList of actions which cannot be combined with other actions.
|
COLLECT_INDEX
|
DATE_FORMAT
|
DISK_LOG_FORMAT
|
DISK_OUTPUT_FORMAT
|
logger
|
LONG_SWITCHES
|
PURGE_INDEX
|
SCREEN_LOG_FORMAT
|
SCREEN_LOG_STREAM
|
SHORT_SWITCHES
|
STAGE_INDEX
|
STORE_INDEX
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Dec 18 22:53:31 2006 | http://epydoc.sf.net |