-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve PySS3's verbosity level handling (#1)
In response to Issue #1, the way in which PySS3 handled the level of verbosity was redesigned in order to give the user greater control through a clearer interface. Now PySS3 supports the following 3 levels of verbosity: - ``0`` (quiet): do not output any message (only error messages) - ``1`` (normal): default behavior, display only warning messages and progress bars [*] - ``2`` (verbose): display also the informative non-essential messages Besides, now the following built-in constants can also be used to refer to these 3 values: ``VERBOSITY.QUIET``, ``VERBOSITY.NORMAL``, and ``VERBOSITY.VERBOSE``, respectively. In addition, a ``set_verbosity`` function has been added to the main module, for the user to change the verbosity level. For example, let's suppose we want to set the verbosity level to 'quiet', then we could use: >>> import pyss3 ... >>> pyss3.set_verbosity(0) ... or, equivalently: >>> import pyss3 >>> from pyss3 import VERBOSITY ... >>> pyss3.set_verbosity(VERBOSITY.QUIET) ... To carry out this update, the ``Print`` class was partially redesigned, and therefore, as it can be seen, the source code of all the modules had to be modified as well (to be compatible with the new ``Print`` design). [*] Note that, unlike before, PySS3 will now, by default, only show progress bars (plus warning or error messages). Resolves: #1
- Loading branch information
1 parent
85939da
commit 216be41
Showing
4 changed files
with
175 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.