Package translate :: Package convert :: Module convert :: Class ConvertOptionParser
[hide private]
[frames] | no frames]

Class ConvertOptionParser

source code

     optparse.OptionContainer --+        
                                |        
            optparse.OptionParser --+    
                                    |    
                           object --+    
                                    |    
misc.optrecurse.RecursiveOptionParser --+
                                        |
                               object --+
                                        |
                                       ConvertOptionParser
Known Subclasses:

a specialized Option Parser for convertor tools...

Instance Methods [hide private]
 
__init__(self, formats, usetemplates=False, usepots=False, allowmissingtemplate=False, description=None)
construct the specialized Option Parser
source code
 
add_fuzzy_option(self, default=False)
adds an option to include / exclude fuzzy translations
source code
 
add_duplicates_option(self, default='msgctxt')
adds an option to say what to do with duplicate strings
source code
 
add_multifile_option(self, default='single')
adds an option to say how to split the po/pot files
source code
 
potifyformat(self, fileformat)
converts a .po to a .pot where required
source code
 
getformathelp(self, formats)
make a nice help string for describing formats...
source code
 
filterinputformats(self, options)
filters input formats, processing relevant switches in options
source code
 
filteroutputoptions(self, options)
filters output options, processing relevant switches in options
source code
 
setpotoption(self)
sets the -P/--pot option depending on input/output formats etc
source code
 
verifyoptions(self, options)
verifies that the options are valid (required options are present, etc)
source code
 
run(self, argv=None)
parses the command line options and runs the conversion
source code

Inherited from misc.optrecurse.RecursiveOptionParser: checkoutputsubdir, define_option, finalizetempoutputfile, format_manpage, get_prog_name, getfullinputpath, getfulloutputpath, getfulltemplatepath, getoutputname, getoutputoptions, getpassthroughoptions, gettemplatename, getusageman, getusagestring, initprogressbar, isexcluded, isrecursive, isvalidinputname, mkdir, openinputfile, openoutputfile, opentemplatefile, opentempoutputfile, parse_args, print_manpage, processfile, recurseinputfilelist, recurseinputfiles, recursiveprocess, reportprogress, set_usage, seterrorleveloptions, setformats, setmanpageoption, setprogressoptions, setpsycooption, splitext, splitinputext, splittemplateext, templateexists, usepsyco, warning

Inherited from optparse.OptionParser: add_option_group, check_values, destroy, disable_interspersed_args, enable_interspersed_args, error, exit, expand_prog_name, format_epilog, format_help, format_option_help, get_default_values, get_description, get_option_group, get_usage, get_version, print_help, print_usage, print_version, set_default, set_defaults, set_process_default_values

Inherited from optparse.OptionParser (private): _add_help_option, _add_version_option, _create_option_list, _get_all_options, _get_args, _get_encoding, _init_parsing_state, _match_long_opt, _populate_option_list, _process_args, _process_long_opt, _process_short_opts

Inherited from optparse.OptionContainer: add_option, add_options, format_description, get_option, has_option, remove_option, set_conflict_handler, set_description

Inherited from optparse.OptionContainer (private): _check_conflict, _create_option_mappings, _share_option_mappings

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]

Inherited from optparse.OptionParser: standard_option_list

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, formats, usetemplates=False, usepots=False, allowmissingtemplate=False, description=None)
(Constructor)

source code 

construct the specialized Option Parser

Parameters:
  • formats - See setformats() for an explanation of the formats parameter.
Overrides: object.__init__

getformathelp(self, formats)

source code 

make a nice help string for describing formats...

Overrides: misc.optrecurse.RecursiveOptionParser.getformathelp

run(self, argv=None)

source code 

parses the command line options and runs the conversion

Overrides: misc.optrecurse.RecursiveOptionParser.run