NRP Core  1.4.1
python_json_engine Namespace Reference

Classes

class  StandaloneApplication
 

Functions

def all_exception_handler (error)
 
def initialize ()
 
def run_loop ()
 
def set_datapack ()
 
def get_datapack ()
 
def reset ()
 
def shutdown ()
 
Namespace parse_arguments ()
 
bool is_port_in_use (str address, int port)
 
int find_free_port ()
 
tuple extract_hostname_port_from_url (str url)
 
None register_in_regserver (str regserver_url, str engine_name, str hostname, int port)
 
dict parse_extra_options (str options_str)
 
dict prepare_options (str extra_options, str hostname, int port)
 

Variables

int DEFAULT_TIMEOUT = 90
 
int DEFAULT_WORKERS = 1
 
 log = logging.getLogger("werkzeug")
 
 app = Flask(__name__)
 
Namespace args = parse_arguments()
 
 hostname
 
 port
 
dict options = prepare_options(args.options, hostname, port)
 

Function Documentation

◆ all_exception_handler()

def python_json_engine.all_exception_handler (   error)
Custom error handler for error code 500. The default handler returns a html response,
which doesn't look very nice when printed to terminal.

◆ extract_hostname_port_from_url()

tuple python_json_engine.extract_hostname_port_from_url ( str  url)

◆ find_free_port()

int python_json_engine.find_free_port ( )
Returns a random free port number

◆ get_datapack()

def python_json_engine.get_datapack ( )

◆ initialize()

def python_json_engine.initialize ( )

◆ is_port_in_use()

bool python_json_engine.is_port_in_use ( str  address,
int  port 
)
Checks if given port is already in use

◆ parse_arguments()

Namespace python_json_engine.parse_arguments ( )

◆ parse_extra_options()

dict python_json_engine.parse_extra_options ( str  options_str)
Parses the extra server options passed by the user
Expected format is a python dict: '{ "option1": value1, "option2": value2 }'

◆ prepare_options()

dict python_json_engine.prepare_options ( str  extra_options,
str  hostname,
int  port 
)
Prepares the dictionary with options for the server application

◆ register_in_regserver()

None python_json_engine.register_in_regserver ( str  regserver_url,
str  engine_name,
str  hostname,
int  port 
)
Registers in the registration server of the client

◆ reset()

def python_json_engine.reset ( )

◆ run_loop()

def python_json_engine.run_loop ( )

◆ set_datapack()

def python_json_engine.set_datapack ( )

◆ shutdown()

def python_json_engine.shutdown ( )

Variable Documentation

◆ app

python_json_engine.app = Flask(__name__)

◆ args

Namespace python_json_engine.args = parse_arguments()

◆ DEFAULT_TIMEOUT

int python_json_engine.DEFAULT_TIMEOUT = 90

◆ DEFAULT_WORKERS

int python_json_engine.DEFAULT_WORKERS = 1

◆ hostname

python_json_engine.hostname

◆ log

python_json_engine.log = logging.getLogger("werkzeug")

◆ options

dict python_json_engine.options = prepare_options(args.options, hostname, port)

◆ port

python_json_engine.port