class documentation

class Options: (source)

View In Hierarchy

Encapsulation of the configuration options.

Class Method create Create options from kwargs.
Method __init__ Parse and encapsulate the configuration options.
Method __repr__ Undocumented
Method as_dict Undocumented
Method set_feature_flags Undocumented
Method tweak Undocumented
Constant _HAS_DYNAMIC_ATTRIBUTES Undocumented
@classmethod
def create(cls, input_filename=None, **kwargs): (source)

Create options from kwargs.

@overload
def __init__(self, argv_or_options: List[str], command_line: Literal[True]):
@overload
def __init__(self, argv_or_options: argparse.Namespace, command_line: Literal[False] = ...):
(source)

Parse and encapsulate the configuration options. Also sets up some basic logger configuration. IMPORTANT: If creating an Options object from code, do not construct it directly! Call Options.create() instead. Args: argv_or_options: Either sys.argv[1:] (sys.argv[0] is the main script), or already parsed options object returned by ArgumentParser.parse_args. command_line: Set this to true when argv_or_options == sys.argv[1:]. Raises: sys.exit(2): bad option or input filenames.

def __repr__(self): (source)

Undocumented

def as_dict(self): (source)

Undocumented

def set_feature_flags(self, flags): (source)

Undocumented

def tweak(self, **kwargs): (source)

Undocumented

_HAS_DYNAMIC_ATTRIBUTES: bool = (source)

Undocumented

Value
True