Decorator to add the decorated function to the dictionary of refreshers. Any function decorated with a @refresher will be executed as part of the completion refresh routine.
(name: str, refreshers: dict = CompletionRefresher.refreshers)
| 101 | |
| 102 | |
| 103 | def refresher(name: str, refreshers: dict = CompletionRefresher.refreshers) -> Callable: |
| 104 | """Decorator to add the decorated function to the dictionary of |
| 105 | refreshers. Any function decorated with a @refresher will be executed as |
| 106 | part of the completion refresh routine.""" |
| 107 | |
| 108 | def wrapper(wrapped): |
| 109 | refreshers[name] = wrapped |
| 110 | return wrapped |
| 111 | |
| 112 | return wrapper |
| 113 | |
| 114 | |
| 115 | @refresher("databases") |