cernopendata / cernopendata-client

CERN Open Data command-line client
http://cernopendata-client.readthedocs.io/
GNU General Public License v3.0
10 stars 9 forks source link

printer: initial release #61

Closed tiborsimko closed 3 years ago

tiborsimko commented 3 years ago

Instead of having print() and click.echo() hard-coded throughout the code base, let's introduce a new printer.py module that can take care of displaying info/error messages in unified manner.

Example: display_message() function in reana-dev.

We could then print success in green, progress in yellow, errors in red, etc.

The code base should then be amended to use the new display_message() function instead of printing or echoing.

tiborsimko commented 3 years ago

Don't hesitate to play also with echoing the main headlines in bold, for example:

2020-10-16-135211_2560x1440_scrot

Example of function signature: display_message(message, style='error') which would produce message with leading ==> ERROR: message in red. By default the style could be green (meaning all OK), and style='warning' would be in yellow, etc.

ParthS007 commented 3 years ago

@tiborsimko What do you think about this one?

Screenshot 2020-10-16 at 14 33 28