Feature #4292

Parametrize commands output and make it flexible

Added by Stavros Sachtouris over 7 years ago. Updated over 7 years ago.

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

blocks ./kamaki - Support #4058: Create unittests for top-level kamaki.cli.* functions New 06/25/2013 08/31/2013

Associated revisions

Revision 1757c616
Added by Stavros Sachtouris over 7 years ago

Remove pithos.DelimterValue + self._out to list

Refs: #4292

Revision ff1c0296
Added by Stavros Sachtouris over 7 years ago

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

Revision 3185cd6d
Added by Stavros Sachtouris over 7 years ago

Remove builtin.print up to history

Refs: #4292

Revision 1d0f1ffa
Added by Stavros Sachtouris over 7 years ago

Remove builtin.print from _commands

Refs: #4292

Revision ddcb2e09
Added by Stavros Sachtouris over 7 years ago

Implement member versions of utils print methods

Refs: #4292

Revision 76f58e2e
Added by Stavros Sachtouris over 7 years ago

Replace print methods w. respective member methods

Refs: #4292

Revision 807f3dbb
Added by Stavros Sachtouris over 7 years ago

Update Changelog with print method changes

Refs: #4292

History

#1 Updated by Stavros Sachtouris over 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#2 Updated by Stavros Sachtouris over 7 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF