mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 17:17:26 +01:00
Added the Renderable mixin because DRY
This commit is contained in:
parent
ef1639208c
commit
7aadab23cc
5 changed files with 27 additions and 23 deletions
9
src/documents/mixins.py
Normal file
9
src/documents/mixins.py
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue