Special Functions

Special functions are globally available functions available throughout the life of an integration.

create_file_lock

create_file_lock(lock_id, timeout: int) -> FileLock

Please refer to the python package filelock for more information regarding FileLock. Lock_id is the reference path to the file desired to create a lock on.

create_file_lock('my_file')

calladapter

calladapter(system: str, service_name: str, label: str, payload: Any, sub_requests: Any) -> AdapterResponse

Makes a call to a configured adapter from within the current integration process.

x = calladapter("ECHO", "N/A", label="Internal adapter call", payload="x")

if x.response.success == True:
    historize("call_successful")

import_helper

Imports the specified helper function. Please see the Helper Functions for further information on the specific helpers. This imports the helper function to the namespace for the integration, allowing access to the helper in every subsequent hook.

import_helper("ncino")
ncino.autobooking.fire_callback()

list_files

list_files() -> List[str]

Returns a list of str GlyueFile names for the currently running .

filenames = list_files()
debug(filenames, "available files")

# can write to GlyueFiles
for name in filenames:
    with open_glyuefile(name, "a") as file:
        file.write("new line\n")

Last updated