Package babel :: Package messages :: Module frontend :: Class init_catalog

# Class init_catalog

    distutils.cmd.Command --+
                            |
                           init_catalog

New catalog initialization command for use in `setup.py` scripts.

If correctly installed, this command is available to Setuptools-using setup scripts automatically. For projects using plain old `distutils`, the command needs to be registered explicitly in `setup.py`:

    from babel.messages.frontend import init_catalog

    setup(
        ...
        cmdclass = {'init_catalog': init_catalog}
    )

See Also:
  Integrating new distutils commands, setuptools

Instance Methods

initialize_options(self) Set default values for all the options that this command supports. |

finalize_options(self) Set final values for all the options that this command supports. |

run(self) A command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'. |

Inherited from `distutils.cmd.Command`: `__getattr__`, `__init__`, `announce`, `copy_file`, `copy_tree`, `debug_print`, `dump_options`, `ensure_dirname`, `ensure_filename`, `ensure_finalized`, `ensure_string`, `ensure_string_list`, `execute`, `get_command_name`, `get_finalized_command`, `get_sub_commands`, `make_archive`, `make_file`, `mkpath`, `move_file`, `reinitialize_command`, `run_command`, `set_undefined_options`, `spawn`, `warn`

Class Variables
| description = ``'``create a new catalog based on a POT file``'``
| user_options = ``[``(``'``domain=``'``,` `'``D``'``,` `'``domain of PO file (default \``...``
Inherited from `distutils.cmd.Command`: `sub_commands`

Method Details

### initialize_options(self)

Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self.foo = None" assignments.

This method must be implemented by all command classes.

Overrides: distutils.cmd.Command.initialize_options
  (inherited documentation)

### finalize_options(self)

Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in 'initialize_options()'.

This method must be implemented by all command classes.

Overrides: distutils.cmd.Command.finalize_options
  (inherited documentation)

### run(self)

A command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'. All terminal output and filesystem interaction should be done by 'run()'.

This method must be implemented by all command classes.

Overrides: distutils.cmd.Command.run
  (inherited documentation)

Class Variable Details

### user_options

Value:

      [('domain=', 'D', 'domain of PO file (default \'messages\')'),
       ('input-file=', 'i', 'name of the input file'),
       ('output-dir=', 'd', 'path to output directory'),
       ('output-file=',
        'o',
        'name of the output file (default \'<output_dir>/<locale>/LC_MESSAGE
      S/<domain>.po\')'),
       ('locale=', 'l', 'locale for the new localized catalog')]