(lock=True, web_port=None, message_port=None, console=True, server_secret=None)
Put a lock on the main script to stop more than one instance running.
Put a lock on the main script to stop more than one instance running.
Put a lock on the main script to stop more than one instance running .
def track(lock=True, web_port=None, message_port=None, console=True, server_secret=None):
    """Put a lock on the main script to stop more than one instance running."""

    #Attempt to run the tracking script, with or without a lock
    error = None
    if lock:
        with Lock() as locked:
            if locked:
                error, web_port = _track(web_port=web_port, message_port=message_port, server_secret=server_secret)
            else:
                handle_error(LANGUAGE.strings['Tracking']['ScriptDuplicate'], log=False, console=console)
    else:
        error, web_port = _track(web_port=web_port, message_port=message_port, server_secret=server_secret)

    if error:
        if web_port is not None:
            shutdown_server(web_port)
        handle_error(error, console=console)
def track ( lock = True , web_port = None , message_port = None , console = True , server_secret = None ) : #Attempt to run the tracking script, with or without a lock error = None if lock : with Lock ( ) as locked : if locked : error , web_port = _track ( web_port = web_port , message_port = message_port , server_secret = server_secret ) else : handle_error ( LANGUAGE . strings [ 'Tracking' ] [ 'ScriptDuplicate' ] , log = False , console = console ) else : error , web_port = _track ( web_port = web_port , message_port = message_port , server_secret = server_secret ) if error : if web_port is not None : shutdown_server ( web_port ) handle_error ( error , console = console )