Module simwbPath

Module simwbPath


Modify sys.path to match PYToolkit to the invoking interpreter.

This module provides a means to switch to the PYToolkit that was
installed for your version of Python (i.e. the one being used to run
your script).

To use the appropriate PYToolkit install, you will need to put the following
line BEFORE any of the SimWB imports, e.g.:

    try:
        import simwbPath
    except:
        pass

    import simwbClient as swb
    from simwb23Compat import *

    swb.connect('localhost')
    swb.login('admin/nimda')
    swb.projectSelect('Simulink')
    ...

After the simwbPath import, any import of a SimWB module will be from the
appropriate folder, if found, or the default folder otherwise. See the
documentation about the PYToolkit install for details of how the "default"
is determined.

This technique will only work because this module is supplied as source
(it is executed from the default installation by the invoking Python, and
this makes it compatible with all of them).

The module behavior can be modified by some booleans (you must edit the
simwbPaht.py source file to change these):

    Name     Default  Description
    ----     -------  -----------
    verbose  False    Print informational messages on stdout.
    fatal    False    Print a message on stderr and then exit.

NOTE:
    Be sure to make your changes to the "default" PYToolkit simwbPath.py
    source file (/usr/local/ccursim/python/PYToolkit or C:\Concurrent\PYToolkit).
NOTE:
    Any changes made MUST be Python 2/3 compatible if you are switching
    between them.
NOTE:
    When 'fatal' is set to True a command line 'pydoc simwbPath' or an
    interpreter 'help(simwbPath)' will fail.

Variables
  __package__ = None
  fatal = False
  verbose = False