Implemented main basically
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
14
single_ursim_control/program_loader.py
Normal file
14
single_ursim_control/program_loader.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from program_schema import ProgramSchema, SUPPORTED_PROGRAM_STRUCTURE_VERSION
|
||||
import requests
|
||||
|
||||
|
||||
def load_program(url: str) -> dict:
|
||||
headers = {
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
r = requests.get(url, headers=headers)
|
||||
r.raise_for_status()
|
||||
|
||||
program_schema = ProgramSchema(many=False)
|
||||
|
||||
return program_schema.load(r.json()) # Might raise marshmallow exceptions
|
||||
Reference in New Issue
Block a user