12.1.1
|
|
Add lava.core.main
The .main module defines one, relatively big, lava.commands.Dispatcher subclass, LavaDispatcher, that is specialized for being the entry point to all of lava form the shell. There are a number of customizations as compared to the plain Dispatcher class.
There is a custom argument parser, as produced by construct_parser(), that has a lot of additional options for debugging and logging. There is a set of methods that conditionally enable plain logging, verbose logging, exception/crash logging, and developer-debug logging. Those are all called from the private method _adjust_logging_level() (that is a part of the Command class API)
There way commands are processed, via dispatch(), is customized to handle various exceptions, including CommandError which is considered normal (not an application crash) and KeyboardInterrupt (which, by default, is not producing a backtrace). This function also knows how to spawn pdb, the python debugger, for a post-mortem session, if requested.
Lastly there is a helper method save_history_now() that exists there to work around scratch space going away by the time the command finishes (as typically commands manage their scratch space internally). This part could be changed so that commands get a scratch space from the Dispatcher (and thus extend the lifetime of temporary files long enough so that the dispatcher gets to save global history, including any attachments, just before discarding the top-level Scratch object)
|
Zygmunt Krynicki |
12 years ago
|
|
|
12
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
11
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
10
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
9
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
8
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
7
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
6
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
5
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
4
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
3
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
2
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|
1
|
|
|
Zygmunt Krynicki |
12 years ago
|
|
|