Bugfix: Unchanged extras must be sent to spoolman for them not to disappear Bugfix: Remove active tray from inactive spools Docs: Add note about the Base_URL
28 lines
680 B
Python
28 lines
680 B
Python
import requests
|
|
from config import SPOOLMAN_API_URL
|
|
|
|
|
|
def patchExtraTags(spool_id, old_extras, new_extras):
|
|
for key, value in new_extras.items():
|
|
old_extras[key] = value
|
|
|
|
resp = requests.patch(f"{SPOOLMAN_API_URL}/spool/{spool_id}", json={
|
|
"extra": old_extras
|
|
})
|
|
print(resp.text)
|
|
print(resp.status_code)
|
|
|
|
|
|
def getSpoolById(spool_id):
|
|
response = requests.get(f"{SPOOLMAN_API_URL}/spool/{spool_id}")
|
|
print(response.status_code)
|
|
print(response.text)
|
|
return response.json()
|
|
|
|
|
|
def fetchSpoolList():
|
|
response = requests.get(f"{SPOOLMAN_API_URL}/spool")
|
|
print(response.status_code)
|
|
print(response.text)
|
|
return response.json()
|