summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-04-06 10:59:02 +0100
committerLars Wirzenius <liw@liw.fi>2011-04-06 10:59:02 +0100
commitb899be4ee3c49af2f3887e874f36f217438b9948 (patch)
treeb765ef8f2354e9409bf41c84edd7055cbcda1835 /README
parentded04268e914e3309c70eb673fc5945454709765 (diff)
downloadcliapp-b899be4ee3c49af2f3887e874f36f217438b9948.tar.gz
Add some more documentation to README.
Diffstat (limited to 'README')
-rw-r--r--README29
1 files changed, 29 insertions, 0 deletions
diff --git a/README b/README
index 93ccd6e..6a69374 100644
--- a/README
+++ b/README
@@ -38,6 +38,35 @@ Example
See the file `example.py` for an example of how to use the framework.
+Walkthrough
+-----------
+
+Every application should be a class that subclasses `cliapp.Application`.
+The subclass should provide specific methods. Read the documentation
+for the `cliapp.Application` class to see all methods, but a rough
+summary is here:
+
+* the `settings` attribute is the `cliapp.Settings` instance used by
+ the application
+* override `add_settings` to add new settings for the application
+* override `process_*` methods to override various stages in how
+ arguments and input files are processed
+* override `process_args` to decide how each argument is processed;
+ by default, this called `process_inputs`
+* `process_inputs` calls `process_input` (note singular) for each
+ argument, or on `-` to process standard input if no files are named
+ on the command line
+* `process_input` calls `open_input` to open each file, then calls
+ `process_input_line` for each input line
+* `process_input_line` does nothing, by default
+
+This cascade of overrideable methods is started by the `run`
+method, which also sets up logging, loads configuration files,
+parses the command line, and handles reporting of exceptions.
+It can also run the rest of the code under the Python profiler,
+if the appropriate environment variable is set.
+
+
Legalese
--------