|
ifw-core
5.0.0-pre2
|
Classes | |
| class | ConstantRegistry |
| Class to handle conversion between state names and the corresponding numerical representation. More... | |
| class | StopWatch |
| Stopwatch class. More... | |
Functions | |
| def | exec_cmd (cmd) |
| Execute a command and return tuple with (<exit code>, <stdout>, <stderr>). More... | |
| def | get_location (level=-3) |
| Get location of the current position in a source file of the Python interpreter. More... | |
| def | get_module () |
| Get the name of the current module. More... | |
| def | get_ip_address () |
| Return IP address of execution node. More... | |
| def | get_iso_time () |
| Return ISO8601 time for the time at the invocation. More... | |
| def | gen_iso_time (secs_since_epoch) |
| Generate ISO8601 timestamp from the seconds since epoch given. More... | |
| def | debug (msg) |
| Print a debug log to stdout. More... | |
| def | revert_dic (dic) |
| Revert a dictionary (making the values to keys and vice versa). More... | |
| def | key_in_dic (dic, key) |
| Return True if the given key is in the dictionary. More... | |
| def | resolve_path (path) |
| Resolve the given path. More... | |
| def | find_file (filename, root_dirs=["INTROOT", "CFGPATH", "DATAROOT"], resource_dirs=["config", "audio", "image", "model", "dictionary", "data"], exception=True) |
| Search for a file with the given name in the locations specified. More... | |
| def | remove_file (filename) |
| Remove a file. More... | |
| def | concat_elements (elements_list, concat_char=".") |
| Concat the elements in the list, applying the "concat_char" as separator. More... | |
| def | rand_dbl (lower_limit, upper_limit) |
| Generate a random number in the given interval. More... | |
| def | gen_cwd (module_path, test_dir) |
| Generate the complete path based on the module name and the relative path in relation to the project root. More... | |
| def utils.utils.concat_elements | ( | elements_list, | |
concat_char = "." |
|||
| ) |
Concat the elements in the list, applying the "concat_char" as separator.
| def utils.utils.debug | ( | msg | ) |
Print a debug log to stdout.
| def utils.utils.exec_cmd | ( | cmd | ) |
Execute a command and return tuple with (<exit code>, <stdout>, <stderr>).
| def utils.utils.find_file | ( | filename, | |
root_dirs = ["INTROOT", "CFGPATH", "DATAROOT"], |
|||
resource_dirs = ["config", "audio", "image", "model", "dictionary", "data"], |
|||
exception = True |
|||
| ) |
Search for a file with the given name in the locations specified.
First occurrence of the file is returned.
| def utils.utils.gen_cwd | ( | module_path, | |
| test_dir | |||
| ) |
Generate the complete path based on the module name and the relative path in relation to the project root.
| def utils.utils.gen_iso_time | ( | secs_since_epoch | ) |
Generate ISO8601 timestamp from the seconds since epoch given.
| def utils.utils.get_ip_address | ( | ) |
Return IP address of execution node.
| def utils.utils.get_iso_time | ( | ) |
Return ISO8601 time for the time at the invocation.
| def utils.utils.get_location | ( | level = -3 | ) |
Get location of the current position in a source file of the Python interpreter.
level Level in the stack to use as location (integer).
Returns Location in the format: '<mod>:<method>:<ln no>' (string).
| def utils.utils.get_module | ( | ) |
Get the name of the current module.
| def utils.utils.key_in_dic | ( | dic, | |
| key | |||
| ) |
Return True if the given key is in the dictionary.
| def utils.utils.rand_dbl | ( | lower_limit, | |
| upper_limit | |||
| ) |
Generate a random number in the given interval.
| def utils.utils.remove_file | ( | filename | ) |
Remove a file.
Ignore silently if the file doesn't exist.
| def utils.utils.resolve_path | ( | path | ) |
Resolve the given path.
| def utils.utils.revert_dic | ( | dic | ) |
Revert a dictionary (making the values to keys and vice versa).