Initial project setup including the main agent script, configuration files, profile JSON state, systemd service unit, startup script, deployment documentation, and Python dependencies. Includes .env, venv/, and __pycache__/ which should likely be excluded via .gitignore to avoid committing secrets and artifacts.
21 lines
411 B
Python
21 lines
411 B
Python
import functools
|
|
|
|
|
|
# from jaraco.functools 3.5
|
|
def pass_none(func):
|
|
"""
|
|
Wrap func so it's not called if its first param is None
|
|
|
|
>>> print_text = pass_none(print)
|
|
>>> print_text('text')
|
|
text
|
|
>>> print_text(None)
|
|
"""
|
|
|
|
@functools.wraps(func)
|
|
def wrapper(param, *args, **kwargs):
|
|
if param is not None:
|
|
return func(param, *args, **kwargs)
|
|
|
|
return wrapper
|