Added the Renderable mixin because DRY

This commit is contained in:
Daniel Quinn 2016-02-11 22:05:38 +00:00
parent ef1639208c
commit 7aadab23cc
5 changed files with 27 additions and 23 deletions

9
src/documents/mixins.py Normal file
View file

@ -0,0 +1,9 @@
class Renderable(object):
"""
A handy mixin to make it easier/cleaner to print output based on a verbosity
value.
"""
def _render(self, text, verbosity):
if self.verbosity >= verbosity:
print(text)