Ejemplo n.º 1
0
    def handle(self, *args, **options):
        if len(args) != 0:
            raise CommandError("Command doesn't accept any arguments")

        locale = options.get('locale')
        domain = options.get('domain')
        verbosity = int(options.get('verbosity'))
        process_all = options.get('all')
        extensions = options.get('extensions')
        symlinks = options.get('symlinks')
        ignore_patterns = options.get('ignore_patterns')
        if options.get('use_default_ignore_patterns'):
            ignore_patterns += ['CVS', '.*', '*~']
        ignore_patterns = list(set(ignore_patterns))

        if domain == 'djangojs':
            extensions = handle_extensions(extensions or ['js'])
        else:
            extensions = handle_extensions(extensions or ['html'])

        if verbosity > 1:
            sys.stdout.write('examining files with the extensions: %s\n' %
                             get_text_list(list(extensions), 'and'))

        make_messages(locale, domain, verbosity, process_all, extensions,
                      symlinks, ignore_patterns)
Ejemplo n.º 2
0
    def handle(self, *args, **options):
        if len(args) != 0:
            raise CommandError("Command doesn't accept any arguments")

        locale = options.get('locale')
        domain = options.get('domain')
        verbosity = int(options.get('verbosity'))
        process_all = options.get('all')
        extensions = options.get('extensions')
        symlinks = options.get('symlinks')
        ignore_patterns = options.get('ignore_patterns')
        if options.get('use_default_ignore_patterns'):
            ignore_patterns += ['CVS', '.*', '*~']
        ignore_patterns = list(set(ignore_patterns))

        if domain == 'djangojs':
            extensions = handle_extensions(extensions or ['js'])
        else:
            extensions = handle_extensions(extensions or ['html'])

        if verbosity > 1:
            sys.stdout.write('examining files with the extensions: %s\n' % get_text_list(list(extensions), 'and'))

        make_messages(locale, domain, verbosity, process_all, extensions, symlinks, ignore_patterns)
Ejemplo n.º 3
0
 def invalid_block_tag(self, token, command, parse_until=None):
     if parse_until:
         raise self.error(token, "Invalid block tag: '%s', expected %s" % (command, get_text_list(["'%s'" % p for p in parse_until])))
     raise self.error(token, "Invalid block tag: '%s'" % command)
Ejemplo n.º 4
0
 def invalid_block_tag(self, token, command, parse_until=None):
     if parse_until:
         raise self.error(
             token, "Invalid block tag: '%s', expected %s" %
             (command, get_text_list(["'%s'" % p for p in parse_until])))
     raise self.error(token, "Invalid block tag: '%s'" % command)