errbot.utils module

errbot.utils.collect_roots(base_paths: List[T], file_sig: str = '*.plug') → List[T][source]

Collects all the paths from base_paths recursively that contains files of type file_sig.

Parameters:
  • base_paths – a list of base paths to walk from elements can be a string or a list/tuple of strings
  • file_sig (str) – the file pattern to look for
Returns:

a list of paths

class errbot.utils.deprecated(new=None)[source]

Bases: object

deprecated decorator. emits a warning on a call on an old method and call the new method anyway

__init__(new=None)[source]

Initialize self. See help(type(self)) for accurate signature.

errbot.utils.find_roots(path: str, file_sig: str = '*.plug') → List[T][source]

Collects all the paths from path recursively that contains files of type file_sig.

Parameters:
  • path (str) – a base path to walk from
  • file_sig (str) – the file pattern to look for
Returns:

a list of paths

errbot.utils.format_timedelta(timedelta)[source]
errbot.utils.git_clone(url: str, path: str) → None[source]

Clones a repository from git url to path

errbot.utils.git_pull(repo_path: str) → None[source]

Does a git pull on a repository

errbot.utils.git_tag_list(repo_path: str) → List[str][source]

Lists git tags on a cloned repo

errbot.utils.global_restart()[source]

Restart the current process.

errbot.utils.rate_limited(min_interval)[source]

decorator to rate limit a function.

Parameters:min_interval – minimum interval allowed between 2 consecutive calls.
Returns:the decorated function
errbot.utils.split_string_after(str_, n)[source]

Yield chunks of length n from the given string

Parameters:
  • n – length of the chunks.
  • str – the given string.
errbot.utils.version2tuple(version)[source]