from fabric import task, Connection
from invoke.tasks import call
# r represents raspberry pi
name_ip_mapping = {"r1": "192.168.122.3", "r2": "192.168.122.2",
"r3": "192.168.122.7", "camera": "192.168.122.55"}
ip_name_mapping = {v: k for k, v in name_ip_mapping.items()}
@
taskdef scp1(c):
"""
copy scripts to raspberry pi 1
"""
c = Connection(name_ip_mapping["r1"], user='pi', connect_kwargs={'password': 'xxxx'})
c.put('r1/
main.py', "r1")
c.put('r1/
config.py', "r1")
c.put('r1/
part.py', "r1")
c.put('r1/
logger.py', "r1")