6.1. setuplib.__init__

Common functions and definitions.

6.1.1. Module

Setup helper library specific for the runtime environment of distutils and setuptools.

6.1.2. Functions

6.1.2.1. help_on_user_options

setuplib.__init__.help_on_user_options(uopt, uoptions, raw=False)[source]

Displays the standard option data as provided by the “distuitls” API variable ‘user_options’.

The supported format is:

user_options = [
    (<user-option-long>, <user-option-short>,  <user-option-description>),
    ...
]
Parameters
  • uopt

    User option:

    uopt := (
          <user-option-long>
        | <user-option-short>
        | #index
    )
    
    user-option-long := (
          <literal-no-args>
        | <literal-with-hyphen-no-args>  # leading '--'
        | <literal-with-args>    # trailing '='
        | <literal-with-hyphen-with-args>  # leading '--' and trailing '='
    )
    
    user-option-short := (
            <literal-no-hyphen>
          | <literal-with-hyphen>  # leading '--'
    )
    
    index := int[0, length(user_options))
        # use for development and test only,
        # production use is not recommended
    

  • uoptions – The options definition.

  • raw – If set to ‘True’, the original entry tuple is returned, else the formatted string for console display.

Results:

Return string reference to the defined help-string.

Raises
  • SetupDocXError

  • pass-through

6.1.2.2. check_for_context_help

setuplib.__init__.check_for_context_help(cmdobj, raw=False)[source]

Scans for any requested context help, if present returns either a formatted string for console display, or the reference to the raw help entry.

Parameters
  • cmdobj – The command object ‘distutils.cmd.Command’.

  • raw – If ‘True’ returns the raw entry. else a formatted string for console display.

Returns

The help entry, either raw, or as a formatted console string.

Raises

pass-through

6.1.3. Exceptions

exception setuplib.__init__.SetuplibError[source]