MCPcopy
hub / github.com/certbot/certbot / list_hooks

Function list_hooks

certbot/src/certbot/_internal/hooks.py:266–277  ·  view source on GitHub ↗

List paths to all hooks found in dir_path in sorted order. :param str dir_path: directory to search :returns: `list` of `str` :rtype: sorted list of absolute paths to executables in dir_path

(dir_path: str)

Source from the content-addressed store, hash-verified

264
265
266def list_hooks(dir_path: str) -> list[str]:
267 """List paths to all hooks found in dir_path in sorted order.
268
269 :param str dir_path: directory to search
270
271 :returns: `list` of `str`
272 :rtype: sorted list of absolute paths to executables in dir_path
273
274 """
275 allpaths = (os.path.join(dir_path, f) for f in os.listdir(dir_path))
276 hooks = [path for path in allpaths if filesystem.is_executable(path) and not path.endswith('~')]
277 return sorted(hooks)

Callers 4

_callMethod · 0.90
pre_hookFunction · 0.85
post_hookFunction · 0.85
deploy_hookFunction · 0.85

Calls

no outgoing calls

Tested by 1

_callMethod · 0.72