mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-18 00:51:20 +00:00
Added the Renderable mixin because DRY
This commit is contained in:
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)
|
||||
Reference in New Issue
Block a user