<commit_before>from django.core.management.base import BaseCommand

from geotrek.feedback.parsers import SuricateParser


class Command(BaseCommand):
    leave_locale_alone = True

    def add_arguments(self, parser):
        # parser.add_argument('-l', dest='limit', type=int, help='Limit number of lines to import')
        # todo
        parser.add_argument(
            "--activities", dest="activities", help="Import activities", default=True
        )
        parser.add_argument(
            "--statuses", dest="statuses", help="Import statuses", default=True
        )

    def handle(self, *args, **options):
        parser = SuricateParser()
        if options["statuses"]:
            parser.get_statuses()
        if options["activities"]:
            parser.get_activities()
<commit_msg>Improve parameters of sync_suricate command<commit_after>from django.core.management.base import BaseCommand

from geotrek.feedback.parsers import SuricateParser


class Command(BaseCommand):
    leave_locale_alone = True

    def add_arguments(self, parser):
        # parser.add_argument('-l', dest='limit', type=int, help='Limit number of lines to import')
        # todo
        parser.add_argument(
            "--activities_only", dest="activities_only", help="Import activities but no statuses nor alerts", default=False
        )
        parser.add_argument(
            "--statuses_only", dest="statuses_only", help="Import statuses but no activities nor alerts", default=False
        )
        #todo documents

    def handle(self, *args, **options):
        parser = SuricateParser()
        if options["statuses_only"]:
            parser.get_statuses()
        elif options["activities_only"]:
            parser.get_activities()
        elif options["activities_only"] and options["statuses_only"]:
            parser.get_statuses()
            parser.get_activities()
        else:
            parser.get_statuses()
            parser.get_activities()
            parser.get_alerts()

{'fraction_non_alphanumeric': 0.108, 'fraction_numerical': 0.0, 'mean_word_length': 2.7754716981132077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7482752', 'n_tokens_mistral': 545, 'n_tokens_neox': 533, 'n_words': 124}