2012-06-22 11:31:15 +02:00
|
|
|
import logging
|
2012-05-28 21:16:38 +02:00
|
|
|
from optparse import make_option
|
|
|
|
|
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
2012-06-22 11:31:15 +02:00
|
|
|
from djeuscan.processing import set_verbosity_level
|
2012-07-02 18:16:59 +02:00
|
|
|
from djeuscan.processing.misc import update_counters
|
2012-05-28 21:16:38 +02:00
|
|
|
|
2012-06-22 11:31:15 +02:00
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
2012-05-28 21:16:38 +02:00
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
_overlays = {}
|
|
|
|
help = 'Update counters'
|
|
|
|
|
|
|
|
option_list = BaseCommand.option_list + (
|
|
|
|
make_option('--fast',
|
|
|
|
action='store_true',
|
|
|
|
dest='fast',
|
|
|
|
default=False,
|
|
|
|
help='Skip sanity checks'),
|
|
|
|
make_option('--nolog',
|
|
|
|
action='store_true',
|
|
|
|
dest='nolog',
|
|
|
|
default=False,
|
|
|
|
help='Skip logs'),
|
|
|
|
)
|
|
|
|
|
|
|
|
def handle(self, *args, **options):
|
2012-06-22 11:31:15 +02:00
|
|
|
set_verbosity_level(logger, options.get("verbosity", 1))
|
2012-06-22 09:32:39 +02:00
|
|
|
update_counters(
|
|
|
|
fast=options["fast"],
|
|
|
|
nolog=options["nolog"],
|
2012-06-22 11:31:15 +02:00
|
|
|
logger=logger,
|
2012-06-22 09:32:39 +02:00
|
|
|
)
|