boss.helper - heros-boss 0.3.5 documentation

Skip to content
Back to top
View this page

# boss.helper

## Attributes

`log` |

## Functions

`get_module`(path[, relative_path]) |
`get_class_by_name`(name[, relative_path]) | Resolve class by name
`file_from_url`(→ io.IOBase) | Load content from a file specified by a URL.
`extend_none_allowed_list`(→ list | None) | Extend a list with another list which both can be None.

## Module Contents

boss.helper.log

boss.helper.get_module(path, relative_path=None)

boss.helper.get_class_by_name(name, relative_path=None)

  Resolve class by name

  Parameters:

    name – (str) “%s.%s” % (module.name, class.name)

  Returns:

    (class)

boss.helper.file_from_url(url: str) → io.IOBase

  Load content from a file specified by a URL.

  This can be every type of URL supported by pythons urllib (e.g. http://, file://, etc ). Giving the basic auth credentials in the URL in the form http://user:password@hostname:port/path is supported.

  Returns:

    file handle on the file

boss.helper.extend_none_allowed_list(list1: list | None, list2: list | None) → list | None

  Extend a list with another list which both can be None.

  If one of the lists is None, the other list is returned. If both lists are None, None is returned.

  Parameters:

    - list1 – list to extend

    - list2 – list to extend with