mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 21:47:53 +08:00
adds version and hides None values for qinfo config
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from optparse import make_option
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils.translation import ugettext as _
|
||||
from django_q import VERSION
|
||||
|
||||
from django_q.conf import Conf
|
||||
from django_q.monitor import info
|
||||
@@ -22,7 +23,10 @@ class Command(BaseCommand):
|
||||
if options.get('config', False):
|
||||
hide = ['conf', 'IDLE', 'STOPPING', 'STARTING', 'WORKING', 'SIGNAL_NAMES', 'STOPPED']
|
||||
settings = [a for a in dir(Conf) if not a.startswith('__') and a not in hide]
|
||||
self.stdout.write('VERSION: {}'.format('.'.join(str(v) for v in VERSION)))
|
||||
for setting in settings:
|
||||
self.stdout.write('{}: {}'.format(setting, getattr(Conf, setting)))
|
||||
value = getattr(Conf, setting)
|
||||
if value is not None:
|
||||
self.stdout.write('{}: {}'.format(setting, value))
|
||||
else:
|
||||
info()
|
||||
|
||||
Reference in New Issue
Block a user