Commands are classes that encapsulate a set of actions based on a config. Each class registers itself on the command line so that it is callable from there but can also be called programmatically.
The base from which all CLI commands are derived.
A BaseCommand object must have have several class variables:
COMMAND MUST be a UNIQUE str which will be used as a sub-parser of CLI_SUBPARSER
OPTIONS MUST be a list of dict objects. Each dict MUST be of the form:
{'args' : ('-switch', '--long_switch'), # This may be a 1-tuple
'kwargs' : {[OPTIONS TO PASS TO parser.add_argument]}
}
When a Command object is created and executed it
Outside users of a Command object are expected to init the object (possibly with kwargs if only calling from the API) and then to call execute()
| Variables: |
|---|
Defines the py2TheFaceR.py COMMAND [options] part of the CLI interface
The keywords to expect in INI_SECTION
The INI section name additional config may be defined in
Options that are provided to the argparse module via the meta-class
Update cmd_config using the destinations defined in OPTIONS
| Params api_config: | |
|---|---|
| The kwargs passed in to the __init__() | |
Last chance to catch semantic errors in the config before executing
Migrates the config from the argparser to cmd_config
| Parameters: | cli_settings – |
|---|
Base level parser. This method should be overridden by a child class
| Parameters: | cfg_parser (ConfigParser.SafeConfigParser) – One that has already loaded the ini file |
|---|
The sort-of global ArgumentParser. This is where all the CLI options end up.
The sort-of global subparser, so that sub commands a-la svn style can exist.
Link a set of Google contacts with the corresponding flickr id’s
For a set of photos add the facial data to flickr using the the database as a reference for Google contact –> flickr user