Skip to content

Resource Manager

start

start()

The entry point of the helper function, which allows jpsrm to be called from the command line.

Usage

jpsrm install [--jar JARFILE]

jpsrm uninstall

jpsrm list

jpsrm clean

Options

-j, --jar: Name of the main jar file. If not provided, the first found jar file in the resource directory will be used.

Source code in JPS_BASE_LIB/python_wrapper/twa/resRegistry/resManager.py
def start():
    """ The entry point of the helper function, which allows `jpsrm` to be called from the command line.

    Usage:
        jpsrm install <resource> <from> [--jar JARFILE]

        jpsrm uninstall <resource>

        jpsrm list

        jpsrm clean

    Options:
        -j, --jar: Name of the main jar file. If not provided, the first
            found jar file in the resource directory will be used.
    """
    devinstall = False
    try:
        args = docopt(doc)
    except DocoptExit:
        if len(sys.argv)==2:
            if sys.argv[1]=='devinstall':
                devinstall = True
        if not devinstall:
            raise DocoptExit('Error: jpsrm called with wrong arguments.')

    if devinstall:
        _doDevinstall()
    else:
        if args['install']:
            resReg.addResToReg(resName=args['<resource>'], resLoc=args['<from>'], resMainJarFile=args['JARFILE'])
        elif args['uninstall']:
            resReg.removeResFromReg(resName=args['<resource>'])
        elif args['list']:
            resReg.listRes()
        elif args['clean']:
            resReg.cleanReg()