Files
smargopolo/REST_scripting/sequence.py
2021-02-09 00:58:46 +01:00

59 lines
1.8 KiB
Python
Executable File

#!/usr/bin/env python3
# requests is an easy to use library to send HTTP request, and hence to send
# requests to a RESTful API.
import requests
import time
smargopolo_server = 'http://smargopolo:3000'
response = requests.put(smargopolo_server+'/targetSCS?SHX=0&SHY=0')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=1&SHY=0')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=1&SHY=1')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=-1&SHY=1')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=-1&SHY=-1')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=0&SHY=-1')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=0&SHY=0')
time.sleep(0.5)
url = smargopolo_server + '/targetSCS?CHI=0'
response = requests.put(url)
time.sleep(1)
url = smargopolo_server + '/targetSCS?CHI=20'
response = requests.put(url)
time.sleep(2)
url = smargopolo_server + '/targetSCS?CHI=0'
response = requests.put(url)
time.sleep(2)
url = smargopolo_server + '/targetSCS?CHI=45'
response = requests.put(url)
time.sleep(3)
response = requests.put(smargopolo_server+'/targetSCS?SHX=0&SHY=0')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=1&SHY=0')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=1&SHY=1')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=-1&SHY=1')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=-1&SHY=-1')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=0&SHY=-1')
time.sleep(0.5)
response = requests.put(smargopolo_server+'/targetSCS?SHX=0&SHY=0')
time.sleep(0.5)
url = smargopolo_server + '/targetSCS?CHI=0'
response = requests.put(url)