-
Notifications
You must be signed in to change notification settings - Fork 2
/
examples.py
56 lines (42 loc) · 1.15 KB
/
examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python3
from duetwebapi import DuetWebAPI as DWA
import json
###################################
# Create API link
###################################
riley = DWA('http://riley')
bruce = DWA('http://bruce')
###################################
# REST API methods
###################################
riley.get_model()
bruce.get_model()
riley.send_code('M115')
bruce.send_code('M115')
with open('test.gcode', 'r') as f:
riley.upload_file(f, 'test.gcode')
bruce.upload_file(f, 'test.gcode')
riley.get_file('test.gcode')
bruce.get_file('test.gcode')
riley.move_file('gcodes/test.gcode', 'gcodes/test2.gcode')
# bruce.move_file('gcodes/test.gcode', 'gcodes/test2.gcode')
riley.delete_file('test2.gcode')
bruce.delete_file('test2.gcode')
riley.get_directory('gcodes')
bruce.get_directory('gcodes')
###################################
# Wrapper methods
###################################
riley.get_coords()
bruce.get_coords()
riley.get_layer()
bruce.get_layer()
riley.get_num_extruders()
bruce.get_num_extruders()
riley.get_num_tools()
bruce.get_num_tools()
riley.get_status()
bruce.get_status()
riley.get_temperatures()
bruce.get_temperatures()
pass