- # Prepare additional args for parser.
- parser_args = {}
- for option in cls.parser_options:
- parser_args[option.name()] = option.value(options)
- # Prepare additional args for transform method.
- transform_args = {}
- for option in cls.transform_options:
- transform_args[option.name()] = option.value(options)
- # Add flags to transform_args, if any.
- transform_flags = [flag.name() for flag in cls.transform_flags
- if flag.value(options)]
- if transform_flags:
- transform_args['flags'] = transform_flags
- # Add cover support, if any.
- if cls.uses_cover:
- if options.image_cache:
- def cover_class(*args, **kwargs):
- return WLCover(image_cache=options.image_cache, *args, **kwargs)
- transform_args['cover'] = cover_class
- elif not cls.cover_optional or options.with_cover:
- transform_args['cover'] = WLCover
-
+ # Prepare additional args for document.
+ document_args = {}
+ for option in cls.document_options:
+ document_args[option.name()] = option.value(options)
+ # Prepare additional args for format.
+ format_args = {}
+ for option in cls.format_options:
+ format_args[option.name()] = option.value(options)
+ # Prepare additional args for build.
+ build_args = {}
+ for option in cls.build_options:
+ build_args[option.name()] = option.value(options)