4Suite API Documentation

Module Ft.Lib.CommandLine.Options

Classes that support advanced option processing for command-line scripts

Copyright 2004 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
Classes:
Functions:
Fields:

Classes

class BaseOption
An option that is available to be used in an invocation of a command-line script, plus related functions.

Methods

__str__(self)
apply_options(self, options)
getForGetOpt(self, short2long, takes_arg)
getName(self)
isApplied(self)
validate(self)

Fields

multiple = False

class ExclusiveOptions(BaseOption)

Methods

__init__(self, choices)
apply_options(self, options)
getForGetOpt(self, short2long, takes_arg)
getName(self)
isApplied(self)
validate(self)

Methods inherited from class BaseOption

Fields


class Option(BaseOption)

Methods

__init__(self, shortName, longName, description, subOptions=None, multiple=False)
apply_options(self, options)
getForGetOpt(self, short2long, takes_arg)
getName(self)
isApplied(self)
validate(self)

Methods inherited from class BaseOption

Fields


class Options(__builtin__.list)
A set of options that are available to be used in an invocation of a command-line script, plus related functions.

Methods

__init__(self, options=None)
findMaxOption(self, level=0)
generate_help(self, level=1, max_opt=0)
Generate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object.

Methods inherited from class __builtin__.list

__add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __hash__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __rmul__, __setitem__, __setslice__, append, count, extend, index, insert, pop, remove, reverse, sort

Methods inherited from class __builtin__.object

__delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

Fields

__dict__ = <attribute '__dict__' of 'Options' objects>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Options' objects>
list of weak references to the object (if defined)

Fields


class TypedOption(Option)

Methods

__init__(self, shortName, longName, description, allowed, subOptions=None)
apply_options(self, options)
validate(self)

Methods inherited from class Option

Methods inherited from class BaseOption

Fields

Functions

wrap_text(text, width)
wrap_text(text : string, width : int) -> [string]

Split 'text' into multiple lines of no more than 'width' characters
each, and return the list of strings that results.

Fields