(func)
| 203 | """ |
| 204 | |
| 205 | def wrap(func): |
| 206 | |
| 207 | @functools.wraps(func) |
| 208 | def wrapped_func(*args, **kwargs): |
| 209 | requirements = [prerequisites] if isinstance( |
| 210 | prerequisites, str) else prerequisites |
| 211 | missing = [] |
| 212 | for item in requirements: |
| 213 | if not checker(item): |
| 214 | missing.append(item) |
| 215 | if missing: |
| 216 | print(msg_tmpl.format(', '.join(missing), func.__name__)) |
| 217 | raise RuntimeError('Prerequisites not meet.') |
| 218 | else: |
| 219 | return func(*args, **kwargs) |
| 220 | |
| 221 | return wrapped_func |
| 222 | |
| 223 | return wrap |
| 224 |
nothing calls this directly
no outgoing calls
no test coverage detected