Feature #4292
Parametrize commands output and make it flexible
Status: | Closed | Start date: | 09/10/2013 | |
---|---|---|---|---|
Priority: | Medium | Due date: | 09/25/2013 | |
Assignee: | Stavros Sachtouris | % Done: | 100% |
|
Category: | kamaki | Spent time: | 20.00 hours | |
Target version: | v0.11 | Estimated time: | 60.00 hours |
Description
Currently, command specs output is implemented with systems print or various kamaki.cli.utils printing methods.
It is requested to modify command specs so that they will output to a stream defined at initialization level.
This will require a careful review of every single command spec that prints out something, to spot the points where a printing method should be replaced.
Rational: Generaly, it is a good idea to customize your output mechanism at a single point. On top of that, there are 2 good arguments in favour of this feature.
(a) Allows the implementation of various user interfaces on top of kamaki command specs, e.g. GUIs or web interfaces. New UIs can use the command tree structure that offers loading, resolving namespaces, help and description for each command set.
(b) Allows the implementation of automatic testing mechanisms, by defining fitting input/output streams and use them to match outputs in (input / expected output) scenarios
Related issues
Associated revisions
Remove pithos.DelimterValue + self._out to list
Refs: #4292
Add _err to commands, remove pithos print calls
Refs: #4292
Also, add the methods write, writeln and error to print something to
<_commands>._out/_out/_err respectively.
builtin.print is replaced by self.writeln or self.error
Remove builtin.print up to history
Refs: #4292
Remove builtin.print from _commands
Refs: #4292
Implement member versions of utils print methods
Refs: #4292
Replace print methods w. respective member methods
Refs: #4292
Update Changelog with print method changes
Refs: #4292
History
#1 Updated by Stavros Sachtouris about 10 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
#2 Updated by Stavros Sachtouris almost 10 years ago
- Status changed from Resolved to Closed