export_lexemes.py 847 Bytes
# -*- 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.')

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