export_lexemes.py 1.07 KB
# -*- coding: utf-8 -*-
from django.core.management import BaseCommand

from export.lexeme_export import LexemeExport


class Command(BaseCommand):
    help = 'Temporary export script'
    args = 'export_data'

    def add_arguments(self, parser):
        # Named (optional) arguments
        parser.add_argument('--nocopyright',
            action='store_true',
            dest='nocopy',
            default=False,
            help='Do not create copyright.txt file.')
        parser.add_argument('--exportyear',
            action='store_true',
            dest='expyear',
            default=False,
            help='Export "year" attribute with lexeme qualifiers.')
        parser.add_argument('--odmieniasie',
            action='store_true',
            dest='odmienias',
            default=False,
            help='Export additional odmienias index column.')


    def handle(self, export_data=None, **options):
        LexemeExport(export_data_name=export_data, nocopy_flag=options['nocopy'], expyear_flag=options['expyear'], include_odmienias_index=options['odmienias']).export()