Next / Previous / Contents / TCC Help System / NM Tech homepage

7. Manifest constants

These names are constants used inside and outside the module.

logscan.py
#================================================================
# Manifest constants
#----------------------------------------------------------------

7.1. DEFAULT_PREFIX

Default prefix for the Log class.

logscan.py
DEFAULT_PREFIX = "*** "

7.2. ERROR_KIND

The code for error messages.

logscan.py
ERROR_KIND = "Error"

7.3. WARNING_KIND

The code for warning messages.

logscan.py
WARNING_KIND = "Warning"

7.4. WHITE_PATTERN

A compiled regular expression that matches zero or more whitespace characters.

logscan.py
WHITE_PATTERN = re.compile ( r'\s*' )

7.5. INT_PATTERN

A regular expression that matches valid integers.

logscan.py
INT_REGEX = (
    r'\s*'            # Ignore leading whitespace
    r'([\-+]?\s*)'    # Optional sign and following whitespace
    r'\d+' )          # One or more digits left of decimal
INT_PATTERN = re.compile ( INT_REGEX )

7.6. FLOAT_PATTERN

A regular expression that matches valid floats.

logscan.py
FLOAT_REGEX = (INT_REGEX +
    r'('              # Start optional fraction group
      r'\.'             # Decimal point
      r'\d*'            # Zero or more digits after it
    r')?' )           # Whole group is optional
FLOAT_PATTERN = re.compile ( FLOAT_REGEX )