def addscriptpath(script):
    '\n    Add the path part of the scriptfile to the system path to\n    allow modules to be loaded from the same place.\n\n    Each path is added only once.\n    '
    pathfound = 0
    scriptpath = os.path.dirname(script)
    for pathitem in sys.path:
        if (pathitem == scriptpath):
            pathfound = 1
            break
    if (pathfound == 0):
        sys.path.append(scriptpath)
Add the path part of the scriptfile to the system path to
allow modules to be loaded from the same place.

Each path is added only once.
def addscriptpath(script):
    '\n    Add the path part of the scriptfile to the system path to\n    allow modules to be loaded from the same place.\n\n    Each path is added only once.\n    '
    pathfound = 0
    scriptpath = os.path.dirname(script)
    for pathitem in sys.path:
        if (pathitem == scriptpath):
            pathfound = 1
            break
    if (pathfound == 0):
        sys.path.append(scriptpath)