Package yagdoc :: Module tool
[show private | hide private]
[frames | no frames]

Module yagdoc.tool

Yagdoc command line tool helper.
Function Summary
  fatal(message, **kwargs)
Print a fatal error, prefixed with FATAL: and terminate the program.
  get_from_config(*variables)
OptionParser get_option_parser()
Create an optparse option parser.
  info(message, **kwargs)
Print an informational message, prefixed with tool-name:.
OptionParser init(self, **variables)
Initialize tool.
  swallow_config()
Import yagdoc_config.py as config.
  warning(message)
Print a warning, unprefixed, meant for gcc-style error messages referring to source files.
  _message(message, prefix, kwargs)
  _set_data_dir()

Variable Summary
str config_dir: The directory of to yagdoc_config.py.
str data_dir: Data directory where xhtml.xsl and other files are located.
str help_usage: Command line help usage string (empty by default).
int log_level: The highest level of log messages to print (higher means more messages).
str name: Name of the current tool.

Function Details

fatal(message, **kwargs)

Print a fatal error, prefixed with FATAL: and terminate the program.

Program is terminated with error code 1.

New-line ('\n') is appended to the message if it does not end with a new-line.

get_option_parser()

Create an optparse option parser.

Usage and version are initialized according to yagdoc version and name.

Normally not called explicitly.
Returns:
A new option parser for the current tool.
           (type=OptionParser)

info(message, **kwargs)

Print an informational message, prefixed with tool-name:.

New-line ('\n') is appended to the message if it does not end with a new-line.

init(self=None, **variables)

Initialize tool.
Parameters:
variables - Names to bind globally in this module. Passing foo=bar is completely equivalent to tool.foo=bar.
Returns:
A new option parser for the tool name.
           (type=OptionParser)

swallow_config()

Import yagdoc_config.py as config.

The current directory is temporarily made the first sys.path item and removed again after the import.

Normally not called explicitly.

warning(message)

Print a warning, unprefixed, meant for gcc-style error messages referring to source files.

New-line ('\n') is appended to the message if it does not end with a new-line.

Variable Details

config_dir

The directory of to yagdoc_config.py. The default it '.'.
Type:
str
Value:
'.'                                                                    

data_dir

Data directory where xhtml.xsl and other files are located. This is normally version.datadir but if we were relocated, it can be also a path determined from the location of this module. It is set by init.
Type:
str

help_usage

Command line help usage string (empty by default). It is directly appended to the default one, so if does not add anything to the synopsis line, it should start with '\n'.
Type:
str
Value:
''                                                                     

log_level

The highest level of log messages to print (higher means more messages). One of:
  • FATAL, only fatal messages are printed,
  • WARNING, errors and unrecognized constructs in input files are warned about,
  • INFO, informational messages about the stage the processing is in are printed.
Type:
int
Value:
2                                                                     

name

Name of the current tool. The default is the base name of sys.argv[0] with the first extension removed (if present). If a different tool name is set, it should be done before loading the config so that it sees the correct value.
Type:
str
Value:
'(imported)'                                                           

Generated by Epydoc 2.1 on Fri Oct 5 00:36:53 2007 http://epydoc.sf.net