Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d0657a8eb | ||
|
|
ec04364b47 | ||
|
|
a88cd9fcfc | ||
|
|
59e4394cdd | ||
|
|
bc82a18a03 | ||
|
|
6976ac9edd | ||
|
|
2952b2622e | ||
|
|
7efdeced62 | ||
|
|
2f79d9d226 | ||
|
|
88f8077b77 | ||
|
|
696904bc49 | ||
|
|
cd578dc2e1 | ||
|
|
e15956883a | ||
|
|
3f8dde75d5 | ||
|
|
bc5044b125 | ||
|
|
c863562d12 | ||
|
|
27fb397681 | ||
|
|
eabff453cd | ||
|
|
6cd6b98c2b | ||
|
|
91ef5480b1 | ||
|
|
419f3370a2 | ||
|
|
1370c7a9cc | ||
|
|
982d121d3b | ||
|
|
67634e4f7c | ||
|
|
3d26e478e3 | ||
|
|
28de87441f | ||
|
|
688a998dd2 | ||
|
|
343631b3c6 | ||
|
|
139b2277d1 | ||
|
|
e8123a6ab1 | ||
|
|
891fd18f0e | ||
|
|
41fe997af4 | ||
|
|
6c21ee32a8 | ||
|
|
bcef804a4a | ||
|
|
39d5446789 | ||
|
|
a161feb106 | ||
|
|
8c74b9e74d | ||
|
|
bc0880711b | ||
|
|
e038cfa4dc | ||
|
|
e700891dba | ||
|
|
080a6e9ccd | ||
|
|
3a13dd9022 | ||
|
|
3d959c1d5f | ||
|
|
354042b84d | ||
|
|
26fb208f48 | ||
|
|
2fc86e095f | ||
|
|
0167015b46 | ||
|
|
8b99c89acf | ||
|
|
0bb6f5215d | ||
|
|
079430e3c8 | ||
|
|
7efa311b04 | ||
|
|
c6d9575127 | ||
|
|
bbe6e44d44 | ||
|
|
53b74f9caa | ||
|
|
a7bd770180 | ||
|
|
2b22d26eac | ||
|
|
13728c231c | ||
|
|
209a88bd6a | ||
|
|
2256a1e825 | ||
|
|
122ec39728 | ||
|
|
d4428de9a0 | ||
|
|
536d46f15d | ||
|
|
62d5f04373 | ||
|
|
b48af7133e | ||
|
|
9a9502b281 | ||
|
|
9d9eb3390d | ||
|
|
ce28b637ab | ||
|
|
21b7339187 | ||
|
|
df1a97b0e1 | ||
|
|
66da377b64 | ||
|
|
34e5b5d50f | ||
|
|
882cf3a142 | ||
|
|
d9a4ff47b6 | ||
|
|
d538b3fd38 | ||
|
|
f8386649bf | ||
|
|
b5bc03e711 | ||
|
|
0a78c92407 | ||
|
|
60c46a3fc4 | ||
|
|
8782f77577 | ||
|
|
08f9529c6d | ||
|
|
6499bd160f | ||
|
|
599098a589 | ||
|
|
aa57277ff8 | ||
|
|
74a94469b6 | ||
|
|
217e54d81c | ||
|
|
b05beb27b5 | ||
|
|
d81ec15f43 | ||
|
|
39372a9475 | ||
|
|
e8cac14c2f | ||
|
|
5bef0926a6 | ||
|
|
7772fdc7bf | ||
|
|
cd736c44df | ||
|
|
11bdc176a0 | ||
|
|
fe97a8d6bd | ||
|
|
afdb98a92f | ||
|
|
7b48270239 | ||
|
|
90340487f7 | ||
|
|
1f19fd1e1d | ||
|
|
9b13eb8a6c | ||
|
|
444a36d0f0 | ||
|
|
7c5cc8d256 | ||
|
|
e76a3ea54f | ||
|
|
14969e5508 | ||
|
|
f671006582 | ||
|
|
bd352f4658 | ||
|
|
046536dd70 | ||
|
|
f9cb29ac91 | ||
|
|
fad2e8f1b8 | ||
|
|
f2ecb96c83 | ||
|
|
0a81e8b161 | ||
|
|
eb822c83a3 | ||
|
|
ec8427cbb8 | ||
|
|
3585eb05a2 | ||
|
|
1fd776153c | ||
|
|
75012472a2 | ||
|
|
55d5df7f14 | ||
|
|
6e73c31a68 | ||
|
|
d7ae147764 | ||
|
|
9eb1485e84 | ||
|
|
4f11f6362b | ||
|
|
4f1a55c2df | ||
|
|
cfc5f45aa5 | ||
|
|
2f26104b98 | ||
|
|
b5e19f0676 | ||
|
|
3614033b0d | ||
|
|
44ec821294 | ||
|
|
c6225aa834 | ||
|
|
5d21399a73 | ||
|
|
d61371a495 | ||
|
|
92f9ed465e | ||
|
|
0a8a7ba589 | ||
|
|
bfcd00e466 | ||
|
|
20fc7f25bc | ||
|
|
297c434d64 | ||
|
|
1e7ea28195 | ||
|
|
937487037a | ||
|
|
2cc9631791 | ||
|
|
2b9aef5874 | ||
|
|
0fec3aeca9 | ||
|
|
12fcfda481 | ||
|
|
58ee5f17f7 | ||
|
|
a7fe2d5148 | ||
|
|
d96a91ecc3 | ||
|
|
924d5c8d7d | ||
|
|
5126fc1093 | ||
|
|
162c4f11dd | ||
|
|
240fe70902 | ||
|
|
bef989961d | ||
|
|
eeaf68d61a | ||
|
|
674d625150 | ||
|
|
bfecb5fadf | ||
|
|
5eefee3a4d | ||
|
|
02b0e906f1 | ||
|
|
3069e05766 | ||
|
|
8c80e3ac4a | ||
|
|
79d660f377 | ||
|
|
2ae2405792 | ||
|
|
6e42e3e0ef | ||
|
|
ad3ae405f6 | ||
|
|
93b247b088 | ||
|
|
6018bf8428 | ||
|
|
a49bc9ca75 | ||
|
|
cdbc8fcfbd | ||
|
|
e453201c1a | ||
|
|
ec97765c80 | ||
|
|
be34f7309d | ||
|
|
dbf1273e9d | ||
|
|
944775abde | ||
|
|
e7c21b1978 | ||
|
|
73a85646c5 | ||
|
|
0376bc4235 | ||
|
|
c70708e915 | ||
|
|
01c5b77f7b | ||
|
|
cb2e0d449f | ||
|
|
6c20e58529 | ||
|
|
611c1ccf4a | ||
|
|
397f762182 | ||
|
|
ad201b040d | ||
|
|
0274b0f25b | ||
|
|
0bb467e884 | ||
|
|
be711dd691 | ||
|
|
685ce16c85 | ||
|
|
885b48911e | ||
|
|
d7ef60b4d2 | ||
|
|
63cec660ca | ||
|
|
4c34cb84c7 | ||
|
|
d3d4d4e407 | ||
|
|
e9f80c6616 | ||
|
|
5006b019af | ||
|
|
4f3e4f7f38 | ||
|
|
a0697f8bad | ||
|
|
2833372603 | ||
|
|
8ce1eafd5d | ||
|
|
21a4033f73 | ||
|
|
51a1953d99 | ||
|
|
30b6211157 | ||
|
|
36ec9c4741 | ||
|
|
1581ebbead | ||
|
|
436ebd7c18 | ||
|
|
801d60388a | ||
|
|
821fa4299b | ||
|
|
b018a56e4c | ||
|
|
b1e75a1033 | ||
|
|
86fbbefb6e | ||
|
|
2c0fa7c1d1 | ||
|
|
8263c6072a | ||
|
|
91b5fc6b0d | ||
|
|
1225a2501d | ||
|
|
34c068b964 | ||
|
|
e79703ba6e | ||
|
|
fb1fd37482 | ||
|
|
4830d60269 | ||
|
|
76959e06c9 | ||
|
|
5a8c3654c4 | ||
|
|
a9756c4c36 | ||
|
|
9919de9a6c | ||
|
|
5091099f83 | ||
|
|
7c6b9eac48 | ||
|
|
7a8e6b6b6d | ||
|
|
50ae34dc4f | ||
|
|
cbb692de30 | ||
|
|
cc7dcbf6b6 | ||
|
|
8f621eca43 | ||
|
|
9e73f1563d | ||
|
|
3a570f8ab0 | ||
|
|
62aee50701 | ||
|
|
789e9922d1 | ||
|
|
58fc67bd99 | ||
|
|
d322c365ce | ||
|
|
652158d17a | ||
|
|
73d981ed6b | ||
|
|
8e98e9c40c | ||
|
|
119f727c8d | ||
|
|
5e6a7ef605 | ||
|
|
a319e8c497 | ||
|
|
3cc1c012bb | ||
|
|
e0b888b2d0 | ||
|
|
f050b4e5cb | ||
|
|
5a3e9e7aba | ||
|
|
8f0b7dd6d1 | ||
|
|
183ca3291b | ||
|
|
b54e1b44a4 | ||
|
|
1a4c06d6f6 | ||
|
|
a229cbfd49 | ||
|
|
692166f067 | ||
|
|
69dca5b58c | ||
|
|
6305c4d2eb | ||
|
|
b5cf20a1de | ||
|
|
5807b606f0 | ||
|
|
398eaf58a9 | ||
|
|
4a933228c7 | ||
|
|
56caa7750c | ||
|
|
38a47bb2a8 | ||
|
|
e6f9003549 | ||
|
|
5cadf85401 | ||
|
|
baab1ce70a | ||
|
|
cbaf848711 | ||
|
|
85060b972a | ||
|
|
29aefdec08 | ||
|
|
6e01a361c5 | ||
|
|
542ccb5421 | ||
|
|
6d8eb682c1 | ||
|
|
d701c261c3 | ||
|
|
7b16f38ba3 | ||
|
|
337329eda0 | ||
|
|
47b7552f91 | ||
|
|
6736224962 | ||
|
|
c9009496f6 | ||
|
|
d393a6730c | ||
|
|
069bfdd9f8 | ||
|
|
23d2cdec76 | ||
|
|
1a308a1bc7 | ||
|
|
13098dde00 | ||
|
|
27d1a6ca37 | ||
|
|
1616fb4de8 | ||
|
|
07d8d4b88d | ||
|
|
2a3d9c291d | ||
|
|
b36290a1f2 | ||
|
|
48d74ef2fd | ||
|
|
35e20162ec | ||
|
|
c82ec3d3af | ||
|
|
5c06bd5036 | ||
|
|
21034b381c | ||
|
|
beb5850361 | ||
|
|
1ea0cf9213 | ||
|
|
4081a25f48 | ||
|
|
718a102d44 | ||
|
|
49f4a0c5b0 | ||
|
|
d267a752cd | ||
|
|
632724a023 | ||
|
|
eb48a50139 | ||
|
|
0a3dc4b354 | ||
|
|
fe134e7986 | ||
|
|
b5f40cfd69 | ||
|
|
3fb9248d2a | ||
|
|
3dd0ace076 | ||
|
|
abe68adac8 | ||
|
|
99c65b8cf4 | ||
|
|
742818c2ca | ||
|
|
d4072a3afd | ||
|
|
92c65cb21c | ||
|
|
d20a9f64a2 | ||
|
|
ed82488c5b | ||
|
|
5955d3d32e | ||
|
|
682c3dd8e3 | ||
|
|
56f2dc9d8e | ||
|
|
71941f337d | ||
|
|
b347e96748 | ||
|
|
8069d08d3b | ||
|
|
4b7552e56e | ||
|
|
c4a1ed2590 | ||
|
|
e443c7df2f | ||
|
|
b9372d7300 | ||
|
|
9e8b5312d5 | ||
|
|
f79d496c7c | ||
|
|
73a587b3e4 | ||
|
|
fac4aad05f | ||
|
|
c53c263805 | ||
|
|
4e31ccf4c5 | ||
|
|
c4e2a8982f | ||
|
|
42dafd7565 | ||
|
|
6ce82ceb00 | ||
|
|
6583691e85 | ||
|
|
2f44f10eb0 | ||
|
|
0e817d43cc | ||
|
|
7f1394a8d6 | ||
|
|
caaf1d229c | ||
|
|
36ae6dd6b9 | ||
|
|
bcd7bb4d20 | ||
|
|
8151e617cc | ||
|
|
1e429606e1 | ||
|
|
7fbfaadc21 | ||
|
|
814355e281 | ||
|
|
c720cc3a4a | ||
|
|
660de61997 | ||
|
|
f4b3206d49 | ||
|
|
4abfa6c3b3 | ||
|
|
2a059cf0cb | ||
|
|
7743372ee4 | ||
|
|
59027d349f | ||
|
|
9fd8b09e34 | ||
|
|
450e24bbc2 | ||
|
|
c020c7afe0 | ||
|
|
0d7965ebf1 | ||
|
|
34ceb93509 | ||
|
|
c120261e2b | ||
|
|
f0acacec6a | ||
|
|
9fbe130169 | ||
|
|
b96d1b51e0 | ||
|
|
570c66b6f3 | ||
|
|
ccd2ddc056 | ||
|
|
54f24b43f0 | ||
|
|
eae68f04ca | ||
|
|
7fcd04ae61 | ||
|
|
1a4920fc36 | ||
|
|
8149a3b4a8 | ||
|
|
e8bd29ef99 | ||
|
|
8a7d234571 | ||
|
|
c5c5383e0e | ||
|
|
b4d25db9c8 | ||
|
|
ef876cfd35 | ||
|
|
547dcdd725 | ||
|
|
dedadbc9ac | ||
|
|
cda399f11a | ||
|
|
ec42c45204 | ||
|
|
c98d3d1655 | ||
|
|
5e96bd8b6a | ||
|
|
2b4a985d85 | ||
|
|
56a51a3800 | ||
|
|
0982c8cc62 | ||
|
|
682e78c256 | ||
|
|
d90a9e7fc4 | ||
|
|
9d6b6cf103 | ||
|
|
bad88da2fe | ||
|
|
090671a044 | ||
|
|
1e9ea8e85e | ||
|
|
c5bc000b56 | ||
|
|
42d288c0e2 | ||
|
|
935c1da30f | ||
|
|
c0774d0dd8 | ||
|
|
612005c4f6 | ||
|
|
ee1f9029d1 | ||
|
|
1d8cf86215 | ||
|
|
fbc0b8af91 | ||
|
|
b8283b2499 | ||
|
|
da0f1fa3c8 | ||
|
|
0d18ca421b | ||
|
|
48dd2657e9 | ||
|
|
62f2d11f8b | ||
|
|
93bbedae86 | ||
|
|
40fe74ef45 | ||
|
|
043b213a96 | ||
|
|
63d095ab00 | ||
|
|
6db57122b4 | ||
|
|
c595d02f22 | ||
|
|
2e23cd39a4 | ||
|
|
3de4f91f50 | ||
|
|
6473937b75 | ||
|
|
fab5fc4899 | ||
|
|
d0eca800fb | ||
|
|
a6c24e174d | ||
|
|
a52a5ca338 | ||
|
|
acc85127c5 | ||
|
|
454f16a7c3 | ||
|
|
a731f748d9 | ||
|
|
9a7bddd530 | ||
|
|
83f66e133e | ||
|
|
ab97abf13e | ||
|
|
7820c17d08 | ||
|
|
9ed79adb8d | ||
|
|
b98348de02 | ||
|
|
a5094d403a | ||
|
|
6b0dee26e5 | ||
|
|
a44eb43f0f | ||
|
|
b6a5cb47a1 | ||
|
|
65efcec008 | ||
|
|
37730616c1 | ||
|
|
a53195d2a0 | ||
|
|
084fd8d433 | ||
|
|
33306b6787 | ||
|
|
b4cb0dec87 | ||
|
|
063251fe03 | ||
|
|
9b3ef8b693 | ||
|
|
a5ce071939 | ||
|
|
e8fa2e44e0 | ||
|
|
e223341ece | ||
|
|
5c8d9007f6 | ||
|
|
91163dc4f4 | ||
|
|
2a8e084b51 | ||
|
|
ce00a069fa | ||
|
|
bdadab6993 | ||
|
|
05d6cac67a | ||
|
|
528192b3c0 | ||
|
|
729d23b2c0 | ||
|
|
2e566c5ee1 | ||
|
|
e875d042a7 | ||
|
|
f05f850175 | ||
|
|
9ce9af28c3 | ||
|
|
57bf457d97 | ||
|
|
adf39cdf21 | ||
|
|
6c622f7c43 | ||
|
|
d34790e74e | ||
|
|
aa5099340e | ||
|
|
693633bd1d | ||
|
|
758062133c | ||
|
|
c55fea666d | ||
|
|
c932e496fa | ||
|
|
bbbdb3dde6 | ||
|
|
b9460b4890 | ||
|
|
947f4c89cc | ||
|
|
5f982ec6c8 | ||
|
|
dcf2e51b21 | ||
|
|
85e6ae8e82 | ||
|
|
859ea0d0e4 | ||
|
|
9cf21aa036 | ||
|
|
637adc3095 | ||
|
|
548f976d35 | ||
|
|
45c92cb1f4 | ||
|
|
f83d5aa89f | ||
|
|
abf073340f | ||
|
|
918ffa2557 | ||
|
|
5cc8ec5cc3 | ||
|
|
fce7b40b51 | ||
|
|
1178fe9e95 | ||
|
|
2f24e73fcb | ||
|
|
9ff5c36370 | ||
|
|
1b4ea75466 | ||
|
|
b4b5689bc4 | ||
|
|
fd4271a962 | ||
|
|
65bc28a03e | ||
|
|
c26515c13d | ||
|
|
25a4d4b79b | ||
|
|
43ca4d8252 | ||
|
|
b56ba6589c | ||
|
|
5c9b507cb7 | ||
|
|
cd7ac032f4 | ||
|
|
a2e5fc0c5c | ||
|
|
536bb31965 | ||
|
|
ef46a49430 | ||
|
|
8e28ddd6a4 | ||
|
|
ab8b0230bd | ||
|
|
754ef428a0 | ||
|
|
455474841e | ||
|
|
ae4e4f22c4 | ||
|
|
96fc70bdb2 | ||
|
|
8ed0befd62 | ||
|
|
766c0c21d4 | ||
|
|
7d50563666 | ||
|
|
4011f60ff9 | ||
|
|
37950cb466 | ||
|
|
2824b967ff | ||
|
|
7b8bf2cf5c | ||
|
|
9299cb54a4 | ||
|
|
b965d4cbde | ||
|
|
7d922f3c77 | ||
|
|
7e894d2ac2 | ||
|
|
948e20b269 | ||
|
|
0e863ad776 | ||
|
|
13d7d5f2f6 | ||
|
|
ac8faf7910 | ||
|
|
bf049ddee4 | ||
|
|
e435d55cb1 | ||
|
|
2c50237699 | ||
|
|
93763a5563 | ||
|
|
7a74f5348d | ||
|
|
b25c2220d1 | ||
|
|
57161dd9c3 | ||
|
|
1343a4a253 | ||
|
|
6de7eabca2 | ||
|
|
2247f30c87 | ||
|
|
ba6a6723a6 | ||
|
|
f9a0cb94f7 | ||
|
|
e689a2c733 | ||
|
|
d07c81f312 | ||
|
|
32f4f8d95b | ||
|
|
7f2e0161a8 | ||
|
|
59993bfca4 | ||
|
|
0782dda20f | ||
|
|
8c1a79558b | ||
|
|
0705a7054c | ||
|
|
54bd7766b9 | ||
|
|
ed215fc5fa | ||
|
|
5f53b704dd | ||
|
|
e8ef0ba8a4 | ||
|
|
49f62bc655 | ||
|
|
0ff43def3a | ||
|
|
cc14b77487 | ||
|
|
7f10c317f1 | ||
|
|
ba1f8c58b4 | ||
|
|
273bb45741 | ||
|
|
e33f69917f | ||
|
|
4b8bdd244e | ||
|
|
202f93426a | ||
|
|
c538604cd5 | ||
|
|
0c44762f6f | ||
|
|
6df57bc1d1 | ||
|
|
e328695100 | ||
|
|
738c699a6e | ||
|
|
8a28220e63 | ||
|
|
5808c1bd8a | ||
|
|
8bbb642a56 | ||
|
|
1f0dbf8f7f | ||
|
|
9a6099ffc2 | ||
|
|
25de95dc93 | ||
|
|
57f6e1e1bc | ||
|
|
edf9c40941 | ||
|
|
4dd4a2cc9c | ||
|
|
81bc8c784a | ||
|
|
294e7fc2db | ||
|
|
6e632d02a0 | ||
|
|
50ff0d810f | ||
|
|
d4be7f18e2 | ||
|
|
6d24a46e88 | ||
|
|
db866d2310 | ||
|
|
bb7e15be84 | ||
|
|
7a007a6417 | ||
|
|
96aad9d34f | ||
|
|
4d3334caf1 | ||
|
|
2745f49d28 | ||
|
|
5470aaaa3a | ||
|
|
f89cbc9133 | ||
|
|
5dfffc36e3 | ||
|
|
3761995aff | ||
|
|
e62cef590b | ||
|
|
677e583345 | ||
|
|
abbf937e7f | ||
|
|
8d14ea6093 | ||
|
|
97826b2f3b | ||
|
|
a1e0078ce5 | ||
|
|
a5bf3c3be1 | ||
|
|
19a5613e59 | ||
|
|
ced286854c | ||
|
|
811ffc760f | ||
|
|
549b60edb1 | ||
|
|
8735b10653 | ||
|
|
29d49179a9 | ||
|
|
19b4a0f403 | ||
|
|
d854b41ffb | ||
|
|
329a575031 | ||
|
|
85ad85bdfa | ||
|
|
95c26a7850 | ||
|
|
885e6f916c | ||
|
|
d7a86a4d28 | ||
|
|
7b3e0563cc | ||
|
|
50a62bf00a | ||
|
|
1c6b0554c7 | ||
|
|
537c205757 | ||
|
|
f07b2477f5 | ||
|
|
5e5531f6d8 | ||
|
|
eadc9ee795 | ||
|
|
0b3f94b6bd | ||
|
|
9f8d30a66c | ||
|
|
2a8eea086c | ||
|
|
bb0bfaee56 | ||
|
|
b8209e8e09 | ||
|
|
a5b87a9067 | ||
|
|
b3e547c60f | ||
|
|
1ead6e2d20 | ||
|
|
016bdd542a | ||
|
|
4dc9d0a536 | ||
|
|
4b11032567 | ||
|
|
0c54eaf176 | ||
|
|
401ebcf685 | ||
|
|
69e5f137a6 | ||
|
|
a0f2079fb5 | ||
|
|
cfa4cb2a7c | ||
|
|
12a1bebe7e | ||
|
|
d461acffc7 | ||
|
|
e60cdc9d0f | ||
|
|
67a0fd11dd | ||
|
|
fca8becb20 | ||
|
|
be423e49fd | ||
|
|
5decb23f23 | ||
|
|
ac151d9019 | ||
|
|
71ccc47717 | ||
|
|
b32f9bddd2 | ||
|
|
1a7193e113 | ||
|
|
a580482c29 | ||
|
|
e230cfb3f3 | ||
|
|
030b6b4478 | ||
|
|
0f818a313d | ||
|
|
326fc943b7 | ||
|
|
7e6ddaf0d6 | ||
|
|
22710ccfb3 | ||
|
|
33ea9c3459 | ||
|
|
e722c2f8ad | ||
|
|
1c99bccef9 | ||
|
|
61bd803942 | ||
|
|
2f5c3570dd | ||
|
|
9e12a8353b | ||
|
|
c6cb430594 | ||
|
|
0e60b26048 | ||
|
|
269f18a22f | ||
|
|
7c74aa4c4d | ||
|
|
a6c1084b14 | ||
|
|
4abd97df09 | ||
|
|
904a3cdaff | ||
|
|
f58d63bb49 | ||
|
|
dedf3f234f | ||
|
|
633d1ae594 | ||
|
|
0846a0fed0 | ||
|
|
f1be116190 | ||
|
|
d5af7b9b48 | ||
|
|
e55677da22 | ||
|
|
9f4a74cca0 | ||
|
|
b40cba659a | ||
|
|
a26b203205 | ||
|
|
6e90c9d730 | ||
|
|
31d7eaad90 | ||
|
|
0d886ab6f1 | ||
|
|
cbd3b1424b | ||
|
|
0ce1575e12 | ||
|
|
268886576f | ||
|
|
cbc6f20fa6 | ||
|
|
608be52b9a | ||
|
|
4badf72e18 | ||
|
|
5da52b6c57 | ||
|
|
c527338cb8 | ||
|
|
46711ce365 | ||
|
|
8353c9bdf5 | ||
|
|
6a7a858065 | ||
|
|
2e72b91eaf | ||
|
|
d2cd459f26 | ||
|
|
06fb249f2e | ||
|
|
d9cbf786d5 | ||
|
|
5d5c3d74c1 | ||
|
|
4b86d83465 | ||
|
|
592cad5b99 | ||
|
|
228fb21ceb | ||
|
|
f813e6317b | ||
|
|
5e1ce30ab2 | ||
|
|
51cc994610 | ||
|
|
7ae83a4031 | ||
|
|
8696ce9291 | ||
|
|
2e6240a910 | ||
|
|
cd390a53af | ||
|
|
ef1c9724c7 | ||
|
|
a9d5e1643d | ||
|
|
f00c8bba33 | ||
|
|
d43ead5b34 | ||
|
|
4b896fc327 | ||
|
|
be5a5f3c69 | ||
|
|
fde543f19e | ||
|
|
804d832544 | ||
|
|
bbba7f2817 | ||
|
|
13cda74ebc | ||
|
|
9753a74db4 | ||
|
|
a1568c43d3 | ||
|
|
0d7d4cb142 | ||
|
|
8d3f933562 | ||
|
|
3dc0452a45 | ||
|
|
261f6709a3 | ||
|
|
b63f842210 | ||
|
|
55650cd416 | ||
|
|
157b78a052 | ||
|
|
db980689c8 | ||
|
|
b714c59004 | ||
|
|
d2bca10ac9 | ||
|
|
27dcef3e23 | ||
|
|
ba5e99c187 | ||
|
|
35f2c6d788 | ||
|
|
b04be6d194 | ||
|
|
da58b14124 | ||
|
|
02b7085543 | ||
|
|
fb85b228f0 | ||
|
|
52dd2ad7ac | ||
|
|
5904d01bff | ||
|
|
7f8a3849c7 | ||
|
|
106b21f288 | ||
|
|
e8c37287fe | ||
|
|
449dd4301e | ||
|
|
baf2a77e18 | ||
|
|
ab1d28bb27 | ||
|
|
71319942d9 | ||
|
|
ff9765f668 | ||
|
|
caef322b65 | ||
|
|
a42868d7eb | ||
|
|
0143911fe1 | ||
|
|
f2192ba232 | ||
|
|
1a80aa854f | ||
|
|
42e32487da | ||
|
|
1e3f75c852 | ||
|
|
1e65335173 | ||
|
|
61af59cca1 | ||
|
|
1458503561 | ||
|
|
046fffdd14 | ||
|
|
3aa04448ff | ||
|
|
2cfa3d9218 | ||
|
|
a294fb4e8b | ||
|
|
ceb0e29da3 | ||
|
|
3823216319 | ||
|
|
3ac2d5dd34 | ||
|
|
5a89cc6a2a | ||
|
|
5c2a9ce5db | ||
|
|
2317d0cf27 | ||
|
|
ad054338b5 | ||
|
|
42f06d5147 | ||
|
|
7263fb74a9 | ||
|
|
e8ca6709b9 | ||
|
|
50c95e439d | ||
|
|
fa57f160dc | ||
|
|
45cda586d2 | ||
|
|
24a020a5f0 | ||
|
|
37ee1d6780 | ||
|
|
9e9189727f | ||
|
|
05fd4fbc8a | ||
|
|
95062747ef | ||
|
|
6465e2dc2f | ||
|
|
074d7a017e | ||
|
|
739a185d1b | ||
|
|
9f54985ce5 | ||
|
|
b908ff5821 | ||
|
|
098df12d94 | ||
|
|
6029340f78 | ||
|
|
4c7520efb9 | ||
|
|
c8b8bcb22e | ||
|
|
797a5c8a5c | ||
|
|
6323ce56ed | ||
|
|
86a4e7f495 | ||
|
|
91bdffab33 | ||
|
|
9568806219 | ||
|
|
5fa30e4145 | ||
|
|
fa9821083d | ||
|
|
9d3a029e10 | ||
|
|
ea93ba6a77 | ||
|
|
9b010db0b8 | ||
|
|
aed9e905f2 | ||
|
|
ad2bdb1242 | ||
|
|
d43bc2e17e | ||
|
|
9ecd59c6e1 | ||
|
|
d34b73cd7c | ||
|
|
3e5298fcab | ||
|
|
e5de00095f | ||
|
|
84cda5cfe2 | ||
|
|
f19d0f0360 | ||
|
|
ede2e8c593 | ||
|
|
2ef3930fc3 | ||
|
|
2d14625fd0 | ||
|
|
92445a8a3f | ||
|
|
517a32f08f | ||
|
|
72cadba854 | ||
|
|
0ef66c74b0 | ||
|
|
a1ae185272 | ||
|
|
fcdb556f3b | ||
|
|
6e1e869851 | ||
|
|
ba1bab4ee7 | ||
|
|
dbc2fe9cdb | ||
|
|
a6a3a1365f | ||
|
|
34f1aa421f | ||
|
|
30d79f48de | ||
|
|
ad17e22201 | ||
|
|
9f0128cf3f | ||
|
|
3aa882ee21 | ||
|
|
894aa9bc5e | ||
|
|
4944c33228 | ||
|
|
06518b5374 | ||
|
|
2a5a0282cb | ||
|
|
d4a96c53c3 | ||
|
|
5e54f3a523 | ||
|
|
e96dcadc70 | ||
|
|
fb5aaffdc1 | ||
|
|
4ea6bcd1de | ||
|
|
5765180462 | ||
|
|
4c1ba0fd0b | ||
|
|
159eb4ce59 | ||
|
|
17889a2b46 | ||
|
|
3ebc6f0f1d | ||
|
|
9ee9f7bffb | ||
|
|
013d221398 | ||
|
|
5a1b618ce0 | ||
|
|
c6fdab554b | ||
|
|
c6a0ef2425 | ||
|
|
a146cb193b | ||
|
|
a55de71233 | ||
|
|
2c50861c44 | ||
|
|
d0e7cd46ce | ||
|
|
e0027c3cba | ||
|
|
19918b7221 | ||
|
|
7c4c8485b4 | ||
|
|
88af79509f | ||
|
|
a42c5edaa3 | ||
|
|
ef9034e380 | ||
|
|
f24ae37bd8 | ||
|
|
3f1cbb20d3 | ||
|
|
483e19adb6 | ||
|
|
3304a7e341 | ||
|
|
2edb92112a | ||
|
|
de8484b6f8 | ||
|
|
88a81b186b | ||
|
|
15d4525b71 | ||
|
|
032c76a944 | ||
|
|
525709eb38 | ||
|
|
232dbe5459 | ||
|
|
3f14fdb51b | ||
|
|
ca914bd419 | ||
|
|
2ce40c4847 | ||
|
|
3f272b209d | ||
|
|
edd6acc012 | ||
|
|
26f43de07d | ||
|
|
de954c6bf8 | ||
|
|
babbbf696e | ||
|
|
579fd3bbfb | ||
|
|
a996f7b6fb | ||
|
|
6bb4a3e28c | ||
|
|
023b6f9d81 | ||
|
|
694a8febb5 | ||
|
|
a824d00f85 | ||
|
|
cd244f341d | ||
|
|
12310c5e3a | ||
|
|
ea1fe29a5e | ||
|
|
1d98135f58 | ||
|
|
8ac375fc9b | ||
|
|
5588deb925 | ||
|
|
8d6d7a1bf5 | ||
|
|
db739c05b8 | ||
|
|
e8f61e2dda | ||
|
|
7b1d1d2592 | ||
|
|
e4d8d67f65 | ||
|
|
c71b29b77e | ||
|
|
f24475b996 | ||
|
|
c5484fe139 | ||
|
|
d5e7149f99 | ||
|
|
29e2bbd2a7 | ||
|
|
c7146cf432 | ||
|
|
d58a2fd4c6 | ||
|
|
5a27ab6e54 | ||
|
|
a4df56dcb7 | ||
|
|
fbe50e33d3 | ||
|
|
5804825dc3 | ||
|
|
24495d046f | ||
|
|
b61996c761 | ||
|
|
2aa31024e6 | ||
|
|
fc00ef032e | ||
|
|
e8c085b89c | ||
|
|
41c10a759a | ||
|
|
dd3455d598 | ||
|
|
88bc0b7a92 | ||
|
|
f480e29342 | ||
|
|
b25443d142 | ||
|
|
354e064969 | ||
|
|
594636e0e3 | ||
|
|
fb99c56985 | ||
|
|
426fef6e4a | ||
|
|
97aecdf4cf | ||
|
|
a34cbc58dc | ||
|
|
5eface585d | ||
|
|
f0b48a6b43 | ||
|
|
0ed8afd999 | ||
|
|
68fa2f9fa3 | ||
|
|
3ebf5e5240 | ||
|
|
66e3ee28b6 | ||
|
|
8a41cef00b | ||
|
|
5c228e6071 | ||
|
|
8a3993ca59 | ||
|
|
c9f5476588 | ||
|
|
2d54ab5fcf | ||
|
|
86cd162784 | ||
|
|
8ff0096eb6 | ||
|
|
79336ca108 | ||
|
|
2478b73ee5 | ||
|
|
2fa0673e0b | ||
|
|
d62ac5239b | ||
|
|
9b3daeea01 | ||
|
|
fb2719ce8a | ||
|
|
94b207257e | ||
|
|
1b6b0181c5 | ||
|
|
45bf398494 | ||
|
|
974e19fa3a | ||
|
|
954397b6a6 | ||
|
|
7bba22c5d2 | ||
|
|
c6e4057add | ||
|
|
af7d2bb8c7 | ||
|
|
50862668b1 | ||
|
|
18dd1659da | ||
|
|
1c1e6b45b6 | ||
|
|
b3739c10cc | ||
|
|
97c8c7826c | ||
|
|
7bf1627625 | ||
|
|
7affce2f64 | ||
|
|
809c452285 | ||
|
|
157408b53a | ||
|
|
d8694107b7 | ||
|
|
30e43f9c41 | ||
|
|
3899626870 | ||
|
|
d504157c6f | ||
|
|
917a2a528b | ||
|
|
3ebd54d888 | ||
|
|
05c11911fb | ||
|
|
d198cccf75 | ||
|
|
05f6425a53 | ||
|
|
f2eeb50381 | ||
|
|
b17730137a | ||
|
|
c12b0f5fee | ||
|
|
71fedd3be4 | ||
|
|
3299dbdc28 | ||
|
|
8a3fb2ac00 | ||
|
|
87acd4c555 | ||
|
|
b35ee6d3db | ||
|
|
67fcb0c1a0 | ||
|
|
c51c45b46d | ||
|
|
728951cb55 | ||
|
|
aa0e7a6dd3 | ||
|
|
ddb588e751 | ||
|
|
7b9e3efea1 | ||
|
|
590bff696b | ||
|
|
f98ebaafee | ||
|
|
7bd83e7ef3 | ||
|
|
6c8a39607b | ||
|
|
f79e361823 | ||
|
|
89fba67eb0 | ||
|
|
57de36a9d3 | ||
|
|
91b9fb3e3f | ||
|
|
5cadfb5a09 | ||
|
|
1f559049c6 | ||
|
|
b9102841b7 | ||
|
|
6797432f9b | ||
|
|
6c09210380 | ||
|
|
7995858124 | ||
|
|
699f7b5278 | ||
|
|
22c73d831a | ||
|
|
46b48cb7c4 | ||
|
|
16e63824f1 | ||
|
|
7ed9cc0f87 | ||
|
|
9d761c4ee9 | ||
|
|
a956abd65a | ||
|
|
1a96480aa7 | ||
|
|
a87c3f6d4d | ||
|
|
8cba11930f | ||
|
|
2b51501a57 | ||
|
|
cf05b571ac | ||
|
|
ad68b05f7d | ||
|
|
7eb7acf3af | ||
|
|
8f6784d5d2 | ||
|
|
dee205fc2f | ||
|
|
aecc7a4734 | ||
|
|
e79fd99a41 | ||
|
|
fbca845bbd | ||
|
|
d447308ef0 | ||
|
|
975cc5ccfc | ||
|
|
d665cc9538 | ||
|
|
8a70b5cd7f | ||
|
|
ee73e51d03 | ||
|
|
923fe98a99 | ||
|
|
88ac1974d1 | ||
|
|
f0b2f6d509 | ||
|
|
edd560f5a4 | ||
|
|
c7cccb2ce5 | ||
|
|
8092ff7e62 | ||
|
|
b1129332c9 | ||
|
|
cc4d13e1ce | ||
|
|
bcc724df2c | ||
|
|
116a540abd | ||
|
|
4383a89091 | ||
|
|
801f9adfd7 | ||
|
|
383f36fc48 | ||
|
|
9ec49d6273 | ||
|
|
7e4cc68492 | ||
|
|
333c9ba205 | ||
|
|
af0cad90a8 | ||
|
|
6cf84a0bc4 | ||
|
|
b8e5019e24 | ||
|
|
60882d9a5c | ||
|
|
18b2b7dfe8 | ||
|
|
8da9f55b05 | ||
|
|
3820f7b275 | ||
|
|
befe2e7bee | ||
|
|
36a837cd77 | ||
|
|
db382e39a7 | ||
|
|
cef4683082 | ||
|
|
778a38a668 | ||
|
|
19114d1073 | ||
|
|
e702736455 | ||
|
|
49fbe75387 | ||
|
|
06f14045ad | ||
|
|
a88a781d38 | ||
|
|
c3834c16fa | ||
|
|
dec9f47aa6 | ||
|
|
4dc570779d | ||
|
|
a9f1c3711a | ||
|
|
7ff03d2e75 | ||
|
|
97f4fabd48 | ||
|
|
df49bf4cf3 | ||
|
|
cd3ead3f30 | ||
|
|
06850dd775 | ||
|
|
47a58a73e4 | ||
|
|
6665332359 | ||
|
|
b0b594c5f8 | ||
|
|
a74ce57d24 | ||
|
|
84c32a3cd9 | ||
|
|
0a92b340ac | ||
|
|
c76b84e1be | ||
|
|
619548d8e3 | ||
|
|
8bef18c2a8 | ||
|
|
4997814abe | ||
|
|
54b7959f89 | ||
|
|
ed11da4903 | ||
|
|
942c916df5 | ||
|
|
3ea3d8c19f | ||
|
|
a4d83c33ec | ||
|
|
0ac6f0fa93 | ||
|
|
141725d002 | ||
|
|
07987dad46 | ||
|
|
90dda10ca0 | ||
|
|
2250fea68a | ||
|
|
0bf9be8be9 | ||
|
|
fcc6a8c4c3 | ||
|
|
ebbcd28536 | ||
|
|
b273e06e88 | ||
|
|
197859b675 | ||
|
|
f5ece9b5b4 | ||
|
|
f0a71acf98 | ||
|
|
478b4f9550 | ||
|
|
e9623fdc36 | ||
|
|
a6e5ea268b | ||
|
|
e1d75736e7 | ||
|
|
3dc7f8cd7c | ||
|
|
e19b0d2a49 | ||
|
|
543b8df48b | ||
|
|
2fac5c76d9 | ||
|
|
bb0a607891 | ||
|
|
b401d957e5 | ||
|
|
1c931a65e7 | ||
|
|
b9fd3dda7d | ||
|
|
8b4b5fb058 | ||
|
|
3a41ec2e20 | ||
|
|
cc975f77aa | ||
|
|
81ef3d1e02 | ||
|
|
09ecd68fde | ||
|
|
60a747620c | ||
|
|
4abcf1054b | ||
|
|
e476e4154e | ||
|
|
4829c21db7 | ||
|
|
d974ab0979 | ||
|
|
2111a06ce3 | ||
|
|
32ebec3d3c | ||
|
|
89d972ff40 | ||
|
|
5c35a288a3 | ||
|
|
ad23c88347 | ||
|
|
f60435aca4 | ||
|
|
9d3dee7bf3 | ||
|
|
5af6f0e7cb | ||
|
|
8711702cf5 | ||
|
|
1e6679c40c | ||
|
|
578f77a411 | ||
|
|
61c4a8b635 | ||
|
|
654e255b68 | ||
|
|
28738a5179 | ||
|
|
258b824ff8 | ||
|
|
7438ba1eea | ||
|
|
3c33401b48 | ||
|
|
9aa45041f6 | ||
|
|
56bce984fa | ||
|
|
6cdd8de248 | ||
|
|
197ed7b912 | ||
|
|
7de90e16f6 | ||
|
|
cad4e2f6dc | ||
|
|
4d5443ed6b | ||
|
|
00760ef1b3 | ||
|
|
65557f670a | ||
|
|
9cdb273cbc | ||
|
|
4fede5a9c6 | ||
|
|
7971bc91b2 | ||
|
|
eb4156c02e | ||
|
|
faccba1c86 | ||
|
|
d3a00fc887 | ||
|
|
5c756768c8 | ||
|
|
7b92fb27c0 | ||
|
|
be9021d377 | ||
|
|
ec7feb1a3c | ||
|
|
e899050517 | ||
|
|
d8dffc9dd3 | ||
|
|
5a68d26d59 | ||
|
|
d5abf3f0f5 | ||
|
|
9a476073cb | ||
|
|
2da952e7ff | ||
|
|
ce363ce409 | ||
|
|
2523cf81ba | ||
|
|
8a61e4517f | ||
|
|
cc9e495042 | ||
|
|
8f8b66fbff | ||
|
|
8bfa3ef250 | ||
|
|
17d0b17a86 | ||
|
|
2f5e955367 | ||
|
|
6f52e7a008 | ||
|
|
86734076e0 | ||
|
|
e6a0019cc7 | ||
|
|
6b6bef4e86 | ||
|
|
998420312e | ||
|
|
d3bd990009 | ||
|
|
e1e47abfbe | ||
|
|
8c2214fc09 | ||
|
|
250d71b580 | ||
|
|
151864f1d4 | ||
|
|
f4df354cd0 | ||
|
|
b4068f36e1 | ||
|
|
4223d48edd | ||
|
|
f32c977381 | ||
|
|
d96e56e3c7 | ||
|
|
c3bb575b48 | ||
|
|
2d2285861f | ||
|
|
19f9400b11 | ||
|
|
344a505903 | ||
|
|
922ee39109 | ||
|
|
4b60475a02 | ||
|
|
2de863c5db | ||
|
|
09e5676009 | ||
|
|
657629183b | ||
|
|
9cefd06655 | ||
|
|
ac549770ee | ||
|
|
22623fb0b6 | ||
|
|
98ac877033 | ||
|
|
5f835edf2e | ||
|
|
83790fcd64 | ||
|
|
6dd2dcee16 | ||
|
|
a91a354fa9 | ||
|
|
4bf3d698e3 | ||
|
|
e3cba0d4c2 | ||
|
|
83204eda3b | ||
|
|
67a884fc9d | ||
|
|
6e315cff76 | ||
|
|
146128730c | ||
|
|
1daa6df346 | ||
|
|
416b897596 | ||
|
|
039285ffae | ||
|
|
b28f511b92 | ||
|
|
19df1aed17 | ||
|
|
9452ba4c24 | ||
|
|
98a28cc4e9 | ||
|
|
762ec228da | ||
|
|
f619c1f8c4 | ||
|
|
5180fc70d2 | ||
|
|
19fe770606 | ||
|
|
f52afb8660 | ||
|
|
f2e98265e7 | ||
|
|
bb7aa6544f | ||
|
|
2324a1bf0e | ||
|
|
ca278985b0 | ||
|
|
4a9be80c98 | ||
|
|
23387d6e48 | ||
|
|
6cf0550312 | ||
|
|
73466bb513 | ||
|
|
b0805a9bae | ||
|
|
f9fd4f9009 | ||
|
|
5b6b8b6ad1 | ||
|
|
8aede1dfe4 | ||
|
|
77cdb7bf43 | ||
|
|
6880184cbb | ||
|
|
84122f9f54 | ||
|
|
c52d201808 | ||
|
|
466866c323 | ||
|
|
be8ffeb724 | ||
|
|
868dc6d7a9 | ||
|
|
1ddb187518 | ||
|
|
b7badcbf02 | ||
|
|
684d12e60e | ||
|
|
4e4ad0be8b | ||
|
|
f238ef40ec | ||
|
|
f5eef06e88 | ||
|
|
76f7a40b7f | ||
|
|
778d3f2853 | ||
|
|
2ba681573f | ||
|
|
edafee7b22 | ||
|
|
52056b0eeb | ||
|
|
5a3df191a5 | ||
|
|
062131a10e | ||
|
|
6c78049886 | ||
|
|
3d5fdf2a91 | ||
|
|
c9c4066331 | ||
|
|
835b973bdc | ||
|
|
bf6a32907c | ||
|
|
2b7885c3f8 | ||
|
|
749af60796 | ||
|
|
87ddcac2fc | ||
|
|
e3383fe4c1 | ||
|
|
292856e1bd | ||
|
|
3dacaaf03a | ||
|
|
6307b765e3 | ||
|
|
eb2561175d | ||
|
|
a30e41f0b4 | ||
|
|
51341f6722 | ||
|
|
fb15751703 | ||
|
|
a0105bcb2f | ||
|
|
103e0796b7 | ||
|
|
363b23d6e3 | ||
|
|
52ad02a08a | ||
|
|
977cf3c383 | ||
|
|
827ea36d72 | ||
|
|
46b0367335 | ||
|
|
596afddfb6 | ||
|
|
256c2dfdbe | ||
|
|
0737ee65bd | ||
|
|
8998be66eb | ||
|
|
1180cac147 | ||
|
|
270231a004 | ||
|
|
c2f0f6c7c4 | ||
|
|
c7afae38a8 | ||
|
|
873a825e57 | ||
|
|
dc2318f404 | ||
|
|
699ed1da4d | ||
|
|
d8b95f845c | ||
|
|
014d39c11d | ||
|
|
a544a852f2 | ||
|
|
3311a48e3a | ||
|
|
5ac908afd4 | ||
|
|
12a3e659b1 | ||
|
|
b0780af7fa | ||
|
|
2ec31c7521 | ||
|
|
f2562500a3 | ||
|
|
85a567bdab | ||
|
|
11c415fd17 | ||
|
|
d67ea41032 | ||
|
|
66357ebe7e | ||
|
|
708fa989aa | ||
|
|
8dbde90a93 | ||
|
|
d2910de121 | ||
|
|
c5be9908c5 | ||
|
|
f7f70108bc | ||
|
|
bd08eadac9 | ||
|
|
a2314a9ab3 | ||
|
|
e1b071c0d8 | ||
|
|
aba8a57fa5 | ||
|
|
5784ab82ef | ||
|
|
636e79672a | ||
|
|
b935e96448 | ||
|
|
56ad5b97b6 | ||
|
|
dcead7361f | ||
|
|
ef314340fa | ||
|
|
a149cdc4f5 | ||
|
|
fc777e69e2 | ||
|
|
2ea1b9df6c | ||
|
|
05e54fa0c6 | ||
|
|
0203e6da31 | ||
|
|
93a852e6ea | ||
|
|
985b0970f1 | ||
|
|
e844d42275 | ||
|
|
a56ddb9ebe | ||
|
|
1957d2bb58 | ||
|
|
e55f11c5b9 | ||
|
|
07133b79e5 | ||
|
|
183a8feed4 | ||
|
|
e3253fce16 | ||
|
|
acd6f729f0 | ||
|
|
ec85cccc75 | ||
|
|
f3f640c24f | ||
|
|
9c2b42caa2 | ||
|
|
a677ffc90e | ||
|
|
254145da22 | ||
|
|
fec51ebc8e | ||
|
|
9d66aea843 | ||
|
|
50895a662a | ||
|
|
048ad78778 | ||
|
|
e9beffc799 | ||
|
|
fe9dd5ef28 | ||
|
|
468e4b6d55 | ||
|
|
b48ac505fd | ||
|
|
947de33b5a | ||
|
|
4b9cd490ab | ||
|
|
784688a9da | ||
|
|
71bb760ce5 | ||
|
|
98a46e8caa | ||
|
|
dcdbd3652a | ||
|
|
c35b7a66b0 | ||
|
|
5ec02e2f18 | ||
|
|
9709b97adf | ||
|
|
3be039b1a9 | ||
|
|
21bd664edf | ||
|
|
a31c422537 | ||
|
|
e5299d96ad | ||
|
|
5675f32a19 | ||
|
|
c207578f14 | ||
|
|
16801ad3e1 | ||
|
|
25cfed949d | ||
|
|
eacfcab187 | ||
|
|
9e014eba1f | ||
|
|
9692b709aa | ||
|
|
5acb04c180 | ||
|
|
ff96e2e4d6 | ||
|
|
2e96fa9e1e | ||
|
|
87234bda05 | ||
|
|
ca6364e5d4 | ||
|
|
4a364d730b | ||
|
|
62667de4a8 | ||
|
|
b7a9be31eb | ||
|
|
f8955c0d1b | ||
|
|
0aac7813e4 | ||
|
|
44cc9e7db8 | ||
|
|
644329c0b8 | ||
|
|
ff97fba0f0 | ||
|
|
ce67e28f96 | ||
|
|
e149689249 | ||
|
|
b79d5e670a | ||
|
|
c23cb378cd | ||
|
|
a185685f0c | ||
|
|
b4699825d6 | ||
|
|
118a4f7097 | ||
|
|
7acb0657a7 | ||
|
|
021ce44673 | ||
|
|
9a7733c9a3 | ||
|
|
7150f5b536 | ||
|
|
753b9e8d7a | ||
|
|
6e62ecc8c1 | ||
|
|
0ab5369635 | ||
|
|
a274b769bd | ||
|
|
6e4d35777b | ||
|
|
776e6aa498 | ||
|
|
b7a21dd322 | ||
|
|
71d73c6562 | ||
|
|
6732710d6f | ||
|
|
90618723d4 | ||
|
|
084ca956fb | ||
|
|
44109f9d8f | ||
|
|
606efd3da1 | ||
|
|
2d76aa029a | ||
|
|
1acbbbaf6c | ||
|
|
8864884c67 | ||
|
|
a332b71463 | ||
|
|
38ea4ff98f | ||
|
|
10d76ae7a4 | ||
|
|
cd973adedf | ||
|
|
af94b770f9 | ||
|
|
62a51bb061 | ||
|
|
01ab61b8b1 | ||
|
|
c55d8c0bdf | ||
|
|
7336ed6eff | ||
|
|
60ca95e9b2 | ||
|
|
89b43a42c4 | ||
|
|
197be925b8 | ||
|
|
d49cd209e1 | ||
|
|
d60ab8cd9e | ||
|
|
7840ff0d7c | ||
|
|
a7144e57e1 | ||
|
|
50eac58493 | ||
|
|
4ef58b56e6 | ||
|
|
c1f0c76d17 | ||
|
|
079116fdf8 | ||
|
|
45e6385963 | ||
|
|
3ca0458d65 | ||
|
|
d5edec2cd0 | ||
|
|
ce9c9bea6a | ||
|
|
c105ffec18 | ||
|
|
604c2a0bdd | ||
|
|
1c19bb4dfc | ||
|
|
858d87a732 | ||
|
|
ea28900913 | ||
|
|
192e606fea | ||
|
|
8e4152e567 | ||
|
|
9e9da5355c | ||
|
|
26e9a17c6b | ||
|
|
fa43600cd9 | ||
|
|
3aca55205e | ||
|
|
3a0aac3c36 | ||
|
|
fe34bdc656 | ||
|
|
e69c1e8e93 | ||
|
|
1c0721f179 | ||
|
|
6f37968670 | ||
|
|
d1c34a9c88 | ||
|
|
65263a8b74 | ||
|
|
5cd6ab9335 | ||
|
|
56b1705df4 | ||
|
|
08e4c05129 | ||
|
|
b5b0ea5980 | ||
|
|
803e17f3a3 | ||
|
|
75017d7ac6 | ||
|
|
80486d644d | ||
|
|
1bdc167f7a | ||
|
|
3f2fdb0b14 | ||
|
|
ac186f89f1 | ||
|
|
fdccfd166f | ||
|
|
272a71f3d5 | ||
|
|
3621879d38 | ||
|
|
4661990cfe | ||
|
|
7db63b10e8 | ||
|
|
428ea89f62 | ||
|
|
60e0ed911e | ||
|
|
e1366ef90f | ||
|
|
85c170712a | ||
|
|
33bf487a1c | ||
|
|
227810db75 | ||
|
|
6171c76199 | ||
|
|
45c1958d83 | ||
|
|
e51d9439c5 | ||
|
|
a48b5deb29 | ||
|
|
212f40cd1a | ||
|
|
18952c57ff | ||
|
|
4296b49570 | ||
|
|
95f084fb36 | ||
|
|
0b237a2469 | ||
|
|
8c34a4fd0a | ||
|
|
f970594c28 | ||
|
|
02c8a1703a | ||
|
|
590d2f2661 | ||
|
|
425f6f7c0b | ||
|
|
c229dc1548 | ||
|
|
e4cc84b771 | ||
|
|
9b3569be50 | ||
|
|
a8e9c5aaf2 | ||
|
|
661302f698 | ||
|
|
854387b2d0 | ||
|
|
7a305b5a5c | ||
|
|
9f463707ee | ||
|
|
e1bcbae975 | ||
|
|
e77efde503 | ||
|
|
4583128c02 | ||
|
|
35b1232b0a | ||
|
|
bc8fe527f7 | ||
|
|
2943343003 | ||
|
|
4e061ef385 | ||
|
|
571cf9c5d9 | ||
|
|
22bde81712 | ||
|
|
a9736b96c0 | ||
|
|
0adbef9696 | ||
|
|
53e52c841b | ||
|
|
b78bb9e970 | ||
|
|
d6959f64c3 | ||
|
|
c5dbc71db3 | ||
|
|
fbd9440711 | ||
|
|
a439dc4cd8 | ||
|
|
fe3a47f2d5 | ||
|
|
9509c8027b | ||
|
|
519429cebb | ||
|
|
4aee779385 | ||
|
|
7903119cb4 | ||
|
|
ef1f96f382 | ||
|
|
af9a6a8a6e | ||
|
|
dffa00dc5e | ||
|
|
6c5b32d92b | ||
|
|
7d5c55fc95 | ||
|
|
017654852d | ||
|
|
9e2e616e1b | ||
|
|
0d5d28e4a6 | ||
|
|
90e50db189 | ||
|
|
e9a7cad202 | ||
|
|
60cf0b1099 | ||
|
|
aefb72f7cc | ||
|
|
4d434d36be | ||
|
|
f69abdcc14 | ||
|
|
ee36c31637 | ||
|
|
e0a064a0fa | ||
|
|
568fcbf547 | ||
|
|
7028bbfbfd | ||
|
|
c552e9e9be | ||
|
|
f8e8914f7d | ||
|
|
f195af017e | ||
|
|
6474f25253 | ||
|
|
6d2851e742 | ||
|
|
11fb18f598 | ||
|
|
c026d7d248 | ||
|
|
e0b33799d5 | ||
|
|
17d3d9deb7 | ||
|
|
02212bde21 | ||
|
|
86c6cda79a | ||
|
|
488eb1fac3 | ||
|
|
3eab5503f1 | ||
|
|
61f84302f3 | ||
|
|
5dc0333580 | ||
|
|
f2092ee89c | ||
|
|
d4e7c2e1b1 | ||
|
|
9d69951faa | ||
|
|
2d68b6e589 | ||
|
|
b4af85f405 | ||
|
|
e9ca09da87 | ||
|
|
d770c20b5a | ||
|
|
1ef9c617b3 | ||
|
|
48dc27e106 | ||
|
|
8aab0ee318 | ||
|
|
f9d1086062 | ||
|
|
5e8a04e54d | ||
|
|
32a38af4f7 | ||
|
|
be99c59725 | ||
|
|
f6e2a59008 | ||
|
|
f7f7d5c4f0 | ||
|
|
85fc2b2666 | ||
|
|
65624ed77e | ||
|
|
6a3241fa0b | ||
|
|
ff22ab0026 | ||
|
|
907f5051e1 | ||
|
|
76a9e94aed | ||
|
|
772ebd198a | ||
|
|
de7808d42b | ||
|
|
55b24c6a45 | ||
|
|
603f667f93 | ||
|
|
18162cf110 | ||
|
|
f693f26ffc | ||
|
|
4cc1dc405f | ||
|
|
12a4cbef46 | ||
|
|
f9a9a405cd | ||
|
|
285f464b43 | ||
|
|
585bfba850 | ||
|
|
fa564c6029 | ||
|
|
fd632fc63b | ||
|
|
d8f1387703 | ||
|
|
522eb40808 | ||
|
|
587053b26c | ||
|
|
fa8d4eff0f | ||
|
|
666a9ef0fa | ||
|
|
014ea3eadc | ||
|
|
f7e1b39af9 | ||
|
|
33005ea243 | ||
|
|
651a9d30ce | ||
|
|
0bd6005cb9 | ||
|
|
3ee745d79c | ||
|
|
ec508f5224 | ||
|
|
1b9523f700 | ||
|
|
ee31808522 | ||
|
|
7414c921f3 | ||
|
|
d1d6e8e11c | ||
|
|
778f9039fb | ||
|
|
4904c184f7 | ||
|
|
cbde819e07 | ||
|
|
3d6cb623f0 | ||
|
|
47cfcd7b12 | ||
|
|
244128c7ed | ||
|
|
9c9b98dde4 | ||
|
|
36d1522f01 | ||
|
|
536e17eac4 | ||
|
|
7bba1dc944 | ||
|
|
59c859fb17 | ||
|
|
887ec45b6b | ||
|
|
faa0521428 | ||
|
|
8886b20c01 | ||
|
|
4810aec10d | ||
|
|
deb1979ea9 | ||
|
|
4739c71ee0 | ||
|
|
030ffe6dce | ||
|
|
da19ad7943 | ||
|
|
e7088ef06c | ||
|
|
92c7f886df | ||
|
|
59727875db | ||
|
|
98063422de | ||
|
|
4ce4786a58 | ||
|
|
3eb9714e68 | ||
|
|
ee64dc38f6 | ||
|
|
6146c7e450 | ||
|
|
deb38f8455 | ||
|
|
73f0b9dabd | ||
|
|
9ab4fa608a | ||
|
|
bf9d5efe43 | ||
|
|
7b56b36564 | ||
|
|
6e107e6368 | ||
|
|
1a7a468eb6 | ||
|
|
13e6070dd9 | ||
|
|
8cc8e45afd | ||
|
|
e373cde4f7 | ||
|
|
072079df05 | ||
|
|
22614f09a0 | ||
|
|
c858c8f75b | ||
|
|
eb80aaf96d | ||
|
|
ba7d0a60e4 | ||
|
|
b266dc24d7 | ||
|
|
619fe9a0e7 | ||
|
|
50cf776e70 | ||
|
|
64dacc7c70 | ||
|
|
f7c75442e7 | ||
|
|
293611287e | ||
|
|
6a2a1da5f9 | ||
|
|
7ebbf5911c | ||
|
|
254c3814d5 | ||
|
|
44c1920d9b | ||
|
|
109372d10b | ||
|
|
94847b846b | ||
|
|
3746332eb5 | ||
|
|
54b01d30da | ||
|
|
0509eb3f0a | ||
|
|
d7e37cf658 | ||
|
|
b81a4b6d5e | ||
|
|
b3b11174be | ||
|
|
bdade99837 | ||
|
|
29be139803 | ||
|
|
ca8779676c | ||
|
|
ee03d62997 | ||
|
|
e068012cfb | ||
|
|
8fbb30437c | ||
|
|
9396ed765c | ||
|
|
d7f2075b1d | ||
|
|
e5ac94a16f | ||
|
|
2be05d4f9a | ||
|
|
f3ee2d2bfd | ||
|
|
f580acaf70 | ||
|
|
d5e2bf546e | ||
|
|
27322a971f | ||
|
|
8b5d6c9367 | ||
|
|
f09d44d8a0 | ||
|
|
9b031ff9d3 | ||
|
|
de59e8aa56 | ||
|
|
850aa5b797 | ||
|
|
9107fd839b | ||
|
|
89cae22b91 | ||
|
|
82ee48b166 | ||
|
|
17f3c5777e | ||
|
|
2cb787f816 | ||
|
|
feba135cac | ||
|
|
45c9e75e4e | ||
|
|
586a7a85e3 | ||
|
|
f844bd99c7 | ||
|
|
0747336c0f | ||
|
|
ace102e1c1 | ||
|
|
b976461c29 | ||
|
|
ad7243844e | ||
|
|
4a6a458cdd | ||
|
|
197d46b511 | ||
|
|
cf25d3d7be | ||
|
|
036e0af960 | ||
|
|
b115b6f66c | ||
|
|
592f3dce9a | ||
|
|
bcef0dd2c5 | ||
|
|
3f86272913 | ||
|
|
322834b762 | ||
|
|
04ddf30167 | ||
|
|
1935cc4841 | ||
|
|
bd96571d8a | ||
|
|
aa253bf53e | ||
|
|
b8a59097c2 | ||
|
|
a630b74fa8 | ||
|
|
3f7b222b92 | ||
|
|
f1575f75c7 | ||
|
|
c5c382ade6 | ||
|
|
858873dfa0 | ||
|
|
7231acc236 | ||
|
|
adea84e123 | ||
|
|
565757580b | ||
|
|
620d7de02f | ||
|
|
bba625a68f | ||
|
|
b282a18f6b | ||
|
|
417487e195 | ||
|
|
fba48b1d90 | ||
|
|
78f62847a3 | ||
|
|
3bfaa33c58 | ||
|
|
d0cb119bb0 | ||
|
|
3fc6b1e8cf | ||
|
|
ae06af9bc5 | ||
|
|
260a378e8c | ||
|
|
94e052af83 | ||
|
|
d56ab9b79b | ||
|
|
ad556e7413 | ||
|
|
b9f49a83e0 | ||
|
|
ebec2c95c0 | ||
|
|
d62627c8a5 | ||
|
|
96d2c7fad9 | ||
|
|
3aac75f5b5 | ||
|
|
908d39ad39 | ||
|
|
084ffb0dc1 | ||
|
|
cec2bdb805 | ||
|
|
a0374cb4ea | ||
|
|
538338abfe | ||
|
|
097e398efc | ||
|
|
0fd9b3354a | ||
|
|
765b941472 | ||
|
|
64084bb628 | ||
|
|
df269eb4f7 | ||
|
|
722b03dca8 | ||
|
|
3ddfc93c1b | ||
|
|
5eb70fa57d | ||
|
|
eccc9d6fbd | ||
|
|
049ed723a7 | ||
|
|
b6cdc5803b | ||
|
|
792299537d | ||
|
|
7b01e72a9b | ||
|
|
755549a745 | ||
|
|
1c39555255 | ||
|
|
ff5aba9a51 | ||
|
|
467d012bce | ||
|
|
09bed4e74f | ||
|
|
7a8e71b837 | ||
|
|
90336277a7 | ||
|
|
0b662b7211 | ||
|
|
4581722bbe |
No files matched your search
@@ -0,0 +1,21 @@
|
||||
# This file is for unifying the coding style for different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[**.py]
|
||||
indent_style = tab
|
||||
|
||||
[src/octoprint/static/js/app/**.js]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[.travis.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -0,0 +1,10 @@
|
||||
src/octoprint/_version.py export-subst
|
||||
|
||||
src/octoprint/static/js/lib/* linguist-vendored
|
||||
src/octoprint/static/less/bootstrap/* linguist-vendored
|
||||
src/octoprint/static/less/font-awesome.less linguist-vendored
|
||||
src/octoprint/static/less/mixins.less linguist-vendored
|
||||
src/octoprint/static/less/variables.less linguist-vendored
|
||||
versioneer.py linguist-vendored
|
||||
|
||||
docs/* linguist-documentation
|
||||
@@ -0,0 +1,79 @@
|
||||
READ THE FOLLOWING FIRST:
|
||||
|
||||
If not already done, please read the "guidelines for contributing"
|
||||
that are linked ^-- just up there in the big yellow box. Also read
|
||||
the FAQ: https://github.com/foosel/OctoPrint/wiki/FAQ.
|
||||
|
||||
This is a bug and feature tracker, please only use it to report bugs
|
||||
or request features within OctoPrint (not OctoPi, not any OctoPrint
|
||||
plugins and not unofficial OctoPrint versions).
|
||||
|
||||
Do not seek support here ("I need help with ..."), that belongs on
|
||||
the mailing list or the G+ community (both linked in the "guidelines
|
||||
for contributing" linked above, read it!), NOT here.
|
||||
|
||||
Mark requests with a "[Request]" prefix in the title please. Fully fill
|
||||
out the bug reporting template for bug reports (if you don't know where
|
||||
to find some information - it's all described in the contribution
|
||||
guidelines linked up there in the big yellow box). Do not delete any
|
||||
lines from the template but those enclosed in [ and ] - and those please
|
||||
DO delete, they are only provided for your information and removing them
|
||||
makes your ticket more readable :)
|
||||
|
||||
Thank you!
|
||||
|
||||
(Before submitting your ticket, please delete this text up to and
|
||||
including the line too - it's only here for you, we already know it
|
||||
by heart ;))
|
||||
|
||||
----
|
||||
|
||||
#### What were you doing?
|
||||
|
||||
[Please be as specific as possible here. The maintainers will need to
|
||||
reproduce your issue in order to fix it and that is not possible if they
|
||||
don't know what you did to get it to happen in the first place.
|
||||
|
||||
If you encountered a problem with specific files of any sorts, make sure
|
||||
to also include a link to a file with which to reproduce the problem.]
|
||||
|
||||
#### What did you expect to happen?
|
||||
|
||||
#### What happened instead?
|
||||
|
||||
#### Branch & Commit or Version of OctoPrint
|
||||
|
||||
[Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.]
|
||||
|
||||
#### Printer model & used firmware incl. version
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Browser and Version of Browser, Operating System running Browser
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Link to octoprint.log
|
||||
|
||||
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.]
|
||||
|
||||
#### Link to contents of terminal tab or serial.log
|
||||
|
||||
[On gist.github.com or pastebin.com. If applicable, always include if unsure or
|
||||
reporting communication issues. Never truncate.
|
||||
|
||||
serial.log is usually not written due to performance reasons and must be
|
||||
enabled explicitly. Provide at the very least the FULL contents of your
|
||||
terminal tab at the time of the bug occurrence, even if you do not have
|
||||
a serial.log.]
|
||||
|
||||
#### Link to contents of Javascript console in the browser
|
||||
|
||||
[On gist.github.com or pastebin.com or alternatively a screenshot. If applicable -
|
||||
always include if unsure or reporting UI issues.]
|
||||
|
||||
#### Screenshot(s) showing the problem:
|
||||
|
||||
[If applicable. Always include if unsure or reporting UI issues.]
|
||||
|
||||
I have read the FAQ.
|
||||
@@ -0,0 +1,50 @@
|
||||
Thank you for your interest into contributing to OctoPrint, it's
|
||||
highly appreciated!
|
||||
|
||||
Please make sure you have read the "guidelines for contributing" as
|
||||
linked just above this form, there's a section on Pull Requests in there
|
||||
as well that contains important information.
|
||||
|
||||
As a summary, please make sure you have ticked all points on this
|
||||
checklist:
|
||||
|
||||
* [ ] Your changes are not possible to do through a plugin and relevant
|
||||
to a large audience (ideally all users of OctoPrint)
|
||||
* [ ] If your changes are large or otherwise disruptive: You have
|
||||
made sure your changes don't interfere with current development by
|
||||
talking it through with the maintainers, e.g. through a
|
||||
Brainstorming ticket
|
||||
* [ ] Your PR targets OctoPrint's devel branch (not master,
|
||||
maintenance or anything else)
|
||||
* [ ] Your PR was opened from a custom branch on your repository
|
||||
(no PRs from your version of master, maintenance or devel please),
|
||||
e.g. dev/my_new_feature
|
||||
* [ ] Your PR only contains relevant changes: no unrelated files,
|
||||
no dead code, ideally only one commit - rebase your PR if necessary!
|
||||
* [ ] Your changes follow the coding style
|
||||
* [ ] If your changes include style sheets: You have modified the
|
||||
.less source files, not the .css files (those are generated with
|
||||
lessc)
|
||||
* [ ] You have tested your changes (please state how!) - ideally you
|
||||
have added unit tests
|
||||
* [ ] You have run the existing unit tests against your changes and
|
||||
nothing broke
|
||||
* [ ] You have added yourself to the AUTHORS.md file :)
|
||||
|
||||
Feel free to delete all this help text, then describe
|
||||
your PR further. You may use the template provided below to do that.
|
||||
The more details the better!
|
||||
|
||||
----
|
||||
|
||||
#### What does this PR do and why is it necessary?
|
||||
|
||||
#### How was it tested? How can it be tested by the reviewer?
|
||||
|
||||
#### Any background context you want to provide?
|
||||
|
||||
#### What are the relevant tickets if any?
|
||||
|
||||
#### Screenshots (if appropriate)
|
||||
|
||||
#### Further notes
|
||||
@@ -1,10 +1,16 @@
|
||||
src/octoprint/templates/_data/AUTHORS.md
|
||||
src/octoprint/templates/_data/CHANGELOG.md
|
||||
src/octoprint/templates/_data/SUPPORTERS.md
|
||||
src/octoprint/templates/_data/THIRDPARTYLICENSES.md
|
||||
|
||||
devtools
|
||||
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
*.7z
|
||||
*.pyc
|
||||
*.zip
|
||||
*.exe
|
||||
*.gcode
|
||||
*.swp
|
||||
darwin-Cura-*
|
||||
win32-Cura-*
|
||||
@@ -21,3 +27,5 @@ dist
|
||||
pypy
|
||||
OctoPrint.egg-info
|
||||
*.orig
|
||||
|
||||
*.codekit
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
install:
|
||||
- pip install -e .[develop]
|
||||
script:
|
||||
- nosetests --with-doctest
|
||||
sudo: false
|
||||
git:
|
||||
depth: 250
|
||||
@@ -0,0 +1,8 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[octoprint.messages]
|
||||
file_filter = translations/<lang>/LC_MESSAGES/messages.po
|
||||
source_file = translations/messages.pot
|
||||
source_lang = en
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# Configuration file for the versioneer lookup, manually mapping tags based on branches
|
||||
#
|
||||
# Format is
|
||||
#
|
||||
# <branch-regex> <tag> <reference commit>
|
||||
#
|
||||
# The file is processed from top to bottom, the first matching line wins. If <tag> or <reference commit> are left out,
|
||||
# the lookup table does not apply to the matched branches
|
||||
|
||||
# master and rc shall not use the lookup table, only tags
|
||||
master
|
||||
rc/.*
|
||||
prerelease
|
||||
|
||||
# neither should disconnected checkouts, e.g. 'git checkout <tag>'
|
||||
HEAD
|
||||
\(detached.*
|
||||
|
||||
# maintenance is currently the branch for preparation of maintenance release 1.2.17
|
||||
# so are any fix/... and improve/... branches
|
||||
maintenance 1.2.17 354042b84d488db38ac1917bb69bd164f4e7f750 pep440-dev
|
||||
fix/.* 1.2.17 354042b84d488db38ac1917bb69bd164f4e7f750 pep440-dev
|
||||
improve/.* 1.2.17 354042b84d488db38ac1917bb69bd164f4e7f750 pep440-dev
|
||||
|
||||
# every other branch is a development branch and thus gets resolved to 1.3.0-dev for now
|
||||
.* 1.3.0 198d3450d94be1a2 pep440-dev
|
||||
@@ -0,0 +1,69 @@
|
||||
# Authors
|
||||
|
||||
The following people have contributed to OctoPrint's code base (ordered by
|
||||
date of first contribution):
|
||||
|
||||
* [Gina Häußge](https://github.com/foosel)
|
||||
* [Thomas Sanladerer](https://github.com/imitation)
|
||||
* [Alex Ustyantsev](https://github.com/hudbrog)
|
||||
* [Andrew Dalgleish](https://github.com/ajd4096)
|
||||
* [Dale Price](https://github.com/daprice)
|
||||
* [Václav "ax" Hůla](https://github.com/AxTheB)
|
||||
* [Tom Perry](https://github.com/daftscience)
|
||||
* [Andreas Gohr](https://github.com/splitbrain)
|
||||
* [Lars Norpchen](https://github.com/norpchen)
|
||||
* [Marlon Wünnemann](https://github.com/marwue)
|
||||
* ["algspd"](https://github.com/algspd)
|
||||
* [Peter Uithoven](https://github.com/peteruithoven)
|
||||
* [Bryan Mayland](https://github.com/CapnBry)
|
||||
* [Ross Hendrickson](https://github.com/savorywatt)
|
||||
* [Dan Lipsitt](https://github.com/DanLipsitt)
|
||||
* [James Gao](https://github.com/jamesgao)
|
||||
* [Tonnerre Lombard](https://github.com/tonnerre)
|
||||
* [Marc Hannappel](https://github.com/Salandora)
|
||||
* [Brad Pitcher](https://github.com/brad)
|
||||
* [Gabe Rosenhouse](https://github.com/rosenhouse)
|
||||
* [chriskoz](https://github.com/chriskoz)
|
||||
* [Ilya Novoselov](https://github.com/nullie)
|
||||
* [Corey C](https://github.com/C-o-r-E)
|
||||
* [Jarek Szczepanski](https://github.com/imrahil)
|
||||
* [Jon Nordby](https://github.com/jonnor)
|
||||
* [Aaron Bieber](https://github.com/qbit)
|
||||
* [Guy Sheffer](https://github.com/guysoft)
|
||||
* [Dattas Moonchaser](https://github.com/dattas)
|
||||
* [Pim Rutgers](https://github.com/Booli)
|
||||
* [Koen Kooi](https://github.com/koenkooi)
|
||||
* [Colin Wallace](https://github.com/Wallacoloo)
|
||||
* [Michael Ang](https://github.com/mangtronix)
|
||||
* [Philipp Engel](https://github.com/nosyjoe)
|
||||
* [Giles Hall](https://github.com/vishnubob)
|
||||
* [Bevaz](https://github.com/Bevaz)
|
||||
* [Bortek](https://github.com/bortek)
|
||||
* [Rob Speed](https://github.com/rspeed)
|
||||
* [Renha](https://github.com/Renha)
|
||||
* [Antoine Bertin](https://github.com/Diaoul)
|
||||
* [Teja Philipp](https://github.com/hungerpirat)
|
||||
* ["matobago"](https://github.com/matobago)
|
||||
* ["nophead"](https://github.com/nophead)
|
||||
* [Bob Clough](https://github.com/thinkl33t)
|
||||
* [Mikk Kiilaspää](https://github.com/Mikk36)
|
||||
* [Jack Minardi](https://github.com/jminardi)
|
||||
* [Mark Walker](https://github.com/markwal)
|
||||
* [Lucas Clemente](https://github.com/lucas-clemente)
|
||||
* [Andrew Erickson](https://github.com/aerickson)
|
||||
* [Nicanor Romero Venier](https://github.com/nicanor-romero)
|
||||
* [Thomas Hou](https://github.com/masterhou)
|
||||
* [Mark Bastiaans](https://github.com/markbastiaans)
|
||||
* [Kevin Murphy](https://github.com/kevingelion)
|
||||
* [Richard Joyce](https://github.com/richjoyce)
|
||||
* ["bwgan"](https://github.com/bwgan)
|
||||
* [Siim Raud](https://github.com/2ndalpha)
|
||||
* ["geoporalis"](https://github.com/geoporalis)
|
||||
* [Andrew Malota](https://github.com/2bitoperations)
|
||||
* [Kyle Evans](https://github.com/kevans91)
|
||||
* [Ovidiu Hossu](https://github.com/MoonshineSG)
|
||||
|
||||
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
|
||||
[Daid Braam](https://github.com/daid). Parts of its communication layer and
|
||||
the server side GCODE interpreter are still based on Cura's code base from
|
||||
December 2012 and hence on the work of its authors up until then.
|
||||
@@ -0,0 +1,404 @@
|
||||
# Contribution Guidelines
|
||||
|
||||
This document outlines what you need to know before **[creating tickets](#issues-tickets-however-you-may-call-them)**
|
||||
or **[creating pull requests](#pull-requests)**.
|
||||
|
||||
## Contents
|
||||
|
||||
* [Issues, Tickets, however you may call them](#issues-tickets-however-you-may-call-them)
|
||||
* [How to file a bug report](#how-to-file-a-bug-report)
|
||||
* [What should I do before submitting a bug report?](#what-should-i-do-before-submitting-a-bug-report)
|
||||
* [What should I include in a bug report?](#what-should-i-include-in-a-bug-report)
|
||||
* [Where can I find which version and branch I'm on?](#where-can-i-find-which-version-and-branch-im-on)
|
||||
* [Where can I find those log files you keep talking about?](#where-can-i-find-those-log-files-you-keep-talking-about)
|
||||
* [Where can I find my browser's error console?](#where-can-i-find-my-browsers-error-console)
|
||||
* [Pull requests](#pull-requests)
|
||||
* [What do the branches mean?](#what-do-the-branches-mean)
|
||||
* [How OctoPrint is versioned](#how-octoprint-is-versioned)
|
||||
* [History](#history)
|
||||
* [Footnotes](#footnotes)
|
||||
|
||||
## Issues, Tickets, however you may call them
|
||||
|
||||
Please read the following short instructions fully and follow them. You can
|
||||
help the project tremendously this way: not only do you help the maintainers
|
||||
to **address problems in a timely manner** but also keep it possible for them
|
||||
to **fix bugs, add new and improve on existing functionality** instead of doing
|
||||
nothing but ticket management.
|
||||
|
||||

|
||||
|
||||
- **[Read the FAQ](https://github.com/foosel/OctoPrint/wiki/FAQ)**
|
||||
- If you want to report a **bug**, [read "How to file a bug report" below](#how-to-file-a-bug-report)
|
||||
and *[use the provided template](#what-should-i-include-in-a-ticket)*.
|
||||
You do not need to do anything else with your ticket.
|
||||
- If you want to post a **feature request** or a **documentation request**, add `[Request]`
|
||||
to your issue's title (e.g. `[Request] Awesome new feature`). A question on how to run/change/setup
|
||||
something is **not** what qualifies as a request here, use the
|
||||
[Mailinglist](https://groups.google.com/group/octoprint) or the
|
||||
[Google+ Community](https://plus.google.com/communities/102771308349328485741) for
|
||||
such support issues.
|
||||
- If you are a **developer** that wants to brainstorm a pull request or possible
|
||||
changes to the plugin system, add [Brainstorming] to your issue's title (e.g.
|
||||
`[Brainstorming] New plugin hook for doing some cool stuff`).
|
||||
- If you need **support**, have a **question** or some **other reason** that
|
||||
doesn't fit any of the above categories, the issue tracker is not the right place.
|
||||
Consult the [Mailinglist](https://groups.google.com/group/octoprint) or the
|
||||
[Google+ Community](https://plus.google.com/communities/102771308349328485741) instead.
|
||||
|
||||
No matter what kind of ticket you create, never mix two or more "ticket reasons"
|
||||
into one ticket: One ticket per bug, request, brainstorming thread please.
|
||||
|
||||
----
|
||||
|
||||
**Note**: A bot is in place that monitors new tickets, automatically
|
||||
categorizes them and checks new bug reports for usage of the provided template.
|
||||
That bot will only bother you if you open a ticket that appears to be a bug (no
|
||||
`[Request]` or `[Brainstorming]` in the title) without the template, and it
|
||||
will do that only to ensure that all information needed to solve the issue is
|
||||
available for the maintainers to directly start tackling that problem.
|
||||
|
||||
----
|
||||
|
||||
## How to file a bug report
|
||||
|
||||
If you encounter an issue with OctoPrint, you are welcome to
|
||||
[submit a bug report](https://github.com/foosel/OctoPrint/issues/new).
|
||||
|
||||
Before you do that for the first time though please take a moment to read the
|
||||
following section *completely* and also follow the instructions in the
|
||||
"new issue" form. Thank you! :)
|
||||
|
||||
### What should I do before submitting a bug report?
|
||||
|
||||
1. **Make sure you are at the right location**. This is the Github repository
|
||||
of the official version of OctoPrint, which is the 3D print server and
|
||||
corresponding web interface itself.
|
||||
|
||||
**This is not the Github respository of OctoPi**, which is the preconfigured
|
||||
Raspberry Pi image including OctoPrint among other things - that one can be found
|
||||
[here](https://github.com/guysoft/OctoPi). Please note that while we do have
|
||||
some entries regarding OctoPi in the FAQ, any bugs should be reported in the
|
||||
[proper bug tracker](https://github.com/guysoft/OctoPi/issues) which - again -
|
||||
is not here.
|
||||
|
||||
**This is also not the Github repository of any OctoPrint Plugins you
|
||||
might have installed**. Report any issues with those in their corresponding
|
||||
bug tracker (probably linked to from the plugin's homepage).
|
||||
|
||||
Finally, **this is also not the right issue tracker if you are running a
|
||||
forked version of OctoPrint**. Seek help for such unofficial versions from
|
||||
the people maintaining them instead.
|
||||
|
||||
2. Please make sure to **test out the current version** of OctoPrint to see
|
||||
whether the problem you are encountering still exists, and **test without
|
||||
any non-bundled plugins enabled** to make sure it's not a misbehaving
|
||||
plugin causing the issue at hand.
|
||||
|
||||
If you are feeling up to it you might also want to try the current development
|
||||
version of OctoPrint (if you aren't already). Refer to the [FAQ](https://github.com/foosel/OctoPrint/wiki/FAQ)
|
||||
for information on how to do this.
|
||||
|
||||
3. The problem still exists? Then please **look through the
|
||||
[existing tickets](https://github.com/foosel/OctoPrint/issues?state=open)
|
||||
(use the [search](https://github.com/foosel/OctoPrint/search?q=&ref=cmdform&type=Issues))**
|
||||
to check if there already exists a report of the issue you are encountering.
|
||||
Sorting through duplicates of the same issue sometimes causes more work than
|
||||
fixing it. Take the time to filter through possible duplicates and be really
|
||||
sure that your problem definitely is a new one. Try more than one search query
|
||||
(e.g. do not only search for "webcam" if you happen to run into an issue
|
||||
with your webcam, also search for "timelapse" etc). Do not only read the subject lines
|
||||
of tickets that look like they might be related, but also read the ticket itself!
|
||||
|
||||
**Very important:** Please make absolutely sure that if you find a bug that looks like
|
||||
it is the same as your's, it actually behaves the same as your's. E.g. if someone gives steps
|
||||
to reproduce his bug that looks like your's, reproduce the bug like that if possible,
|
||||
and only add a "me too" if you actually can reproduce the same
|
||||
issue. Also **provide all information** as [described below](#what-should-i-include-in-a-bug-report)
|
||||
and whatever was additionally requested over the course of the ticket
|
||||
even if you "only" add to an existing ticket. The more information available regarding a bug, the higher
|
||||
the chances of reproducing and solving it. But "me too" on an actually unrelated ticket
|
||||
makes it more difficult due to on top of having to figure out the original problem
|
||||
there's now also a [red herring](https://en.wikipedia.org/wiki/Red_herring) interfering - so please be
|
||||
very diligent here!
|
||||
|
||||
### What should I include in a bug report?
|
||||
|
||||
First of all make sure your use **a descriptive title**. "It doesn't work"
|
||||
and similar unspecific complaints are NOT descriptive titles.
|
||||
|
||||
**Always use the following template** (please remove what's within `[...]`, that's
|
||||
only provided here as some additional information for you), **even if only adding a
|
||||
"me too" to an existing ticket**:
|
||||
|
||||
#### What were you doing?
|
||||
|
||||
[Please be as specific as possible here. The maintainers will need to
|
||||
reproduce your issue in order to fix it and that is not possible if they
|
||||
don't know what you did to get it to happen in the first place.
|
||||
|
||||
If you encountered a problem with specific files of any sorts, make sure
|
||||
to also include a link to a file with which to reproduce the problem.]
|
||||
|
||||
#### What did you expect to happen?
|
||||
|
||||
#### What happened instead?
|
||||
|
||||
#### Branch & Commit or Version of OctoPrint
|
||||
|
||||
[Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.]
|
||||
|
||||
#### Printer model & used firmware incl. version
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Browser and Version of Browser, Operating System running Browser
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
|
||||
#### Link to octoprint.log
|
||||
|
||||
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.]
|
||||
|
||||
#### Link to contents of terminal tab or serial.log
|
||||
|
||||
[On gist.github.com or pastebin.com. If applicable, always include if unsure or
|
||||
reporting communication issues. Never truncate.
|
||||
|
||||
serial.log is usually not written due to performance reasons and must be
|
||||
enabled explicitly. Provide at the very least the FULL contents of your
|
||||
terminal tab at the time of the bug occurrence, even if you do not have
|
||||
a serial.log.]
|
||||
|
||||
#### Link to contents of Javascript console in the browser
|
||||
|
||||
[On gist.github.com or pastebin.com or alternatively a screenshot. If applicable -
|
||||
always include if unsure or reporting UI issues.]
|
||||
|
||||
#### Screenshot(s) showing the problem:
|
||||
|
||||
[If applicable. Always include if unsure or reporting UI issues.]
|
||||
|
||||
I have read the FAQ.
|
||||
|
||||
Copy-paste this template **completely**. Do not skip any lines or the bot
|
||||
*will* complain!
|
||||
|
||||
### Where can I find which version and branch I'm on?
|
||||
|
||||
You can find out all of them by taking a look into the lower left corner of the
|
||||
OctoPrint UI:
|
||||
|
||||

|
||||
|
||||
If you don't have access to the UI you can find out that information via the
|
||||
command line as well. Either `octoprint --version` or `python setup.py version`
|
||||
in OctoPrint's folder will tell you the version of OctoPrint you are running
|
||||
(note: if it doesn't then you are running a version older than 1.1.0,
|
||||
*upgrade now*). A `git branch` in your OctoPrint installation folder will mark
|
||||
the branch you are on with a little *. `git rev-parse HEAD` will tell you the
|
||||
current commit.
|
||||
|
||||
### Where can I find those log files you keep talking about?
|
||||
|
||||
OctoPrint by default provides two log outputs, a third one can be enabled if
|
||||
more information is needed.
|
||||
|
||||
One is contained in the **"Terminal" tab** within OctoPrint's UI and is a log
|
||||
of the last 300 lines of communication with the printer. Please copy-paste
|
||||
this *completely* somewhere (disable auto scroll to make copying the contents easier) -
|
||||
e.g. http://pastebin.com or http://gist.github.com - and include a link in
|
||||
your bug report.
|
||||
|
||||
There is also **OctoPrint's application log file** or in short `octoprint.log`,
|
||||
which is by default located at `~/.octoprint/logs/octoprint.log` on Linux,
|
||||
`%APPDATA%\OctoPrint\logs\octoprint.log` on Windows and
|
||||
`~/Library/Application Support/OctoPrint/logs/octoprint.log` on MacOS. You can
|
||||
also access it directly through OctoPrint via Settings > Logs. Please
|
||||
copy-paste this *completely* to pastebin or gist as well and include a link in your bug
|
||||
report.
|
||||
|
||||
It might happen that you are asked to provide a more **thorough log of the
|
||||
communication with the printer** if you haven't already done so, the `serial.log`.
|
||||
This is not written by default due to performance reasons, but you can enable
|
||||
it in the settings dialog. After enabling that log, please reproduce the problem
|
||||
again (connect to the printer, do whatever triggers it), then copy-paste
|
||||
`~/.octoprint/logs/serial.log` (Windows: `%APPDATA%\OctoPrint\logs\serial.log`,
|
||||
MacOS: `~/Library/Application Support/OctoPrint/logs/serial.log`) to pastebin
|
||||
or gist and include the link in the bug report.
|
||||
|
||||
You might also be asked to provide a log with an increased log level. You can
|
||||
find information on how to do just that in the
|
||||
[docs](http://docs.octoprint.org/en/master/configuration/logging_yaml.html).
|
||||
|
||||
### Where can I find my browser's error console?
|
||||
|
||||
See [How to open the Javascript Console in different browsers](https://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers)
|
||||
|
||||
## Pull requests
|
||||
|
||||
1. If you want to add a new feature to OctoPrint, **please always first
|
||||
consider if it wouldn't be better suited for a plugin.** As a general rule
|
||||
of thumb, any feature that is only of interest to a small sub group should
|
||||
be moved into a plugin. If the current plugin system doesn't allow you to
|
||||
implement your feature as a plugin, create a "Brainstorming" ticket to get
|
||||
the discussion going on how best to solve *this* in OctoPrint's plugin
|
||||
system - maybe that's the actual PR you have been waiting for to contribute :)
|
||||
2. If you plan to make **any large or otherwise disruptive changes to the
|
||||
code or appearance, please open a "Brainstorming" ticket first** so
|
||||
that we can determine if it's a good time for your specific pull
|
||||
request. It might be that we're currently in the process of making
|
||||
heavy changes to the code locations you'd target as well, or your
|
||||
approach doesn't fit the general "project vision", and that would
|
||||
just cause unnecessary work and frustration for everyone or
|
||||
possibly get the PR rejected.
|
||||
3. Create your pull request **from a custom branch** on your end (e.g.
|
||||
`dev/myNewFeature`)[1] **against the `devel` branch**. Create **one pull request
|
||||
per feature/bug fix**. If your PR contains an important bug fix, we will
|
||||
make sure to backport it to the `maintenance` branch to also include it in
|
||||
the next release.
|
||||
4. Make sure there are **only relevant changes** included in your PR. No
|
||||
changes to unrelated files, no additional files that don't belong (e.g.
|
||||
commits of your full virtual environment). Make sure your PR consists
|
||||
**ideally of only one commit** (use git's rebase and squash functionality).
|
||||
5. Make sure you **follow the current coding style**. This means:
|
||||
* Tabs instead of spaces in the Python files[2]
|
||||
* Spaces instead of tabs in the Javascript sources
|
||||
* English language (code, variables, comments, ...)
|
||||
* Comments where necessary: Tell *why* the code does something like it does
|
||||
it, structure your code
|
||||
* Following the general architecture
|
||||
* If your PR needs to make changes to the Stylesheets, change the
|
||||
``.less`` files from which the CSS is compiled.
|
||||
* Make sure you do not add dead code (e.g. commented out left-overs
|
||||
from experiments).
|
||||
6. Ensure your changes **pass the existing unit tests**. PRs that break
|
||||
those cannot be accepted.
|
||||
7. **Test your changes thoroughly**. That also means testing with usage
|
||||
scenarios you don't normally use, e.g. if you only use access control, test
|
||||
without and vice versa. If you only test with your printer, test with the
|
||||
virtual printer and vice versa. State in your pull request how your tested
|
||||
your changes. Ideally **add unit tests** - OctoPrint severly lacks in that
|
||||
department, but we are trying to change that, so any new code already covered
|
||||
with a test suite helps a lot!
|
||||
8. In your pull request's description, **state what your pull request does**,
|
||||
as in, what feature does it implement, what bug does it fix. The more
|
||||
thoroughly you explain your intent behind the PR here, the higher the
|
||||
chances it will get merged fast. There is a template provided below
|
||||
that can help you here.
|
||||
9. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md)
|
||||
file** :)
|
||||
|
||||
Template to use for Pull Request descriptions:
|
||||
|
||||
```
|
||||
#### What does this PR do and why is it necessary?
|
||||
|
||||
#### How was it tested? How can it be tested by the reviewer?
|
||||
|
||||
#### Any background context you want to provide?
|
||||
|
||||
#### What are the relevant tickets if any?
|
||||
|
||||
#### Screenshots (if appropriate)
|
||||
|
||||
#### Further notes
|
||||
```
|
||||
|
||||
## What do the branches mean?
|
||||
|
||||
There are three main branches in OctoPrint:
|
||||
|
||||
* `master`: The master branch always contains the current stable release. It
|
||||
is *only* updated on new releases. Will have a version number following
|
||||
the scheme `<x>.<y>.<z>` (e.g. `1.2.9`) or - if it's absolutely necessary to
|
||||
add a commit after release to this branch - `<x>.<y>.<z>.post<commits since x.y.z>`
|
||||
(e.g. `1.2.9.post1`).
|
||||
* `maintenance`: Improvements and fixes of the current release that make up
|
||||
the next release go here. More or less continously updated. You can consider
|
||||
this a preview of the next release version. It should be very stable at all
|
||||
times. Anything you spot in here helps tremendously with getting a rock solid
|
||||
next stable release, so if you want to help out development, running the
|
||||
`maintenance` branch and reporting back anything you find is a very good way
|
||||
to do that. Will usually have a version number following the scheme
|
||||
`<x>.<y>.<z+1>.dev<commits since increase of z>` for an OctoPrint version of `<x>.<y>.<z>`
|
||||
(e.g. `1.2.10.dev12`).
|
||||
* `devel`: Ongoing development of new features that will go into the next bigger
|
||||
release (MINOR version number increases) will happen on this branch. Usually
|
||||
kept stable, sometimes stuff can break though or lose backwards compatibility
|
||||
temporarily. Can be considered the "bleeding edge". All PRs should target
|
||||
*this* branch. Important improvements and fixes from PRs here are backported to
|
||||
`maintenance` as needed. Will usually have a version number following the
|
||||
scheme `<x>.<y+1>.0.dev<commits since increase of y>` for a current OctoPrint version
|
||||
of `<x>.<y>.<z>` (e.g. `1.3.0.dev123`).
|
||||
* `rc/maintenance`: This branch is reserved for future releases that have graduated from
|
||||
the `maintenance` branch and are now being pushed on the "Maintenance"
|
||||
pre release channel for further testing. Version number follows the scheme
|
||||
`<x>.<y>.<z>rc<n>` (e.g. `1.2.9rc1`).
|
||||
* `rc/devel`: This branch is reserved for future releases that have graduated from
|
||||
the `devel` branch and are now being pushed on the "Devel" pre release channel
|
||||
for further testing. Version number follows the scheme `<x>.<y+1>.0rc<n>` (e.g. `1.3.0rc1`)
|
||||
for a current stable OctoPrint version of `<x>.<y>.<z>`.
|
||||
|
||||
Additionally, from time to time you might see other branches pop up in the repository.
|
||||
Those usually have one of the following prefixes:
|
||||
|
||||
* `fix/...`: Fixes under development that are to be merged into the `maintenance`
|
||||
and `devel` branches.
|
||||
* `improve/...`: Improvements under development that are to be merged into the
|
||||
`maintenance` and `devel` branches.
|
||||
* `dev/...` or `feature/...`: New functionality under development that is to be merged
|
||||
into the `devel` branch.
|
||||
|
||||
There is also the `gh-pages` branch, which holds OctoPrint's web page, and a couple of
|
||||
older development branches that are slowly being migrated or deleted.
|
||||
|
||||
## How OctoPrint is versioned
|
||||
|
||||
OctoPrint follows the [semantic versioning scheme](http://semver.org/) of **MAJOR.MINOR.PATCH**.
|
||||
|
||||
The **PATCH** version number is the one increasing most often due to OctoPrint's maintenance releases.
|
||||
Releases that only change the patch number indicate that they contain bug fixes and small improvements
|
||||
of existing functionality. Example: 1.2.8 to 1.2.9.
|
||||
|
||||
The **MINOR** version number increases with releases that add a lot of new functionality and
|
||||
large features. Example: 1.2.x to 1.3.0.
|
||||
|
||||
Finally, the **MAJOR** version number increases if there are breaking API changes that concern any of the
|
||||
documented interfaces (REST API, plugin interfaces, ...). So far this hasn't happened. Example: 1.x.y to 2.0.0.
|
||||
|
||||
OctoPrint's version numbers are automatically generated using [versioneer](https://github.com/warner/python-versioneer)
|
||||
and depend on the selected git branch, nearest git tag and commits. The generated version number
|
||||
should always be [PEP440](https://www.python.org/dev/peps/pep-0440/) compatible. Unless a git tag
|
||||
is used for version number determination, the version number will also contain the git hash within
|
||||
the local version identifier to allow for an exact determination of the active code base
|
||||
(e.g. `1.2.9.dev68+g46c7a9c`). Additionally, instances with active uncommitted changes will contain
|
||||
`.dirty` in the local version identifier.
|
||||
|
||||
## History
|
||||
|
||||
* 2015-01-23: More guidelines for creating pull requests, support/questions
|
||||
redirected to Mailinglist/G+ community
|
||||
* 2015-01-27: Added another explicit link to the FAQ
|
||||
* 2015-07-07: Added step to add yourself to AUTHORS when creating a PR :)
|
||||
* 2015-12-01: Heavily reworked to include examples, better structure and
|
||||
all information in one document.
|
||||
* 2016-02-10: Added information about branch structure and versioning.
|
||||
* 2016-02-16: Added requirement to add information from template to existing
|
||||
tickets as well, explained issue with "me too" red herrings.
|
||||
* 2016-03-14: Some more requirements for PRs, and a PR template.
|
||||
* 2016-06-08: New `prerelease` and `rc` branches explained.
|
||||
* 2016-09-09: New `rc/*` branches explained.
|
||||
* 2016-09-23: Some more work on "How to file a bug report" based on recent
|
||||
experiences
|
||||
|
||||
## Footnotes
|
||||
* [1] - If you are wondering why, the problem is that anything that you add
|
||||
to your PR's branch will also become part of your PR, so if you create a
|
||||
PR from your version of `devel` chances are high you'll add changes to the
|
||||
PR that do not belong to the PR.
|
||||
* [2] - Yes, we know that this goes against PEP-8. OctoPrint started out as
|
||||
a fork of Cura and hence stuck to the coding style found therein. Changing
|
||||
it now would make the history and especially `git blame` completely
|
||||
unusable, so for now we'll have to deal with it (this decision might be
|
||||
revisited in the future).
|
||||
@@ -1,2 +1,9 @@
|
||||
recursive-include src/octoprint/static *
|
||||
recursive-include src/octoprint/templates *
|
||||
recursive-include src/octoprint/plugins *
|
||||
recursive-include src/octoprint/translations *
|
||||
include versioneer.py
|
||||
include src/octoprint/_version.py
|
||||
include requirements.txt
|
||||
include *.md
|
||||
exclude CONTRIBUTING.md
|
||||
@@ -1,86 +1,130 @@
|
||||
OctoPrint
|
||||
=========
|
||||
# OctoPrint
|
||||
|
||||
[](https://flattr.com/submit/auto?user_id=foosel&url=https://github.com/foosel/OctoPrint&title=OctoPrint&language=&tags=github&category=software)
|
||||
|
||||
OctoPrint provides a responsive web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It is Free Software
|
||||
OctoPrint provides a snappy web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It is Free Software
|
||||
and released under the [GNU Affero General Public License V3](http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
Its website can be found at [octoprint.org](http://octoprint.org).
|
||||
|
||||
Reporting bugs
|
||||
--------------
|
||||
The documentation is located at [docs.octoprint.org](http://docs.octoprint.org).
|
||||
|
||||
OctoPrint's issue tracker can be found [on Github](https://github.com/foosel/OctoPrint/issues). **Before opening a new
|
||||
ticket please take a look at [this guide on how to file a bug report with OctoPrint](https://github.com/foosel/OctoPrint/wiki/How-to-file-a-bug-report).**
|
||||
The official plugin repository can be reached at [plugins.octoprint.org](http://plugins.octoprint.org).
|
||||
|
||||
Sending pull requests
|
||||
---------------------
|
||||
OctoPrint's development wouldn't be possible without the [financial support by its community](http://octoprint.org/support-octoprint/).
|
||||
If you enjoy OctoPrint, please consider becoming a regular supporter!
|
||||
|
||||
Please create all pull requests against the [devel branch](https://github.com/foosel/OctoPrint/tree/devel) of OctoPrint, as that one is used for developing new
|
||||
features and then merged against master when those features are deemed mature enough for general consumption. In case
|
||||
of bug fixes I'll take care to cherry pick them against master if the bugs they are fixing are critical.
|
||||

|
||||
|
||||
Installation
|
||||
------------
|
||||
You are currently looking at the source code repository of OctoPrint. If you already installed it
|
||||
(e.g. by using the Raspberry Pi targeted distribution [OctoPi](https://github.com/guysoft/OctoPi)) and only
|
||||
want to find out how to use it, [the documentation](http://docs.octoprint.org/) and [the public wiki](https://github.com/foosel/OctoPrint/wiki)
|
||||
might be of more interest for you. You might also want to subscribe to [the mailing list](https://groups.google.com/group/octoprint)
|
||||
or the [G+ Community](https://plus.google.com/communities/102771308349328485741) where there are other active users who might be
|
||||
able to help you with any questions you might have.
|
||||
|
||||
Installation instructions for installing from source for different operating systems can be found [on the wiki](https://github.com/foosel/OctoPrint/wiki#assorted-guides).
|
||||
## Contributing
|
||||
|
||||
Contributions of all kinds are welcome, not only in the form of code but also with regards to the
|
||||
[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), support
|
||||
of other users in the [bug tracker](https://github.com/foosel/OctoPrint/issues),
|
||||
[the Mailinglist](https://groups.google.com/group/octoprint) or
|
||||
[the G+ Community](https://plus.google.com/communities/102771308349328485741) and also [financially](http://octoprint.org/support-octoprint/).
|
||||
|
||||
If you think something is bad about OctoPrint or its documentation the way it is, please help
|
||||
in any way to make it better instead of just complaining about it -- this is an Open Source Project
|
||||
after all :)
|
||||
|
||||
For information about how to go about contributions of any kind, please see the project's
|
||||
[Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md).
|
||||
|
||||
## Installation
|
||||
|
||||
Installation instructions for installing from source for different operating
|
||||
systems can be found [on the wiki](https://github.com/foosel/OctoPrint/wiki#assorted-guides).
|
||||
|
||||
If you want to run OctoPrint on a Raspberry Pi you might want to take a look at [OctoPi](https://github.com/guysoft/OctoPi)
|
||||
which is a custom SD card image that includes OctoPrint plus dependencies.
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
The generic steps that should basically be done regardless of operating system
|
||||
and runtime environment are the following (as *regular
|
||||
user*, please keep your hands *off* of the `sudo` command here!) - this assumes
|
||||
you already have Python 2.7, pip and virtualenv set up on your system:
|
||||
|
||||
OctoPrint depends on a couple of python modules to do its job. Those are listed in requirements.txt and can be
|
||||
installed using `pip`:
|
||||
1. Checkout OctoPrint: `git clone https://github.com/foosel/OctoPrint.git`
|
||||
2. Change into the OctoPrint folder: `cd OctoPrint`
|
||||
3. Create a user-owned virtual environment therein: `virtualenv venv`
|
||||
4. Install OctoPrint *into that virtual environment*: `./venv/bin/python setup.py install`
|
||||
|
||||
pip install -r requirements.txt
|
||||
You may then start the OctoPrint server via `/path/to/OctoPrint/venv/bin/octoprint`, see [Usage](#usage)
|
||||
for details.
|
||||
|
||||
You should also do this after pulling from the repository, since the dependencies might have changed.
|
||||
After installation, please make sure you follow the first-run wizard and set up
|
||||
access control as necessary. If you want to not only be notified about new
|
||||
releases but also be able to automatically upgrade to them from within
|
||||
OctoPrint, take a look [at the documentation of the Software Update Plugin](https://github.com/foosel/OctoPrint/wiki/Plugin:-Software-Update#making-octoprint-updateable-on-existing-installations)
|
||||
and at its settings.
|
||||
|
||||
## Dependencies
|
||||
|
||||
OctoPrint depends on a couple of python modules to do its job. Those are automatically installed when installing
|
||||
OctoPrint via `setup.py`:
|
||||
|
||||
python setup.py install
|
||||
|
||||
You should also do this every time after pulling from the repository, since the dependencies might have changed.
|
||||
|
||||
OctoPrint currently only supports Python 2.7.
|
||||
|
||||
Usage
|
||||
-----
|
||||
## Usage
|
||||
|
||||
Just start the server via
|
||||
Running the `setup.py` script via
|
||||
|
||||
./run
|
||||
python setup.py install
|
||||
|
||||
installs the `octoprint` script in your Python installation's scripts folder
|
||||
(which depending on whether you installed OctoPrint globally or into a virtual env will be on your `PATH` or not). The
|
||||
following usage examples assume that said `octoprint` script is on your `PATH`.
|
||||
|
||||
You can start the server via
|
||||
|
||||
octoprint
|
||||
|
||||
By default it binds to all interfaces on port 5000 (so pointing your browser to `http://127.0.0.1:5000`
|
||||
will do the trick). If you want to change that, use the additional command line parameters `host` and `port`,
|
||||
which accept the host ip to bind to and the numeric port number respectively. If for example you want the server
|
||||
to only listen on the local interface on port 8080, the command line would be
|
||||
|
||||
./run --host=127.0.0.1 --port=8080
|
||||
octoprint --host=127.0.0.1 --port=8080
|
||||
|
||||
Alternatively, the host and port on which to bind can be defined via the configuration.
|
||||
|
||||
If you want to run OctoPrint as a daemon (only supported on Linux), use
|
||||
|
||||
./run --daemon {start|stop|restart} [--pid PIDFILE]
|
||||
octoprint --daemon {start|stop|restart} [--pid PIDFILE]
|
||||
|
||||
If you do not supply a custom pidfile location via `--pid PIDFILE`, it will be created at `/tmp/octoprint.pid`.
|
||||
|
||||
You can also specify the configfile or the base directory (for basing off the `uploads`, `timelapse` and `logs` folders),
|
||||
e.g.:
|
||||
|
||||
./run --config /path/to/another/config.yaml --basedir /path/to/my/basedir
|
||||
octoprint --config /path/to/another/config.yaml --basedir /path/to/my/basedir
|
||||
|
||||
See `run --help` for further information.
|
||||
See `octoprint --help` for further information.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
OctoPrint also ships with a `run` script in its source directory. You can also invoke that to start up the server, it
|
||||
takes the same command line arguments as the `octoprint` script.
|
||||
|
||||
## Configuration
|
||||
|
||||
If not specified via the commandline, the configfile `config.yaml` for OctoPrint is expected in the settings folder,
|
||||
which is located at `~/.octoprint` on Linux, at `%APPDATA%/OctoPrint` on Windows and
|
||||
at `~/Library/Application Support/OctoPrint` on MacOS.
|
||||
|
||||
A comprehensive overview of all available configuration settings can be found
|
||||
[on the wiki](https://github.com/foosel/OctoPrint/wiki/Configuration).
|
||||
[in the docs](http://docs.octoprint.org/en/master/configuration/config_yaml.html).
|
||||
Please note that the most commonly used configuration settings can also easily
|
||||
be edited from OctoPrint's settings dialog.
|
||||
|
||||
Setup on a Raspberry Pi running Raspbian
|
||||
----------------------------------------
|
||||
## Special Thanks
|
||||
|
||||
A comprehensive setup guide can be found [on the wiki](https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian).
|
||||
Cross-browser testing services are kindly provided by [BrowserStack](http://www.browserstack.com/).
|
||||
Profiling is done with the help of [PyVmMonitor](http://www.pyvmmonitor.com).
|
||||
@@ -0,0 +1,73 @@
|
||||
# Supporters
|
||||
|
||||
Development of this version of OctoPrint wouldn't have been possible without
|
||||
[financial support by the community](http://octoprint.org/support-octoprint/) -
|
||||
thanks to everyone who contributed!
|
||||
|
||||
## Patreon Patrons
|
||||
|
||||
* 3D Moniak
|
||||
* Aleph Objects, Inc.
|
||||
* Andrew Moorby
|
||||
* Arnljot Arntsen
|
||||
* Aurelio Bernal
|
||||
* Bart Zudell
|
||||
* Boris Hussein
|
||||
* Brad Jackson
|
||||
* Brad Mooneyham
|
||||
* Brent Fiegle
|
||||
* Brian E. Tyler
|
||||
* Charles Mitchell
|
||||
* Christopher Day
|
||||
* Christian Petropolis
|
||||
* COLLE+McVOY
|
||||
* CreativeTools
|
||||
* D Brian Kimmel
|
||||
* DeltaMaker 3D Printers
|
||||
* Doug Johnson
|
||||
* E3D BigBox
|
||||
* Erik de Bruijn
|
||||
* Ernesto Martinez
|
||||
* Exovite
|
||||
* Frank Sander
|
||||
* Gary Deen
|
||||
* Gary N McKinney
|
||||
* George Robles
|
||||
* J. Eckert
|
||||
* Jason Galarneau
|
||||
* Josh Daniels
|
||||
* Joshua David Gregory
|
||||
* Kaile Riser
|
||||
* Kale Stedman
|
||||
* Kazuhiro Ogura
|
||||
* Lamin Kivelä
|
||||
* M Khorakiwala
|
||||
* Makespace Madrid
|
||||
* Mark Qvist
|
||||
* Mark Walker
|
||||
* Masayoshi Mitsui
|
||||
* Michael Aumock
|
||||
* Michael McDargh Sr
|
||||
* Miles Flavel
|
||||
* Noe Ruiz
|
||||
* Patrick McGinnis
|
||||
* Peter Grace
|
||||
* Peter Schmehl
|
||||
* PRINT3Dforum.com
|
||||
* Robert Gusek
|
||||
* Roger Strolz
|
||||
* Roy Cortes
|
||||
* Samer Najia
|
||||
* SD3D
|
||||
* SeeMeCNC
|
||||
* Shane Ekerbicer
|
||||
* Simon Hallam
|
||||
* Stefan Krister
|
||||
* Stephane Schittly
|
||||
* Steven Pearson
|
||||
* Sven Mueller
|
||||
* Terrance Shaw
|
||||
* Thomas Hatley
|
||||
* Trent Shumay
|
||||
|
||||
and 989 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
|
||||
@@ -0,0 +1,55 @@
|
||||
# Third Party Licenses
|
||||
|
||||
## Web Interface
|
||||
|
||||
* [AVLTree](https://gist.github.com/viking/2424106) (modified): GPL, LGPL (dual licensed)
|
||||
* [Babel JavaScript Support](https://github.com/mitsuhiko/babel/blob/master/contrib/babel.js): BSD
|
||||
* [Bootstrap](http://getbootstrap.com/): Apache License 2.0
|
||||
* [Bootstrap Modal](http://jschr.github.io/bootstrap-modal/): Apache License 2.0
|
||||
* [Bootstrap Slider Knockout Bindings](https://github.com/cosminstefanxp/bootstrap-slider-knockout-binding): MIT
|
||||
* [Bootstrap Slider](http://seiyria.com/bootstrap-slider/): Apache License 2.0
|
||||
* [Bootstrap Tabdrop](http://www.eyecon.ro/bootstrap-tabdrop): Apache License 2.0
|
||||
* [Detect Mobile Browser](http://detectmobilebrowsers.com/): Public Domain
|
||||
* [Flot](http://www.flotcharts.org/): MIT
|
||||
* [JavaScript MD5](https://github.com/blueimp/JavaScript-MD5): MIT
|
||||
* [JQuery](http://jquery.com/): MIT
|
||||
* [JQuery Bootstrap Wizard](http://github.com/VinceG/twitter-bootstrap-wizard): MIT, GPL (dual licensed)
|
||||
* [JQuery File Upload](https://github.com/blueimp/jQuery-File-Upload): MIT
|
||||
* [JQuery iframe transport](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js): MIT
|
||||
* [JQuery QRCode](http://larsjung.de/jquery-qrcode/): MIT
|
||||
* [JQuery Slimscroll](http://rocha.la/jQuery-slimScroll): MIT, GPL (dual licensed)
|
||||
* [JQuery UI Core, Mouse, Slider and Widget](http://jqueryui.com): MIT
|
||||
* [Knockout](http://knockoutjs.com/): MIT
|
||||
* [LESS](http://lesscss.org): Apache License 2.0
|
||||
* [lodash](https://lodash.com): MIT
|
||||
* [Loglevel](https://github.com/pimterry/loglevel): MIT
|
||||
* [Modernizr](http://modernizr.com): MIT
|
||||
* [Moment.js](http://momentjs.com/): MIT
|
||||
* [PNotify](http://sciactive.com/pnotify/): GPL, LGPL, MPL (triple licensed)
|
||||
* [pusher.color.js](http://cache.preserve.io/5g18q0pw/index.html) (original link dead): MIT
|
||||
* [SockJS](https://github.com/sockjs/sockjs-client): MIT
|
||||
* [sprintf-js](http://alexei.ro/): BSD
|
||||
|
||||
## Server
|
||||
|
||||
* [feedparser](https://github.com/kurtmckee/feedparser): BSD
|
||||
* [Flask](http://flask.pocoo.org/): BSD
|
||||
* [Flask-Assets](http://github.com/miracle2k/flask-assets): BSD
|
||||
* [Flask-Babel](http://github.com/mitsuhiko/flask-babel): BSD
|
||||
* [Flask-Login](https://github.com/maxcountryman/flask-login): MIT
|
||||
* [Flask-Markdown](http://github.com/dcolish/flask-markdown): BSD
|
||||
* [Flask-Principal](http://packages.python.org/Flask-Principal/): MIT
|
||||
* [netaddr](https://github.com/drkjam/netaddr/): BSD
|
||||
* [netifaces](https://bitbucket.org/al45tair/netifaces): MIT
|
||||
* [pkginfo](http://pypi.python.org/pypi/pkginfo/): Python
|
||||
* [psutil](https://github.com/giampaolo/psutil): BSD
|
||||
* [pylru](https://github.com/jlhutch/pylru): GPLv2
|
||||
* [pyserial](http://pyserial.sourceforge.net/): Python
|
||||
* [PyYAML](http://pyyaml.org/wiki/PyYAML): MIT
|
||||
* [requests](http://python-requests.org/): Apache License 2.0
|
||||
* [rsa](http://stuvel.eu/rsa): Apache License 2.0
|
||||
* [sarge](http://sarge.readthedocs.org/): BSD
|
||||
* [semantic_version](https://github.com/rbarrois/python-semanticversion): BSD
|
||||
* [SockJS-Tornado](http://github.com/mrjoes/sockjs-tornado/): MIT
|
||||
* [Tornado](http://www.tornadoweb.org/): Apache License 2.0
|
||||
* [watchdog](http://github.com/gorakhargosh/watchdog): Apache License 2.0
|
||||
@@ -0,0 +1,8 @@
|
||||
[python: src/octoprint/**.py]
|
||||
[jinja2: src/octoprint/templates/**.jinja2]
|
||||
[jinja2: src/octoprint/plugins/**.jinja2]
|
||||
extensions=jinja2.ext.autoescape, jinja2.ext.with_, webassets.ext.jinja2.AssetsExtension
|
||||
|
||||
[javascript: src/octoprint/static/js/app/**.js]
|
||||
[javascript: src/octoprint/plugins/**.js]
|
||||
extract_messages = gettext, ngettext
|
||||
@@ -0,0 +1,54 @@
|
||||
/* override table width restrictions */
|
||||
.wy-table-responsive table td, .wy-table-responsive table th {
|
||||
/* !important prevents the common CSS stylesheets from
|
||||
overriding this as on RTD they are loaded after this stylesheet */
|
||||
white-space: normal !important;
|
||||
}
|
||||
|
||||
.wy-table-responsive {
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
/* style headlink for code block captions like other headlinks */
|
||||
.code-block-caption .headerlink {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
font-size: 14px;
|
||||
font-family: inherit;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.code-block-caption:hover .headerlink {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.code-block-caption .headerlink:after {
|
||||
visibility: visible;
|
||||
content: "\f0c1";
|
||||
font-family: FontAwesome;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* make whitespace visualization in code listings not appear on same vertical position as dashes */
|
||||
.highlight .w {
|
||||
vertical-align: 10%;
|
||||
}
|
||||
|
||||
/* make code tags non-red again */
|
||||
code,
|
||||
.rst-content tt {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
a code,
|
||||
.rst-content a tt {
|
||||
color: #2980B9 !important;
|
||||
}
|
||||
|
||||
a:visited code,
|
||||
.rst-content a:visited tt {
|
||||
color: #9B59B6 !important;
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
.. _sec-api-apps:
|
||||
|
||||
****
|
||||
Apps
|
||||
****
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-apps-sessionkey:
|
||||
|
||||
Session Keys
|
||||
============
|
||||
|
||||
OctoPrint offers a special API key type for apps to use, the so called App Session Key. These keys have a time based
|
||||
validity and are generated by OctoPrint for requesting apps.
|
||||
|
||||
Obtaining those keys is based on a handshake procedure backed by cryptographic signatures using RSA. OctoPrint needs to
|
||||
be aware of apps and their associated public keys (this can be achieved either via entries in ``config.yaml`` or by
|
||||
installing app specific plugins which implement the ``AppPlugin`` type).
|
||||
|
||||
Apps can be registered within OctoPrint via ``config.yaml`` by adding them to the ``api`` > ``apps`` section, using the
|
||||
application's id concatenated with its version as key, with the public key provided as item ``pubkey`` (stripped of the
|
||||
``BEGIN RSA PUBLIC KEY`` and ``END RSA PUBLIC KEY`` separators and also newlines) and optionally also whether the app is
|
||||
enabled or not (defaults to enabled, so can be left out if it's not to be set to disabled explicitly).
|
||||
|
||||
Example:
|
||||
|
||||
.. sourcecode:: yaml
|
||||
|
||||
api:
|
||||
apps:
|
||||
"com.example.my_octoprint_app:0.9":
|
||||
pubkey: MEgCQQDYkr5Fv/YXK5ZL1uwRN4A61IagZaYLGqJ5JJGFo8wDrmpAMRqE9kK4+5hIDblC5DzfEr5oP7OA3tRO48Rf5yInAgMBAAE=
|
||||
enabled: false
|
||||
"com.example.my_octoprint_app:1.0":
|
||||
pubkey: MEgCQQCIWfi7Nc8bcnfZJJtA6a4RyMC+sKBlMOb25OVNNB4L2v0TiGO72jVKR4osvb4oztlbRW5GkdiY0T2LJcfDYvkJAgMBAAE=
|
||||
|
||||
In the example, the app ``com.example.my_octoprint_app`` in version 0.9 has been disabled (e.g. due to the key having
|
||||
leaked) whereas version 1.0 is fully registered with OctoPrint and may verify app session keys.
|
||||
|
||||
|
||||
.. _sec-api-apps-sessionkey-workflow:
|
||||
|
||||
Workflow
|
||||
--------
|
||||
|
||||
Apps perform the handshake by first requesting a temporary key with very limited validity,
|
||||
then sending a message back to OctoPrint containing their id, version, the temporary key and a signature created with their
|
||||
private key over these three pieces of data. OctoPrint then tries to verify the signature and if successful unlocks the
|
||||
key to be used as a fully recognized API key.
|
||||
|
||||
For performing the handshake a special API exists within OctoPrint for which no API key is needed which is described below.
|
||||
|
||||
.. _sec-api-apps-sessionkey-get:
|
||||
|
||||
Obtaining a temporary session key
|
||||
---------------------------------
|
||||
|
||||
.. http:get:: /apps/auth
|
||||
|
||||
Retrieve a temporary session key with a minimum validity. It can only be used as a proper API key after having been
|
||||
:ref:`verified <sec-api-apps-sessionkey-verify>`.
|
||||
|
||||
Returns the temporary session key and the timestamp until it's valid.
|
||||
|
||||
**Example**:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /apps/auth HTTP/1.1
|
||||
Host: example.com
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"unverifiedKey": "F43A844750F74AD080FE9F438D47B33C",
|
||||
"validUntil": 1416220357.011
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-apps-sessionkey-verify:
|
||||
|
||||
Verifying a temporary session key
|
||||
---------------------------------
|
||||
|
||||
.. http:post:: /apps/auth
|
||||
|
||||
Verify a formerly :ref:`retrieved <sec-api-apps-sessionkey-get>` temporary session key by providing credentials and a
|
||||
cryptographic signature over these credentials and the temporary key.
|
||||
|
||||
Returns the now verified session key and the new validity.
|
||||
|
||||
**Example**:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /apps/auth HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"appid": "com.example.my_octoprint_app",
|
||||
"appversion": "1.0",
|
||||
"key": "F43A844750F74AD080FE9F438D47B33C",
|
||||
"_sig": "LGVCiolQWDc4AVn1DOcWljY0cFQxWF4pldVveUjjmL9JhiL0LnCKBbGwZ/CwKBWswFAxPaxQ0kDusVdOmCUa/w=="
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"key": "F43A844750F74AD080FE9F438D47B33C",
|
||||
"validUntil": 1416227497.011
|
||||
}
|
||||
|
||||
.. _sec-api-apps-sessionkey-signature:
|
||||
|
||||
Creating the signature
|
||||
----------------------
|
||||
|
||||
The signature is created by concatenating the ``appid``, ``appversion`` and ``key`` fields, separated by a ``:`` (colon),
|
||||
signing the result with the app's private key using SHA-1 and then BASE64-encoding the result, stripping newlines.
|
||||
|
||||
Example for signature generation using Python and the `Python RSA library <https://pypi.python.org/pypi/rsa>`_:
|
||||
|
||||
.. sourcecode:: python
|
||||
|
||||
import base64
|
||||
import rsa
|
||||
|
||||
appid = "com.example.my_octoprint_app"
|
||||
version = "1.0"
|
||||
unverified_key = "F43A844750F74AD080FE9F438D47B33C"
|
||||
message_to_sign = appid + ":" + version + ":" + unverified_key
|
||||
// => "com.example.my_octoprint_app:1.0:F43A844750F74AD080FE9F438D47B33C"
|
||||
|
||||
private_key = rsa.PrivateKey.load_pkcs1("...")
|
||||
signature = base64.encodestring(rsa.sign(message_to_sign, private_key, "SHA-1")).replace("\n", "")
|
||||
// => "LGVCiolQWDc4AVn1DOcWljY0cFQxWF4pldVveUjjmL9JhiL0LnCKBbGwZ/CwKBWswFAxPaxQ0kDusVdOmCUa/w=="
|
||||
|
||||
|
||||
.. _sec-api-apps-sessionkey-testing:
|
||||
|
||||
Testing your implementation
|
||||
---------------------------
|
||||
|
||||
If you want to use app session keys, here is the key pair with which the above examples were created, in order for you
|
||||
to verify your signature implementation::
|
||||
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBPQIBAAJBAIhZ+Ls1zxtyd9kkm0DprhHIwL6woGUw5vbk5U00Hgva/ROIY7va
|
||||
NUpHiiy9vijO2VtFbkaR2JjRPYslx8Ni+QkCAwEAAQJARK4lFo+FEcs3yR2iQjEy
|
||||
p+yaAbNQJ4hZXlVvltLAYICzOM3kyKx53/eKU59NjskLz9q6QxfleymYPWAgl4NW
|
||||
fQIjAJVH8MjwNcaAquTM9z2OiFi3OC8WgaKOi5W/T+r2+B70wG8CHwDp08dqOZ/u
|
||||
xcBiy4Wzpcme9bckqoVuS3gWMm+YqgcCIwCMFU07kkY0NyumtzxPdIA4F/7OGSWf
|
||||
IHqWFEfvasAddHlbAh8A5UgkB3Zf7Bt+7aFSBnlvve6FWm/XDPL12xYztYgrAiIa
|
||||
W3miN6FjIm+8TDowrk+nyYXG2GZefeY7QXOjYr6tlDn0
|
||||
-----END RSA PRIVATE KEY-----
|
||||
|
||||
-----BEGIN RSA PUBLIC KEY-----
|
||||
MEgCQQCIWfi7Nc8bcnfZJJtA6a4RyMC+sKBlMOb25OVNNB4L2v0TiGO72jVKR4os
|
||||
vb4oztlbRW5GkdiY0T2LJcfDYvkJAgMBAAE=
|
||||
-----END RSA PUBLIC KEY-----
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
.. _sec-api-connection:
|
||||
|
||||
*******************
|
||||
Connection handling
|
||||
*******************
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-connection-current:
|
||||
|
||||
Get connection settings
|
||||
=======================
|
||||
|
||||
.. http:get:: /api/connection
|
||||
|
||||
Retrieve the current connection settings, including information regarding the available baudrates and
|
||||
serial ports and the current connection state.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/connection HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"current": {
|
||||
"state": "Operational",
|
||||
"port": "/dev/ttyACM0",
|
||||
"baudrate": 250000,
|
||||
"printerProfile": "_default"
|
||||
},
|
||||
"options": {
|
||||
"ports": ["/dev/ttyACM0", "VIRTUAL"],
|
||||
"baudrates": [250000, 230400, 115200, 57600, 38400, 19200, 9600],
|
||||
"printerProfiles": [{"name": "Default", id: "_default"}],
|
||||
"portPreference": "/dev/ttyACM0",
|
||||
"baudratePreference": 250000,
|
||||
"printerProfilePreference": "_default",
|
||||
"autoconnect": true
|
||||
}
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-connection-command:
|
||||
|
||||
Issue a connection command
|
||||
==========================
|
||||
|
||||
.. http:post:: /api/connection
|
||||
|
||||
Issue a connection command. Currently available command are:
|
||||
|
||||
connect
|
||||
Instructs OctoPrint to connect to the printer. Additional parameters are:
|
||||
|
||||
* ``port``: Optional, specific port to connect to. If not set the current ``portPreference`` will be used, or if
|
||||
no preference is available auto detection will be attempted.
|
||||
* ``baudrate``: Optional, specific baudrate to connect with. If not set the current ``baudratePreference`` will
|
||||
be used, or if no preference is available auto detection will be attempted.
|
||||
* ``printerProfile`` Optional, specific printer profile to use for connection. If not set the current default printer
|
||||
profile will be used.
|
||||
* ``save``: Optional, whether to save the request's ``port`` and ``baudrate`` settings as new preferences. Defaults
|
||||
to ``false`` if not set.
|
||||
* ``autoconnect``: Optional, whether to automatically connect to the printer on OctoPrint's startup in the future.
|
||||
If not set no changes will be made to the current configuration.
|
||||
|
||||
disconnect
|
||||
Instructs OctoPrint to disconnect from the printer.
|
||||
|
||||
fake_ack
|
||||
Fakes an acknowledgement message for OctoPrint in case one got lost on the serial line and the communication
|
||||
with the printer since stalled. This should only be used in "emergencies" (e.g. to save prints), the reason
|
||||
for the lost acknowledgement should always be properly investigated and removed instead of depending on this
|
||||
"symptom solver".
|
||||
|
||||
**Example Connect Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/connection HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "connect",
|
||||
"port": "/dev/ttyACM0",
|
||||
"baudrate": 115200,
|
||||
"printerProfile": "my_printer_profile",
|
||||
"save": true,
|
||||
"autoconnect": true
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Disconnect Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/connection HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "disconnect"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example FakeAck Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/connection HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "fake_ack"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``connect``, ``disconnect`` or ``fake_ack``.
|
||||
:json string port: ``connect`` command: The port to connect to. If left out either the existing ``portPreference``
|
||||
will be used, or if that is not available OctoPrint will attempt auto detection. Must be part
|
||||
of the available ports.
|
||||
:json number baudrate: ``connect`` command: The baudrate to connect with. If left out either the existing
|
||||
``baudratePreference`` will be used, or if that is not available OctoPrint will attempt
|
||||
autodetection. Must be part of the available baudrates.
|
||||
:json string printerProfile: ``connect`` command: The id of the printer profile to use for the connection. If left out the current
|
||||
default printer profile will be used. Must be part of the available printer profiles.
|
||||
:json boolean save: ``connect`` command: Whether to save the supplied connection settings as the new preference.
|
||||
Defaults to ``false`` if not set.
|
||||
:json boolean autoconnect: ``connect`` command: Whether to attempt to automatically connect to the printer on server
|
||||
startup. If not set no changes will be made to the current setting.
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: If the selected `port` or `baudrate` for a ``connect`` command are not part of the available
|
||||
options.
|
||||
@@ -0,0 +1,359 @@
|
||||
.. _sec-api-datamodel:
|
||||
|
||||
*****************
|
||||
Common data model
|
||||
*****************
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-datamodel-printer:
|
||||
|
||||
Printer related
|
||||
===============
|
||||
|
||||
.. _sec-api-datamodel-printer-state:
|
||||
|
||||
Printer State
|
||||
-------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``text``
|
||||
- 1
|
||||
- String
|
||||
- A textual representation of the current state of the printer, e.g. "Operational" or "Printing"
|
||||
* - ``flags``
|
||||
- 1
|
||||
- Printer state flags
|
||||
- A couple of boolean printer state flags
|
||||
* - ``flags.operational``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is operational, ``false`` otherwise
|
||||
* - ``flags.paused``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is currently paused, ``false`` otherwise
|
||||
* - ``flags.printing``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is currently printing, ``false`` otherwise
|
||||
* - ``flags.sdReady``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer's SD card is available and initialized, ``false`` otherwise. This is redundant information
|
||||
to :ref:`the SD State <sec-api-printer-datamodel-sdstate>`.
|
||||
* - ``flags.error``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if an unrecoverable error occurred, ``false`` otherwise
|
||||
* - ``flags.ready``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is operational and no data is currently being streamed to SD, so ready to receive instructions
|
||||
* - ``flags.closedOrError``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is disconnected (possibly due to an error), ``false`` otherwise
|
||||
|
||||
.. _sec-api-datamodel-printer-tempdata:
|
||||
|
||||
Temperature Data
|
||||
----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``actual``
|
||||
- 1
|
||||
- Number
|
||||
- Current temperature
|
||||
* - ``target``
|
||||
- 1
|
||||
- Number
|
||||
- Target temperature, may be ``null`` if no target temperature is set.
|
||||
* - ``offset``
|
||||
- 0..1
|
||||
- Number
|
||||
- Currently configured temperature offset to apply, will be left out for historic temperature information.
|
||||
|
||||
.. _sec-api-datamodel-printer-temphistory:
|
||||
|
||||
Historic Temperature Data Point
|
||||
-------------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``time``
|
||||
- 1
|
||||
- Unix Timestamp
|
||||
- Timestamp of this data point
|
||||
* - ``tool{n}``
|
||||
- 0..*
|
||||
- :ref:`Temperature Data <sec-api-datamodel-printer-tempdata>`
|
||||
- Temperature stats for tool *n*. Enumeration starts at 0 for the first tool. Not included if querying only
|
||||
bed state.
|
||||
* - ``bed``
|
||||
- 0..*
|
||||
- :ref:`Temperature Data <sec-api-datamodel-printer-tempdata>`
|
||||
- Temperature stats for the printer's heated bed. Not included if querying only tool state.
|
||||
|
||||
.. _sec-api-datamodel-printer-tempoffset:
|
||||
|
||||
Temperature offset
|
||||
------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``tool{n}``
|
||||
- 0..1
|
||||
- Number
|
||||
- Temperature offset for tool *n*. Enumeration starts at 0 for the first tool.
|
||||
* - ``bed``
|
||||
- 0..1
|
||||
- Number
|
||||
- Temperature offset for the printer's heated bed.
|
||||
|
||||
|
||||
.. _sec-api-datamodel-jobs:
|
||||
|
||||
Job related
|
||||
===========
|
||||
|
||||
.. _sec-api-datamodel-jobs-job:
|
||||
|
||||
Job information
|
||||
---------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``file``
|
||||
- 1
|
||||
- :ref:`File information (abridged) <sec-api-datamodel-files-file>`
|
||||
- The file that is the target of the current print job
|
||||
* - ``estimatedPrintTime``
|
||||
- 0..1
|
||||
- Integer
|
||||
- The estimated print time for the file, in seconds.
|
||||
* - ``lastPrintTime``
|
||||
- 0..1
|
||||
- Integer
|
||||
- The print time of the last print of the file, in seconds.
|
||||
* - ``filament``
|
||||
- 0..1
|
||||
- Object
|
||||
- Information regarding the estimated filament usage of the print job
|
||||
* - ``filament.length``
|
||||
- 0..1
|
||||
- Integer
|
||||
- Length of filament used, in mm
|
||||
* - ``filament.volume``
|
||||
- 0..1
|
||||
- Float
|
||||
- Volume of filament used, in cm³
|
||||
|
||||
.. _sec-api-datamodel-jobs-progress:
|
||||
|
||||
Progress information
|
||||
--------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``completion``
|
||||
- 1
|
||||
- Float
|
||||
- Percentage of completion of the current print job
|
||||
* - ``filepos``
|
||||
- 1
|
||||
- Integer
|
||||
- Current position in the file being printed, in bytes from the beginning
|
||||
* - ``printTime``
|
||||
- 1
|
||||
- Integer
|
||||
- Time already spent printing, in seconds
|
||||
* - ``printTimeLeft``
|
||||
- 1
|
||||
- Integer
|
||||
- Estimate of time left to print, in seconds
|
||||
|
||||
.. _sec-api-datamodel-files:
|
||||
|
||||
File related
|
||||
============
|
||||
|
||||
.. todo::
|
||||
|
||||
Update to reflect enhanced data now available.
|
||||
|
||||
.. _sec-api-datamodel-files-file:
|
||||
|
||||
File information
|
||||
----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file
|
||||
* - ``type``
|
||||
- 1
|
||||
- String
|
||||
- Type of file. ``model`` or ``machinecode``. Or ``folder`` if it's a folder, in which case the ``children``
|
||||
node will be populated
|
||||
|
||||
Additional properties depend on ``type``. For a ``type`` value of ``folder``, see "Folders". For any other value
|
||||
see "Files".
|
||||
|
||||
Folders
|
||||
'''''''
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``children``
|
||||
- 0..*
|
||||
- Array of :ref:`File information items <sec-api-datamodel-files-file>`
|
||||
- Contained children for entries of type ``folder``
|
||||
|
||||
Files
|
||||
'''''
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``hash``
|
||||
- 1
|
||||
- String
|
||||
- MD5 hash of the file
|
||||
* - ``size``
|
||||
- 0..1
|
||||
- Number
|
||||
- The size of the file in bytes. Only available for ``local`` files or ``sdcard`` files if the printer
|
||||
supports file sizes for sd card files.
|
||||
* - ``date``
|
||||
- 0..1
|
||||
- Unix timestamp
|
||||
- The timestamp when this file was uploaded. Only available for ``local`` files.
|
||||
* - ``origin``
|
||||
- 1
|
||||
- String, either ``local`` or ``sdcard``
|
||||
- The origin of the file, ``local`` when stored in OctoPrint's ``uploads`` folder, ``sdcard`` when stored on the
|
||||
printer's SD card (if available)
|
||||
* - ``refs``
|
||||
- 0..1
|
||||
- :ref:`sec-api-datamodel-files-ref`
|
||||
- References relevant to this file, left out in abridged version
|
||||
* - ``gcodeAnalysis``
|
||||
- 0..1
|
||||
- :ref:`GCODE analysis information <sec-api-datamodel-files-gcodeanalysis>`
|
||||
- Information from the analysis of the GCODE file, if available. Left out in abridged version.
|
||||
|
||||
.. _sec-api-datamodel-files-gcodeanalysis:
|
||||
|
||||
GCODE analysis information
|
||||
--------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``estimatedPrintTime``
|
||||
- 0..1
|
||||
- Integer
|
||||
- The estimated print time of the file, in seconds
|
||||
* - ``filament``
|
||||
- 0..1
|
||||
- Object
|
||||
- The estimated usage of filament
|
||||
* - ``filament.length``
|
||||
- 0..1
|
||||
- Integer
|
||||
- The length of filament used, in mm
|
||||
* - ``filament.volume``
|
||||
- 0..1
|
||||
- Float
|
||||
- The volume of filament used, in cm³
|
||||
|
||||
|
||||
.. _sec-api-datamodel-files-ref:
|
||||
|
||||
References
|
||||
----------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``resource``
|
||||
- 1
|
||||
- URL
|
||||
- The resource that represents the file (e.g. for issuing commands to or for deleting)
|
||||
* - ``download``
|
||||
- 0..1
|
||||
- URL
|
||||
- The download URL for the file
|
||||
* - ``model``
|
||||
- 0..1
|
||||
- URL
|
||||
- The model from which this file was generated (e.g. an STL, currently not used)
|
||||
|
||||
@@ -0,0 +1,541 @@
|
||||
.. _sec-api-fileops:
|
||||
|
||||
***************
|
||||
File operations
|
||||
***************
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-fileops-retrieveall:
|
||||
|
||||
Retrieve all files
|
||||
==================
|
||||
|
||||
.. http:get:: /api/files
|
||||
|
||||
Retrieve information regarding all files currently available and regarding the disk space still available
|
||||
locally in the system.
|
||||
|
||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example**:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/files HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"files": [
|
||||
{
|
||||
"name": "whistle_v2.gcode",
|
||||
"size": 1468987,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
|
||||
"download": "http://example.com/downloads/files/local/whistle_v2.gcode"
|
||||
},
|
||||
"gcodeAnalysis": {
|
||||
"estimatedPrintTime": 1188,
|
||||
"filament": {
|
||||
"length": 810,
|
||||
"volume": 5.36
|
||||
}
|
||||
},
|
||||
"print": {
|
||||
"failure": 4,
|
||||
"success": 23,
|
||||
"last": {
|
||||
"date": 1387144346,
|
||||
"success": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "whistle_.gco",
|
||||
"origin": "sdcard",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/sdcard/whistle_.gco"
|
||||
}
|
||||
}
|
||||
],
|
||||
"free": "3.2GB"
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-fileops-retrievelocation:
|
||||
|
||||
Retrieve files from specific location
|
||||
=====================================
|
||||
|
||||
.. http:get:: /api/files/(string:location)
|
||||
|
||||
Retrieve information regarding the files currently available on the selected `location` and -- if targeting
|
||||
the ``local`` location -- regarding the disk space still available locally in the system.
|
||||
|
||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example**:
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/files/local HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"files": [
|
||||
{
|
||||
"name": "whistle_v2.gcode",
|
||||
"size": 1468987,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
|
||||
"download": "http://example.com/downloads/files/local/whistle_v2.gcode"
|
||||
},
|
||||
"gcodeAnalysis": {
|
||||
"estimatedPrintTime": 1188,
|
||||
"filament": {
|
||||
"length": 810,
|
||||
"volume": 5.36
|
||||
}
|
||||
},
|
||||
"print": {
|
||||
"failure": 4,
|
||||
"success": 23,
|
||||
"last": {
|
||||
"date": 1387144346,
|
||||
"success": true
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"free": "3.2GB"
|
||||
}
|
||||
|
||||
:param location: The origin location from which to retrieve the files. Currently only ``local`` and ``sdcard`` are
|
||||
supported, with ``local`` referring to files stored in OctoPrint's ``uploads`` folder and ``sdcard``
|
||||
referring to files stored on the printer's SD card (if available).
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If `location` is neither ``local`` nor ``sdcard``
|
||||
|
||||
.. _sec-api-fileops-uploadfile:
|
||||
|
||||
Upload file
|
||||
===========
|
||||
|
||||
.. http:post:: /api/files/(string:location)
|
||||
|
||||
Upload a file to the selected `location`.
|
||||
|
||||
Other than most of the other requests on OctoPrint's API which are expected as JSON, this request is expected as
|
||||
``Content-Type: multipart/form-data`` due to the included file upload.
|
||||
|
||||
Returns a :http:statuscode:`201` response with a ``Location`` header set to the management URL of the uploaded
|
||||
file and an :ref:`Upload Response <sec-api-fileops-datamodel-uploadresponse>` as the body upon successful completion.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/files/sdcard HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Disposition: form-data; name="file"; filename="whistle_v2.gcode"
|
||||
Content-Type: application/octet-stream
|
||||
|
||||
M109 T0 S220.000000
|
||||
T0
|
||||
G21
|
||||
G90
|
||||
...
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Disposition: form-data; name="select"
|
||||
|
||||
true
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Disposition: form-data; name="print"
|
||||
|
||||
true
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC--
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
Location: http://example.com/api/files/sdcard/whistle_v2.gcode
|
||||
|
||||
{
|
||||
"files": {
|
||||
"local": {
|
||||
"name": "whistle_v2.gcode",
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
|
||||
"download": "http://example.com/downloads/files/local/whistle_v2.gcode"
|
||||
}
|
||||
},
|
||||
"sdcard": {
|
||||
"name": "whistle_.gco",
|
||||
"origin": "sdcard",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/sdcard/whistle_.gco"
|
||||
}
|
||||
}
|
||||
},
|
||||
"done": false
|
||||
}
|
||||
|
||||
**Example with UTF-8 encoded filename following RFC 5987**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/files/local HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC
|
||||
Content-Disposition: form-data; name="file"; filename*=utf-8''20mm-%C3%BCml%C3%A4ut-b%C3%B6x.gcode
|
||||
Content-Type: application/octet-stream
|
||||
|
||||
M109 T0 S220.000000
|
||||
T0
|
||||
G21
|
||||
G90
|
||||
...
|
||||
------WebKitFormBoundaryDeC2E3iWbTv1PwMC--
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
Location: http://example.com/api/files/local/20mm-umlaut-box.gcode
|
||||
|
||||
{
|
||||
"files": {
|
||||
"local": {
|
||||
"name": "20mm-umlaut-box",
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
|
||||
"download": "http://example.com/downloads/files/local/whistle_v2.gcode"
|
||||
}
|
||||
}
|
||||
},
|
||||
"done": true
|
||||
}
|
||||
|
||||
:param location: The target location to which to upload the file. Currently only ``local`` and ``sdcard`` are supported
|
||||
here, with ``local`` referring to OctoPrint's ``uploads`` folder and ``sdcard`` referring to
|
||||
the printer's SD card. If an upload targets the SD card, it will also be stored locally first.
|
||||
:form file: The file to upload, including a valid ``filename``.
|
||||
:form select: Whether to select the file directly after upload (``true``) or not (``false``). Optional, defaults
|
||||
to ``false``.
|
||||
:form print: Whether to start printing the file directly after upload (``true``) or not (``false``). If set, `select`
|
||||
is implicitely ``true`` as well. Optional, defaults to ``false``.
|
||||
:form userdata: [Optional] An optional string that if specified will be interpreted as JSON and then saved along
|
||||
with the file as metadata (metadata key ``userdata``)
|
||||
:statuscode 201: No error
|
||||
:statuscode 400: If no `file` is included in the request, `userdata` was provided but could not be parsed as JSON
|
||||
or the request is otherwise invalid.
|
||||
:statuscode 404: If `location` is neither ``local`` nor ``sdcard`` or trying to upload to SD card and SD card support
|
||||
is disabled
|
||||
:statuscode 409: If the upload of the file would override the file that is currently being printed or if an upload
|
||||
to SD card was requested and the printer is either not operational or currently busy with a print job.
|
||||
:statuscode 415: If the file is neither a ``gcode`` nor an ``stl`` file (or it is an ``stl`` file but slicing support
|
||||
is disabled)
|
||||
:statuscode 500: If the upload failed internally
|
||||
|
||||
.. _sec-api-fileops-retrievefileinfo:
|
||||
|
||||
Retrieve a specific file's information
|
||||
======================================
|
||||
|
||||
.. http:get:: /api/files/(string:location)/(path:filename)
|
||||
|
||||
Retrieves the selected file's information.
|
||||
|
||||
If the file is unknown, a :http:statuscode:`404` is returned.
|
||||
|
||||
On success, a :http:statuscode:`200` is returned, with a :ref:`file information item <sec-api-datamodel-files-file>`
|
||||
as the response body.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/files/local/whistle_v2.gcode HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "whistle_v2.gcode",
|
||||
"size": 1468987,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
|
||||
"download": "http://example.com/downloads/files/local/whistle_v2.gcode"
|
||||
},
|
||||
"gcodeAnalysis": {
|
||||
"estimatedPrintTime": 1188,
|
||||
"filament": {
|
||||
"length": 810,
|
||||
"volume": 5.36
|
||||
}
|
||||
},
|
||||
"print": {
|
||||
"failure": 4,
|
||||
"success": 23,
|
||||
"last": {
|
||||
"date": 1387144346,
|
||||
"success": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:param location: The location of the file for which to retrieve the information, either ``local`` or ``sdcard``.
|
||||
:param filename: The filename of the file for which to retrieve the information
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If `target` is neither ``local`` nor ``sdcard``, ``sdcard`` but SD card support is disabled or the
|
||||
requested file was not found
|
||||
|
||||
.. _sec-api-fileops-filecommand:
|
||||
|
||||
Issue a file command
|
||||
====================
|
||||
|
||||
.. http:post:: /api/files/(string:target)/(path:filename)
|
||||
|
||||
Issue a file command to an existing file. Currently supported commands are:
|
||||
|
||||
select
|
||||
Selects a file for printing. Additional parameters are:
|
||||
|
||||
* ``print``: Optional, if set to ``true`` the file will start printing directly after selection. If the printer
|
||||
is not operational when this parameter is present and set to ``true``, the request will fail with a response
|
||||
of ``409 Conflict``.
|
||||
|
||||
slice
|
||||
Slices an STL file into GCODE. Note that this is an asynchronous operation that will take place in the background
|
||||
after the response has been sent back to the client. Additional parameters are:
|
||||
|
||||
* ``slicer``: The slicing engine to use, defaults to ``cura`` if not set, which is also the only supported slicer right now.
|
||||
* ``gcode``: Name of the GCODE file to generated, in the same location as the STL file. Defaults to the STL file name
|
||||
with extension ``.gco`` if not set.
|
||||
* ``position``: Position of the object-to-slice's center on the print bed. A dictionary containing both ``x`` and ``y``
|
||||
coordinate in mm is expected
|
||||
* ``printerProfile``: Name of the printer profile to use, if not set the default printer profile will be used.
|
||||
* ``profile``: Name of the slicing profile to use, if not set the default slicing profile of the slicer will be used.
|
||||
* ``profile.*``: Override parameters, the ``profile.`` prefix will be stripped and the matching profile key will
|
||||
be overridden with the supplied value. Use this if you want to specify things that change often like a different
|
||||
temperature, filament diameter or infill percentage. Profile keys are slicer specific.
|
||||
* ``select``: Optional, if set to ``true`` the file be selected for printing right after the slicing has finished. If the
|
||||
printer is not operational or already printing when this parameter is present and set to ``true``, the request will
|
||||
fail with a response of ``409 Conflict``
|
||||
* ``print``: Optional, if set to ``true`` the file be selected and start printing right after the slicing has finished.
|
||||
If the printer is not operational or already printing when this parameter is present and set to ``true``, the request
|
||||
will fail with a response of ``409 Conflict``. Note that if this parameter is set, the parameter ``select`` does not
|
||||
need to be set, it is automatically assumed to be ``true`` too, otherwise no printing would be possible.
|
||||
|
||||
If consecutive slicing calls are made targeting the same GCODE filename (that also holds true if the default is used),
|
||||
the slicing job already running in the background will be cancelled before the new one is started. Note that this will
|
||||
also mean that if it was supposed to be directly selected and start printing after the slicing finished, this will not
|
||||
take place anymore and whether this will happen with the new sliced file depends entirely on the new request!
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned, unless specified otherwise.
|
||||
|
||||
**Example Select Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/files/local/whistle_v2.gcode HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "select",
|
||||
"print": true
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Slice Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/files/local/some_model.stl HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "slice",
|
||||
"slicer": "cura",
|
||||
"gcode": "some_model.first_try.gcode",
|
||||
"printerProfile": "my_custom_reprap",
|
||||
"profile": "high_quality",
|
||||
"profile.infill": 75,
|
||||
"profile.fill_density": 15,
|
||||
"position": {"x": 100, "y": 100},
|
||||
"print": true
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 202 Accepted
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"origin": "local",
|
||||
"name": "some_model.first_try.gcode",
|
||||
"refs": {
|
||||
"download": "http://example.com/downloads/files/local/some_model.first_try.gcode",
|
||||
"resource": "http://example.com/api/files/local/some_model.first_try.gcode"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
:param target: The target location on which the file to send the command for is located, either
|
||||
``local`` (for OctoPrint's ``uploads`` folder) or ``sdcard`` for the printer's SD card
|
||||
(if available)
|
||||
:param filename: The filename of the file for which to issue the command
|
||||
:json string command: The command to issue for the file, currently only ``select`` is supported
|
||||
:json boolean print: ``select`` and ``slice`` command: Optional, whether to start printing the file directly after selection
|
||||
or slicing, defaults to ``false``.
|
||||
:json string slicer: ``slice`` command: The slicer to use, defaults to the default slicer.
|
||||
:json string gcode: ``slice`` command: The name of the gcode file to create, defaults to the targeted stl's file name
|
||||
with its extension changed to ``.gco`` (e.g. "test.stl" will be sliced to "test.gco" if not specified
|
||||
otherwise)
|
||||
:json string profile: ``slice`` command: The slicing profile to use, defaults to the selected slicer's default profile.
|
||||
:json string profile.*: ``slice`` command: Overrides for the selected slicing profile, e.g. to specify a different temperature
|
||||
or filament diameter.
|
||||
:json string printerProfile: ``slice`` command: The printer profile to use, defaults to the default printer profile.
|
||||
:json boolean select: ``slice`` command: Optional, whether to select the file for printing directly after slicing,
|
||||
defaults to ``false``
|
||||
:statuscode 200: No error for a ``select`` command.
|
||||
:statuscode 202: No error for a ``slice`` command.
|
||||
:statuscode 400: If the ``command`` is unknown or the request is otherwise invalid
|
||||
:statuscode 415: If a ``slice`` command was issued against something other than an STL file.
|
||||
:statuscode 404: If `target` is neither ``local`` nor ``sdcard`` or the requested file was not found
|
||||
:statuscode 409: If a selected file is supposed to start printing directly but the printer is not operational or
|
||||
if a file to be sliced is supposed to be selected or start printing directly but the printer
|
||||
is not operational or already printing.
|
||||
|
||||
.. _sec-api-fileops-delete:
|
||||
|
||||
Delete file
|
||||
===========
|
||||
|
||||
.. http:delete:: /api/files/(string:target)/(path:filename)
|
||||
|
||||
Delete the selected `filename` on the selected `target`.
|
||||
|
||||
If the file to be deleted is currently being printed, a :http:statuscode:`409` will be returned.
|
||||
|
||||
Returns a :http:statuscode:`204` after successful deletion.
|
||||
|
||||
**Example Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
DELETE /api/files/local/whistle_v2.gcode HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
:param target: The target location on which to delete the file, either ``local`` (for OctoPrint's ``uploads``
|
||||
folder) or ``sdcard`` for the printer's SD card (if available)
|
||||
:param filename: The filename of the file to delete
|
||||
:statuscode 204: No error
|
||||
:statuscode 404: If `target` is neither ``local`` nor ``sdcard`` or the requested file was not found
|
||||
:statuscode 409: If the file to be deleted is currently being printed
|
||||
|
||||
.. _sec-api-fileops-datamodel:
|
||||
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-fileops-datamodel-retrieveresponse:
|
||||
|
||||
Retrieve response
|
||||
-----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``files``
|
||||
- 0..*
|
||||
- Array of :ref:`File information items <sec-api-datamodel-files-file>`
|
||||
- The list of requested files. Might be an empty list if no files are available
|
||||
* - ``free``
|
||||
- 0..1
|
||||
- String
|
||||
- The amount of disk space in bytes available in the local disk space (refers to OctoPrint's ``uploads`` folder). Only
|
||||
returned if file list was requested for origin ``local`` or all origins.
|
||||
|
||||
.. _sec-api-fileops-datamodel-uploadresponse:
|
||||
|
||||
Upload response
|
||||
---------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``files``
|
||||
- 1
|
||||
- Object
|
||||
- Abridged information regarding the file that was just uploaded. If only uploaded to ``local`` this will only
|
||||
contain the ``local`` property. If uploaded to SD card, this will contain both ``local`` and ``sdcard`` properties.
|
||||
* - ``files.local``
|
||||
- 1
|
||||
- :ref:`sec-api-datamodel-files-file`
|
||||
- The information regarding the file that was just uploaded to the local storage (only the fields ``name``,
|
||||
``origin`` and ``refs`` will be set).
|
||||
* - ``files.sdcard``
|
||||
- 0..1
|
||||
- :ref:`sec-api-datamodel-files-file`
|
||||
- The information regarding the file that was just uploaded to the printer's SD card (only the fields ``name``,
|
||||
``origin`` and ``refs`` will be set).
|
||||
* - ``done``
|
||||
- 1
|
||||
- Boolean
|
||||
- Whether the file processing after upload has already finished (``true``) or not, e.g. due to first needing
|
||||
to perform a slicing step (``false``). Clients may use this information to direct progress displays related to
|
||||
the upload.
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
.. _sec-api-general:
|
||||
|
||||
*******************
|
||||
General information
|
||||
*******************
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-general-authorization:
|
||||
|
||||
Authorization
|
||||
=============
|
||||
|
||||
OctoPrint's API expects an API key to be supplied with each request. This API key can be either the globally
|
||||
configured one, a user specific one if "Access Control" is enabled or an ref:`App Session Key <sec-api-apps-sessionkey>`.
|
||||
Users are able to generate and revoke their custom API key via the "Change password" dialog.
|
||||
|
||||
The API key must be supplied in the custom HTTP header ``X-Api-Key``, e.g.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/files HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
If it is missing or included but invalid, OctoPrint will directly return a response with status :http:statuscode:`401`.
|
||||
|
||||
For testing purposes it is also possible to supply the API key via a query parameter ``apikey``, e.g.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/files?apikey=abcdef... HTTP/1.1
|
||||
Host: example.com
|
||||
|
||||
Please be advised that clients should use the header field variant if at all possible.
|
||||
|
||||
.. _fig-api-general-globalapikey:
|
||||
.. figure:: ../images/settings-global-api-key.png
|
||||
:align: center
|
||||
:alt: Global API key in the API settings
|
||||
|
||||
The global API key can be found in the "API" settings
|
||||
|
||||
.. _fig-api-general-userapikey:
|
||||
.. figure:: ../images/settings-user-api-key.png
|
||||
:align: center
|
||||
:alt: User specific API key location in user list
|
||||
|
||||
The user list in the "Access Control" settings shows the API key for users (if available)
|
||||
|
||||
.. _fig-api-general-changepassword:
|
||||
.. figure:: ../images/change-password-api-key.png
|
||||
:align: center
|
||||
:alt: API key options in "Change password" dialog
|
||||
|
||||
The API key options in the "Change password" dialog. Users can generate and revoke their custom API key here.
|
||||
|
||||
.. note::
|
||||
OctoPrint's web interface uses a custom API key that is freshly generated on every server start. This key is not
|
||||
intended to be used by any other client and would not be very useful in any case, since it basically represents
|
||||
a completely anonymous client.
|
||||
|
||||
.. _sec-api-general-contenttype:
|
||||
|
||||
Content Type
|
||||
============
|
||||
|
||||
If not otherwise stated OctoPrint's API expects request bodies and issues response bodies as ``Content-Type: application/json``.
|
||||
|
||||
.. _sec-api-general-encoding:
|
||||
|
||||
Encoding
|
||||
========
|
||||
|
||||
OctoPrint uses UTF-8 as charset.
|
||||
|
||||
That also includes headers in ``multipart/form-data`` requests, in order to allow the full UTF-8 range of characters
|
||||
for uploaded filenames. If a ``multipart/form-data`` sub header cannot be decoded as UTF-8, OctoPrint will also attempt
|
||||
to decode it as ISO-8859-1.
|
||||
|
||||
Additionally, OctoPrint supports replacing the ``filename`` field in the ``Content-Disposition`` header of a
|
||||
multipart field with a ``filename*`` field following `RFC 5987, Section 3.2 <https://tools.ietf.org/html/rfc5987#section-3.2>`_,
|
||||
which allows defining the charset used for encoding the filename. If both ``filename`` and ``filename*`` fields are
|
||||
present, following the recommendation of the RFC ``filename*`` will be used.
|
||||
|
||||
For an example on how to send a request utilizing RFC 5987 for the ``filename*`` attribute, see the second example
|
||||
in :ref:`Upload file <sec-api-fileops-uploadfile>`.
|
||||
|
||||
.. _sec-api-general-crossorigin:
|
||||
|
||||
Cross-origin requests
|
||||
=====================
|
||||
|
||||
To make use of the OctoPrint API from websites other than the OctoPrint web interface,
|
||||
cross-origin resource sharing (`CORS <http://en.wikipedia.org/wiki/Cross-origin_resource_sharing>`_) must be enabled.
|
||||
This is the case even when the website in question is served from a different port on the same machine and on localhost.
|
||||
|
||||
To enable this feature, set the ``allowCrossOrigin`` key of the ``api`` section in ``config.yml`` to ``true`` or
|
||||
check the corresponding checkbox in the API settings dialog.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
api:
|
||||
enabled: true
|
||||
key: ...
|
||||
allowCrossOrigin: true
|
||||
|
||||
.. _fig-api-general-apicors:
|
||||
.. figure:: ../images/settings-api-cors.png
|
||||
:align: center
|
||||
:alt: CORS configuration in the API settings
|
||||
|
||||
Support for CORS can be enabled in the "API" settings
|
||||
|
||||
.. note::
|
||||
This means any browser page can send requests to the OctoPrint API. Authorization is still required however.
|
||||
|
||||
If CORS is not enabled you will get errors like the following::
|
||||
|
||||
XMLHttpRequest cannot load http://localhost:8081/api/files. No 'Access-Control-Allow-Origin'
|
||||
header is present on the requested resource.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
.. _sec-api:
|
||||
|
||||
########
|
||||
REST API
|
||||
########
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
general.rst
|
||||
version.rst
|
||||
apps.rst
|
||||
fileops.rst
|
||||
connection.rst
|
||||
printer.rst
|
||||
printerprofiles.rst
|
||||
job.rst
|
||||
logs.rst
|
||||
slicing.rst
|
||||
push.rst
|
||||
datamodel.rst
|
||||
@@ -0,0 +1,241 @@
|
||||
.. _sec-api-jobs:
|
||||
|
||||
**************
|
||||
Job operations
|
||||
**************
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-jobs-command:
|
||||
|
||||
Issue a job command
|
||||
===================
|
||||
|
||||
.. http:post:: /api/job
|
||||
|
||||
Job commands allow starting, pausing and cancelling print jobs. Available commands are:
|
||||
|
||||
start
|
||||
Starts the print of the currently selected file. For selecting a file, see :ref:`Issue a file command <sec-api-fileops-filecommand>`.
|
||||
If a print job is already active, a :http:statuscode:`409` will be returned.
|
||||
|
||||
cancel
|
||||
Cancels the current print job. If no print job is active (either paused or printing), a :http:statuscode:`409`
|
||||
will be returned.
|
||||
|
||||
restart
|
||||
Restart the print of the currently selected file from the beginning. There must be an active print job for this to work
|
||||
and the print job must currently be paused. If either is not the case, a :http:statuscode:`409` will be returned.
|
||||
|
||||
Equivalent to issuing a ``cancel`` command while paused, directly followed by a ``start`` command.
|
||||
|
||||
pause
|
||||
Pauses/resumes/toggles the current print job. Accepts one optional additional parameter ``action``
|
||||
specifying which action to take. Valid values for this parameter are:
|
||||
|
||||
pause
|
||||
Pauses the current job if it's printing, does nothing if it's already paused.
|
||||
resume
|
||||
Resumes the current job if it's paused, does nothing if it's printing.
|
||||
toggle
|
||||
Toggles the pause state of the job, pausing it if it's printing and resuming it if it's currently paused.
|
||||
|
||||
In order to stay backwards compatible to earlier iterations of this API, the default
|
||||
action to take if no ``action`` parameter is supplied is to toggle the print job status.
|
||||
|
||||
If no print job is active (either paused or printing), a :http:statuscode:`409` will be returned.
|
||||
|
||||
.. note::
|
||||
|
||||
While the approach to implement pause/resume/toggle behaviour through sub commands via the ``action``
|
||||
parameter instead of having dedicated ``pause``, ``resume`` and ``toggle`` commands seems clumsy, this path
|
||||
was chosen to have the API stay backwards compatible to prior versions which only offered the toggle
|
||||
behaviour under the ``pause`` command.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
**Example Start Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "start"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Cancel Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "cancel"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Restart Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "restart"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Pause Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "pause",
|
||||
"action": "pause"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Resume Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "pause",
|
||||
"action": "resume"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Pause Toggle Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/job HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "pause",
|
||||
"action": "toggle"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``start``, ``restart``, ``pause`` or ``cancel``
|
||||
:statuscode 204: No error
|
||||
:statuscode 409: If the printer is not operational or the current print job state does not match the preconditions
|
||||
for the command.
|
||||
|
||||
.. _sec-api-job-information:
|
||||
|
||||
Retrieve information about the current job
|
||||
==========================================
|
||||
|
||||
.. http:get:: /api/job
|
||||
|
||||
Retrieve information about the current job (if there is one).
|
||||
|
||||
Returns a :http:statuscode:`200` with a :ref:`sec-api-job-datamodel-response` in the body.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/job HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"job": {
|
||||
"file": {
|
||||
"name": "whistle_v2.gcode",
|
||||
"origin": "local",
|
||||
"size": 1468987,
|
||||
"date": 1378847754
|
||||
},
|
||||
"estimatedPrintTime": 8811,
|
||||
"filament": {
|
||||
"length": 810,
|
||||
"volume": 5.36
|
||||
}
|
||||
},
|
||||
"progress": {
|
||||
"completion": 0.2298468264184775,
|
||||
"filepos": 337942,
|
||||
"printTime": 276,
|
||||
"printTimeLeft": 912
|
||||
}
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-job-datamodel:
|
||||
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-job-datamodel-response:
|
||||
|
||||
Job information response
|
||||
------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``job``
|
||||
- 1
|
||||
- :ref:`sec-api-datamodel-jobs-job`
|
||||
- Information regarding the target of the current print job
|
||||
* - ``progress``
|
||||
- 1
|
||||
- :ref:`sec-api-datamodel-jobs-progress`
|
||||
- Information regarding the progress of the current print job
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
.. _sec-api-logs:
|
||||
|
||||
*******************
|
||||
Log file management
|
||||
*******************
|
||||
|
||||
.. note::
|
||||
|
||||
All log file management operations require admin rights.
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-logs-list:
|
||||
|
||||
Retrieve a list of available log files
|
||||
======================================
|
||||
|
||||
.. http:get:: /api/logs
|
||||
|
||||
Retrieve information regarding all log files currently available and regarding the disk space still available
|
||||
in the system on the location the log files are being stored.
|
||||
|
||||
Returns a :ref:`Logfile Retrieve response <sec-api-logs-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/logs HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"files" : [
|
||||
{
|
||||
"date" : 1393158814,
|
||||
"name" : "octoprint.log",
|
||||
"size" : 43712,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/logs/octoprint.log",
|
||||
"download": "http://example.com/downloads/logs/octoprint.log"
|
||||
}
|
||||
},
|
||||
{
|
||||
"date" : 1392628936,
|
||||
"name" : "octoprint.log.2014-02-17",
|
||||
"size" : 13205,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/logs/octoprint.log.2014-02-17",
|
||||
"download": "http://example.com/downloads/logs/octoprint.log.2014-02-17"
|
||||
}
|
||||
},
|
||||
{
|
||||
"date" : 1393158814,
|
||||
"name" : "serial.log",
|
||||
"size" : 1798419,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/logs/serial.log",
|
||||
"download": "http://example.com/downloads/logs/serial.log"
|
||||
}
|
||||
}
|
||||
],
|
||||
"free": 12237201408
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
:statuscode 403: If the given API token did not have admin rights associated with it
|
||||
|
||||
.. _sec-api-logs-delete:
|
||||
|
||||
Delete a specific logfile
|
||||
=========================
|
||||
|
||||
.. http:delete:: /api/logs/(path:filename)
|
||||
|
||||
Delete the selected log file with name `filename`.
|
||||
|
||||
Returns a :http:statuscode:`204` after successful deletion.
|
||||
|
||||
**Example Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
DELETE /api/logs/octoprint.log.2014-02-17 HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
:param filename: The filename of the log file to delete
|
||||
:statuscode 204: No error
|
||||
:statuscode 403: If the given API token did not have admin rights associated with it
|
||||
:statuscode 404: If the file was not found
|
||||
|
||||
.. _sec-api-logs-datamodel:
|
||||
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-logs-datamodel-retrieveresponse:
|
||||
|
||||
Logfile Retrieve Response
|
||||
-------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``files``
|
||||
- 0..*
|
||||
- Array of :ref:`File information items <sec-api-logs-datamodel-fileinfo>`
|
||||
- The list of requested files. Might be an empty list if no files are available
|
||||
* - ``free``
|
||||
- 1
|
||||
- String
|
||||
- The amount of disk space in bytes available in the local disk space (refers to OctoPrint's ``logs`` folder).
|
||||
|
||||
.. _sec-api-logs-datamodel-fileinfo:
|
||||
|
||||
File information
|
||||
----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``name``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file
|
||||
* - ``size``
|
||||
- 1
|
||||
- Number
|
||||
- The size of the file in bytes.
|
||||
* - ``date``
|
||||
- 1
|
||||
- Unix timestamp
|
||||
- The timestamp when this file was last modified.
|
||||
* - ``refs``
|
||||
- 1
|
||||
- :ref:`sec-api-logs-datamodel-ref`
|
||||
- References relevant to this file
|
||||
|
||||
.. _sec-api-logs-datamodel-ref:
|
||||
|
||||
References
|
||||
----------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``resource``
|
||||
- 1
|
||||
- URL
|
||||
- The resource that represents the file (e.g. for deleting)
|
||||
* - ``download``
|
||||
- 1
|
||||
- URL
|
||||
- The download URL for the file
|
||||
@@ -0,0 +1,982 @@
|
||||
.. _sec-api-printer:
|
||||
|
||||
******************
|
||||
Printer operations
|
||||
******************
|
||||
|
||||
.. warning::
|
||||
|
||||
This part of the API is still heavily in development, especially anything that has to do with temperature control.
|
||||
If you happen to want to develop against it, you should drop me an email to make sure I can give you a heads-up when
|
||||
something changes.
|
||||
|
||||
.. contents::
|
||||
|
||||
Printer control is mostly achieved through the use of commands, issued to resources reflecting components of the
|
||||
printer. OctoPrint currently knows the following components:
|
||||
|
||||
Print head
|
||||
Print head commands allow jogging and homing the print head in all three axes. Querying the resource is currently
|
||||
not supported.
|
||||
See :ref:`sec-api-printer-printheadcommand`.
|
||||
Tool
|
||||
Tool commands allow setting the temperature and temperature offsets for the printer's hotends/tools. Querying the
|
||||
corresponding resource returns temperature information including an optional history.
|
||||
See :ref:`sec-api-printer-toolcommand`.
|
||||
Bed
|
||||
Bed commands allow setting the temperature and temperature offset for the printer's heated bed. Querying the
|
||||
corresponding resource returns temperature information including an optional history. Note that Bed commands
|
||||
are only available if the currently selected printer profile has a heated bed.
|
||||
See :ref:`sec-api-printer-bedcommand`.
|
||||
SD card
|
||||
SD commands allow initialization, refresh and release of the printer's SD card (if available). Querying the
|
||||
corresponding resource returns the current SD card state.
|
||||
See :ref:`sec-api-printer-sdcommand`.
|
||||
|
||||
Besides that, OctoPrint also provides a :ref:`full state report of the printer <sec-api-printer-state>`.
|
||||
|
||||
.. _sec-api-printer-state:
|
||||
|
||||
Retrieve the current printer state
|
||||
==================================
|
||||
|
||||
.. http:get:: /api/printer
|
||||
|
||||
Retrieves the current state of the printer. Returned information includes:
|
||||
|
||||
* temperature information (see also :ref:`Retrieve the current tool state <sec-api-printer-toolstate>` and
|
||||
:ref:`Retrieve the current bed state <sec-api-printer-bedstate>`)
|
||||
* sd state (if available, see also :ref:`Retrieve the current SD state <sec-api-printer-sdstate>`)
|
||||
* general printer state
|
||||
|
||||
Temperature information can also be made to include the printer's temperature history by supplying the ``history``
|
||||
query parameter. The amount of data points to return here can be limited using the ``limit`` query parameter.
|
||||
|
||||
Clients can specific a list of attributes to not return in the response (e.g. if they don't need it) via the
|
||||
``exclude`` query parameter.
|
||||
|
||||
Returns a :http:statuscode:`200` with a :ref:`Full State Response <sec-api-printer-datamodel-fullstate>` in the
|
||||
body upon success.
|
||||
|
||||
**Example 1**
|
||||
|
||||
Include temperature history data, but limit it to two entries.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/printer?history=true&limit=2 HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"temperature": {
|
||||
"tool0": {
|
||||
"actual": 214.8821,
|
||||
"target": 220.0,
|
||||
"offset": 0
|
||||
},
|
||||
"tool1": {
|
||||
"actual": 25.3,
|
||||
"target": null,
|
||||
"offset": 0
|
||||
},
|
||||
"bed": {
|
||||
"actual": 50.221,
|
||||
"target": 70.0,
|
||||
"offset": 5
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"time": 1395651928,
|
||||
"tool0": {
|
||||
"actual": 214.8821,
|
||||
"target": 220.0
|
||||
},
|
||||
"tool1": {
|
||||
"actual": 25.3,
|
||||
"target": null
|
||||
},
|
||||
"bed": {
|
||||
"actual": 50.221,
|
||||
"target": 70.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"time": 1395651926,
|
||||
"tool0": {
|
||||
"actual": 212.32,
|
||||
"target": 220.0
|
||||
},
|
||||
"tool1": {
|
||||
"actual": 25.1,
|
||||
"target": null
|
||||
},
|
||||
"bed": {
|
||||
"actual": 49.1123,
|
||||
"target": 70.0
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"sd": {
|
||||
"ready": true
|
||||
},
|
||||
"state": {
|
||||
"text": "Operational",
|
||||
"flags": {
|
||||
"operational": true,
|
||||
"paused": false,
|
||||
"printing": false,
|
||||
"sdReady": true,
|
||||
"error": false,
|
||||
"ready": true,
|
||||
"closedOrError": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**Example 2**
|
||||
|
||||
Exclude temperature and sd data.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/printer?exclude=temperature,sd HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"state": {
|
||||
"text": "Operational",
|
||||
"flags": {
|
||||
"operational": true,
|
||||
"paused": false,
|
||||
"printing": false,
|
||||
"sdReady": true,
|
||||
"error": false,
|
||||
"ready": true,
|
||||
"closedOrError": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:query exclude: An optional comma-separated list of fields to exclude from the response (e.g. if not needed by
|
||||
the client). Valid values to supply here are ``temperature``, ``sd`` and ``state``.
|
||||
:query history: If set to ``true`` (or: ``yes``, ``y``, ``1``), history information will be included in the response
|
||||
too. If no ``limit`` parameter is given, all available temperature history data will be returned.
|
||||
:query limit: If set to an integer (``n``), only the last ``n`` data points from the printer's temperature history
|
||||
will be returned. Will be ignored if ``history`` is not enabled.
|
||||
:statuscode 200: No error
|
||||
:statuscode 409: If the printer is not operational.
|
||||
|
||||
.. _sec-api-printer-printheadcommand:
|
||||
|
||||
Issue a print head command
|
||||
==========================
|
||||
|
||||
.. http:post:: /api/printer/printhead
|
||||
|
||||
Print head commands allow jogging and homing the print head in all three axes. Available commands are:
|
||||
|
||||
jog
|
||||
Jogs the print head (relatively) by a defined amount in one or more axes. Additional parameters are:
|
||||
|
||||
* ``x``: Optional. Amount to jog print head on x axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
* ``y``: Optional. Amount to jog print head on y axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
* ``z``: Optional. Amount to jog print head on z axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
|
||||
home
|
||||
Homes the print head in all of the given axes. Additional parameters are:
|
||||
|
||||
* ``axes``: A list of axes which to home, valid values are one or more of ``x``, ``y``, ``z``.
|
||||
|
||||
feedrate
|
||||
Changes the feedrate factor to apply to the movement's of the axes.
|
||||
|
||||
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 50 and 200%.
|
||||
|
||||
All of these commands except ``feedrate`` may only be sent if the printer is currently operational and not printing.
|
||||
Otherwise a :http:statuscode:`409` is returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
**Example Jog Request**
|
||||
|
||||
Jog the print head by 10mm in X, -5mm in Y and 0.02mm in Z.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/printhead HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "jog",
|
||||
"x": 10,
|
||||
"y": -5,
|
||||
"z": 0.02
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Home Request**
|
||||
|
||||
Home the X and Y axes.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/printhead HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "home",
|
||||
"axes": ["x", "y"]
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example feed rate request**
|
||||
|
||||
Set the feed rate factor to 105%.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/printhead HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "feedrate",
|
||||
"factor": 105
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``jog`` or ``home``.
|
||||
:json number x: ``jog`` command: The amount to travel on the X axis in mm.
|
||||
:json number y: ``jog`` command: The amount to travel on the Y axis in mm.
|
||||
:json number z: ``jog`` command: The amount to travel on the Z axis in mm.
|
||||
:json array axes: ``home`` command: The axes which to home, valid values are one or more of ``x``, ``y`` and ``z``.
|
||||
:json number factor: ``feedrate`` command: The factor to apply to the feed rate, percentage between 50 and 200% as integer or float.
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: Invalid axis specified, invalid value for travel amount for a jog command or factor for feed rate or otherwise invalid
|
||||
request.
|
||||
:statuscode 409: If the printer is not operational or currently printing.
|
||||
|
||||
.. _sec-api-printer-toolcommand:
|
||||
|
||||
Issue a tool command
|
||||
====================
|
||||
|
||||
.. http:post:: /api/printer/tool
|
||||
|
||||
Tool commands allow setting the temperature and temperature offsets for the printer's tools (hotends), selecting
|
||||
the current tool and extruding/retracting from the currently selected tool. Available commands are:
|
||||
|
||||
target
|
||||
Sets the given target temperature on the printer's tools. Additional parameters:
|
||||
|
||||
* ``targets``: Target temperature(s) to set, properties must match the format ``tool{n}`` with ``n`` being the
|
||||
tool's index starting with 0.
|
||||
|
||||
offset
|
||||
Sets the given temperature offset on the printer's tools. Additional parameters:
|
||||
|
||||
* ``offsets``: Offset(s) to set, properties must match the format ``tool{n}`` with ``n`` being the tool's index
|
||||
starting with 0.
|
||||
|
||||
select
|
||||
Selects the printer's current tool. Additional parameters:
|
||||
|
||||
* ``tool``: Tool to select, format ``tool{n}`` with ``n`` being the tool's index starting with 0.
|
||||
|
||||
extrude
|
||||
Extrudes the given amount of filament from the currently selected tool. Additional parameters:
|
||||
|
||||
* ``amount``: The amount of filament to extrude in mm. May be negative to retract.
|
||||
|
||||
flowrate
|
||||
Changes the flow rate factor to apply to extrusion of the tool.
|
||||
|
||||
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 75 and 125%.
|
||||
|
||||
All of these commands may only be sent if the printer is currently operational and -- in case of ``select`` and
|
||||
``extrude`` -- not printing. Otherwise a :http:statuscode:`409` is returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
**Example Target Temperature Request**
|
||||
|
||||
Set the target temperature for the printer's first hotend to 220°C and the printer's second extruder to 205°C.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/tool HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "target",
|
||||
"targets": {
|
||||
"tool0": 220,
|
||||
"tool1": 205
|
||||
}
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Offset Temperature Request**
|
||||
|
||||
Set the offset for temperatures on ``tool0`` to +10°C and on ``tool1`` to -5°C.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/tool HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "offset",
|
||||
"offsets": {
|
||||
"tool0": 10,
|
||||
"tool1": -5
|
||||
}
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Tool Select Request**
|
||||
|
||||
Select the second hotend of the printer for any following ``extrude`` commands.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/tool HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "select",
|
||||
"tool": "tool1"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Extrude Request**
|
||||
|
||||
Extrude 5mm on the currently selected tool.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/tool HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "extrude",
|
||||
"amount": 5
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Retract Request**
|
||||
|
||||
Retract 3mm of filament on the currently selected tool.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/tool HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "extrude",
|
||||
"amount": -3
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example flow rate request**
|
||||
|
||||
Set the flow rate factor to 95%.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/tool HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "flowrate",
|
||||
"factor": 95
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``target``, ``offset``, ``select`` or ``extrude``.
|
||||
:json object targets: ``target`` command: The target temperatures to set. Valid properties have to match the format ``tool{n}``.
|
||||
:json object offsets: ``offset`` command: The offset temperature to set. Valid properties have to match the format ``tool{n}``.
|
||||
:json object tool: ``select`` command: The tool to select, value has to match the format ``tool{n}``.
|
||||
:json object amount: ``extrude`` command: The amount of filament to extrude from the currently selected tool.
|
||||
:json number factor: ``flowrate`` command: The factor to apply to the flow rate, percentage between 75 and 125% as integer or float.
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: If ``targets`` or ``offsets`` contains a property or ``tool`` contains a value not matching the format
|
||||
``tool{n}``, the target/offset temperature, extrusion amount or flow rate factor is not a valid number or outside of
|
||||
the supported range, or if the request is otherwise invalid.
|
||||
:statuscode 409: If the printer is not operational or -- in case of ``select`` or ``extrude`` -- currently printing.
|
||||
|
||||
.. _sec-api-printer-toolstate:
|
||||
|
||||
Retrieve the current tool state
|
||||
===============================
|
||||
|
||||
.. http:get:: /api/printer/tool
|
||||
|
||||
Retrieves the current temperature data (actual, target and offset) plus optionally a (limited) history (actual, target,
|
||||
timestamp) for all of the printer's available tools.
|
||||
|
||||
It's also possible to retrieve the temperature history by supplying the ``history`` query parameter set to ``true``. The
|
||||
amount of returned history data points can be limited using the ``limit`` query parameter.
|
||||
|
||||
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
|
||||
|
||||
.. note::
|
||||
If you want both tool and bed temperature information at the same time, take a look at
|
||||
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
|
||||
|
||||
**Example**
|
||||
|
||||
Query the tool temperature data and also include the temperature history but limit it to two entries.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/printer/tool?history=true&limit=2 HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"tool0": {
|
||||
"actual": 214.8821,
|
||||
"target": 220.0,
|
||||
"offset": 0
|
||||
},
|
||||
"tool1": {
|
||||
"actual": 25.3,
|
||||
"target": null,
|
||||
"offset": 0
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"time": 1395651928,
|
||||
"tool0": {
|
||||
"actual": 214.8821,
|
||||
"target": 220.0
|
||||
},
|
||||
"tool1": {
|
||||
"actual": 25.3,
|
||||
"target": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"time": 1395651926,
|
||||
"tool0": {
|
||||
"actual": 212.32,
|
||||
"target": 220.0
|
||||
},
|
||||
"tool1": {
|
||||
"actual": 25.1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
:query history: If set to ``true`` (or: ``yes``, ``y``, ``1``), history information will be included in the response
|
||||
too. If no ``limit`` parameter is given, all available temperature history data will be returned.
|
||||
:query limit: If set to an integer (``n``), only the last ``n`` data points from the printer's temperature history
|
||||
will be returned. Will be ignored if ``history`` is not enabled.
|
||||
:statuscode 200: No error
|
||||
:statuscode 409: If the printer is not operational.
|
||||
|
||||
.. _sec-api-printer-bedcommand:
|
||||
|
||||
Issue a bed command
|
||||
===================
|
||||
|
||||
.. http:post:: /api/printer/bed
|
||||
|
||||
Bed commands allow setting the temperature and temperature offsets for the printer's heated bed. Available commands
|
||||
are:
|
||||
|
||||
target
|
||||
Sets the given target temperature on the printer's tools. Additional parameters:
|
||||
|
||||
* ``target``: Target temperature to set.
|
||||
|
||||
offset
|
||||
Sets the given temperature offset on the printer's tools. Additional parameters:
|
||||
|
||||
* ``offset``: Offset to set.
|
||||
|
||||
All of these commands may only be sent if the printer is currently operational. Otherwise a :http:statuscode:`409`
|
||||
is returned.
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
If no heated bed is configured for the currently selected printer profile, the resource will return
|
||||
an :http:statuscode:`409`.
|
||||
|
||||
**Example Target Temperature Request**
|
||||
|
||||
Set the target temperature for the printer's heated bed to 75°C.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/bed HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "target",
|
||||
"target": 75
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Offset Temperature Request**
|
||||
|
||||
Set the temperature offset for the heated bed to -5°C.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/bed HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "offset",
|
||||
"offset": -5
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``target`` or ``offset``.
|
||||
:json object target: ``target`` command: The target temperature to set.
|
||||
:json object offset: ``offset`` command: The offset temperature to set.
|
||||
:statuscode 204: No error
|
||||
:statuscode 400: If ``target`` or ``offset`` is not a valid number or outside of the supported range, or if the
|
||||
request is otherwise invalid.
|
||||
:statuscode 409: If the printer is not operational or the selected printer profile
|
||||
does not have a heated bed.
|
||||
|
||||
.. _sec-api-printer-bedstate:
|
||||
|
||||
Retrieve the current bed state
|
||||
==============================
|
||||
|
||||
.. http:get:: /api/printer/bed
|
||||
|
||||
Retrieves the current temperature data (actual, target and offset) plus optionally a (limited) history (actual, target,
|
||||
timestamp) for the printer's heated bed.
|
||||
|
||||
It's also possible to retrieve the temperature history by supplying the ``history`` query parameter set to ``true``. The
|
||||
amount of returned history data points can be limited using the ``limit`` query parameter.
|
||||
|
||||
Returns a :http:statuscode:`200` with a Temperature Response in the body upon success.
|
||||
|
||||
If no heated bed is configured for the currently selected printer profile, the resource will return
|
||||
an :http:statuscode:`409`.
|
||||
|
||||
.. note::
|
||||
If you want both tool and bed temperature information at the same time, take a look at
|
||||
:ref:`Retrieve the current printer state <sec-api-printer-state>`.
|
||||
|
||||
**Example**
|
||||
|
||||
Query the bed temperature data and also include the temperature history but limit it to two entries.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/printer/bed?history=true&limit=2 HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"bed": {
|
||||
"actual": 50.221,
|
||||
"target": 70.0,
|
||||
"offset": 5
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"time": 1395651928,
|
||||
"bed": {
|
||||
"actual": 50.221,
|
||||
"target": 70.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"time": 1395651926,
|
||||
"bed": {
|
||||
"actual": 49.1123,
|
||||
"target": 70.0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
:query history: If set to ``true`` (or: ``yes``, ``y``, ``1``), history information will be included in the response
|
||||
too. If no ``limit`` parameter is given, all available temperature history data will be returned.
|
||||
:query limit: If set to an integer (``n``), only the last ``n`` data points from the printer's temperature history
|
||||
will be returned. Will be ignored if ``history`` is not enabled.
|
||||
:statuscode 200: No error
|
||||
:statuscode 409: If the printer is not operational or the selected printer profile
|
||||
does not have a heated bed.
|
||||
|
||||
.. _sec-api-printer-sdcommand:
|
||||
|
||||
Issue an SD command
|
||||
===================
|
||||
|
||||
.. http:post:: /api/printer/sd
|
||||
|
||||
SD commands allow initialization, refresh and release of the printer's SD card (if available).
|
||||
|
||||
Available commands are:
|
||||
|
||||
init
|
||||
Initializes the printer's SD card, making it available for use. This also includes an initial retrieval of the
|
||||
list of files currently stored on the SD card, so after issueing that command a :ref:`retrieval of the files
|
||||
on SD card <sec-api-fileops-retrievelocation>` will return a successful result.
|
||||
|
||||
.. note::
|
||||
If OctoPrint detects the availability of a SD card on the printer during connection, it will automatically attempt
|
||||
to initialize it.
|
||||
|
||||
refresh
|
||||
Refreshes the list of files stored on the printer's SD card. Will return a :http:statuscode:`409` if the card
|
||||
has not been initialized yet (see the ``init`` command and :ref:`SD state <sec-api-printer-sdstate>`).
|
||||
|
||||
release
|
||||
Releases the SD card from the printer. The reverse operation to ``init``. After issuing this command, the SD
|
||||
card won't be available anymore, hence and operations targeting files stored on it will fail. Will return a :http:statuscode:`409`
|
||||
if the card has not been initialized yet (see the ``init`` command and :ref:`SD state <sec-api-printer-sdstate>`).
|
||||
|
||||
Upon success, a status code of :http:statuscode:`204` and an empty body is returned.
|
||||
|
||||
**Example Init Request**
|
||||
|
||||
Initialize the SD card.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/sd HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "init"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Refresh Request**
|
||||
|
||||
Refresh the file list of the SD card
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/sd HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "refresh"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example Release Request**
|
||||
|
||||
Release the SD card
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/sd HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "release"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: The command to issue, either ``init``, ``refresh`` or ``release``.
|
||||
:statuscode 204: No error
|
||||
:statuscode 409: If a ``refresh`` or ``release`` command is issued but the SD card has not been initialized (e.g.
|
||||
via ``init``.
|
||||
|
||||
.. _sec-api-printer-sdstate:
|
||||
|
||||
Retrieve the current SD state
|
||||
=============================
|
||||
|
||||
.. http:get:: /api/printer/sd
|
||||
|
||||
Retrieves the current state of the printer's SD card. For this request no authentication is needed.
|
||||
|
||||
If SD support has been disabled in OctoPrint's settings, a :http:statuscode:`404` is returned.
|
||||
|
||||
Returns a :http:statuscode:`200` with an :ref:`SD State Response <sec-api-printer-datamodel-sdstate>` in the body
|
||||
upon success.
|
||||
|
||||
**Example**
|
||||
|
||||
Read the current state of the SD card.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/printer/sd HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"ready": true
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If SD support has been disabled in OctoPrint's config.
|
||||
|
||||
.. _sec-api-printer-arbcommand:
|
||||
|
||||
Send an arbitrary command to the printer
|
||||
========================================
|
||||
|
||||
.. http:post:: /api/printer/command
|
||||
|
||||
Sends any command to the printer via the serial interface. Should be used with some care as some commands can interfere with
|
||||
or even stop a running print job.
|
||||
|
||||
Expects a :ref:`Arbitrary Command Request <sec-api-printer-datamodel-arbcommand>` as the request's body.
|
||||
|
||||
If successful returns a :http:statuscode:`204` and an empty body.
|
||||
|
||||
**Example for sending a single command**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/command HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"command": "M106"
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
**Example for sending multiple commands**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/printer/command HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
{
|
||||
"commands": [
|
||||
"M18",
|
||||
"M106 S0"
|
||||
]
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:json string command: Single command to send to the printer, mutually exclusive with ``commands``.
|
||||
:json string commands: List of commands to send to the printer, mutually exclusive with ``command``.
|
||||
:statuscode 204: No error
|
||||
|
||||
.. _sec-api-printer-datamodel:
|
||||
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-printer-datamodel-fullstate:
|
||||
|
||||
Full State Response
|
||||
-------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``temperature``
|
||||
- 0..1
|
||||
- :ref:`Temperature State <sec-api-printer-datamodel-temps>`
|
||||
- The printer's temperature state data
|
||||
* - ``sd``
|
||||
- 0..1
|
||||
- :ref:`SD State <sec-api-printer-datamodel-sdstate>`
|
||||
- The printer's sd state data
|
||||
* - ``state``
|
||||
- 0..1
|
||||
- :ref:`Printer State <sec-api-datamodel-printer-state>`
|
||||
- The printer's general state
|
||||
|
||||
.. _sec-api-printer-datamodel-temps:
|
||||
|
||||
Temperature State
|
||||
-----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``tool{n}``
|
||||
- 0..*
|
||||
- :ref:`Temperature Data <sec-api-datamodel-printer-tempdata>`
|
||||
- Current temperature stats for tool *n*. Enumeration starts at 0 for the first tool. Not included if querying
|
||||
only bed state.
|
||||
* - ``bed``
|
||||
- 0..1
|
||||
- :ref:`Temperature Data <sec-api-datamodel-printer-tempdata>`
|
||||
- Current temperature stats for the printer's heated bed. Not included if querying only tool state or if
|
||||
the currently selected printer profile does not have a heated bed.
|
||||
* - ``history``
|
||||
- 0..1
|
||||
- List of :ref:`Historic Temperature Datapoint <sec-api-datamodel-printer-temphistory>`
|
||||
- Temperature history
|
||||
|
||||
.. _sec-api-printer-datamodel-sdstate:
|
||||
|
||||
SD State
|
||||
--------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``ready``
|
||||
- 1
|
||||
- Boolean
|
||||
- Whether the SD card has been initialized (``true``) or not (``false``).
|
||||
|
||||
.. _sec-api-printer-datamodel-arbcommand:
|
||||
|
||||
Arbitrary Command Request
|
||||
-------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``command``
|
||||
- 0..1
|
||||
- String
|
||||
- Single command to send to the printer, mutually exclusive with ``commands`` and ``script``.
|
||||
* - ``commands``
|
||||
- 0..*
|
||||
- Array of String
|
||||
- Multiple commands to send to the printer (in the given order), mutually exclusive with ``command`` and ``script``.
|
||||
* - ``script``
|
||||
- 0..*
|
||||
- String
|
||||
- Name of the GCODE script template to send to the printer, mutually exclusive with ``command`` and ``commands``.
|
||||
* - ``parameters``
|
||||
- 0..1
|
||||
- Map of key value pairs
|
||||
- Key value pairs of parameters to replace in sent commands/provide to the script renderer
|
||||
* - ``context``
|
||||
- 0..1
|
||||
- Map of key value pairs
|
||||
- (only if ``script`` is set) additional template variables to provide to the script renderer
|
||||
@@ -0,0 +1,190 @@
|
||||
.. _sec-api-printerprofiles:
|
||||
|
||||
**************************
|
||||
Printer profile operations
|
||||
**************************
|
||||
|
||||
.. contents::
|
||||
|
||||
OctoPrint allows the management of Printer profiles that define a printer's physical properties (such as print volume,
|
||||
whether a heated bed is available, maximum speeds on its axes etc). The data stored within these profiles is used
|
||||
for both slicing and gcode visualization.
|
||||
|
||||
.. _sec-api-printerprofiles-retrieve:
|
||||
|
||||
Retrieve all printer profiles
|
||||
=============================
|
||||
|
||||
.. http:get:: /api/printerprofiles
|
||||
|
||||
.. _sec-api-printerprofiles-add:
|
||||
|
||||
Add a new printer profile
|
||||
=========================
|
||||
|
||||
.. http:post:: /api/printerprofiles
|
||||
|
||||
.. _sec-api-printerporfiles-update:
|
||||
|
||||
Update an existing printer profile
|
||||
==================================
|
||||
|
||||
.. http:patch:: /api/printerprofiles/(string:profile)
|
||||
|
||||
.. _sec-api-printerprofiles-delete:
|
||||
|
||||
Remove an existing printer profile
|
||||
==================================
|
||||
|
||||
.. http:delete:: /api/printerprofiles/(string:profile)
|
||||
|
||||
.. _sec-api-printerprofiles-datamodel:
|
||||
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-printerprofiles-datamodel-profilelist:
|
||||
|
||||
Profile list
|
||||
------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``profiles``
|
||||
- 1
|
||||
- Object
|
||||
- Collection of all printer profiles available in the system
|
||||
* - ``profiles.<profile id>``
|
||||
- 0..1
|
||||
- :ref:`Profile <sec-api-slicing-datamodel-profile>`
|
||||
- Information about a profile stored in the system.
|
||||
|
||||
.. _sec-api-printerprofiles-datamodel-update:
|
||||
|
||||
Add or update request
|
||||
---------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``profiles``
|
||||
- 1
|
||||
- :ref:`Profile <sec-api-slicing-datamodel-profile>`
|
||||
- Information about the profile being added/updated. For adding new profiles, all fields must be populated. For updating
|
||||
and existing profile, only the values to be overwritten need to be supplied.
|
||||
|
||||
.. _sec-api-printerprofiles-datamodel-profile:
|
||||
|
||||
Profile
|
||||
-------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``id``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Identifier of the profile. Will always be
|
||||
returned in responses but can be left out of save/update requests.
|
||||
* - ``name``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Display name of the profile. Will always be
|
||||
returned in responses but can be left out of save/update requests.
|
||||
* - ``color``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- The color to associate with this profile (used in the UI's title bar). Valid values are "default", "red", "orange",
|
||||
"yellow", "green", "blue", "black". Will always be
|
||||
returned in responses but can be left out of save/update requests.
|
||||
* - ``model``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Printer model of the profile. Will always be
|
||||
returned in responses but can be left out of save/update requests.
|
||||
* - ``default``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
- Whether this is the default profile to be used with new connections (``true``) or not (``false``). Will always be
|
||||
returned in responses but can be left out of save/update requests.
|
||||
* - ``current``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
- Whether this is the profile currently active. Will always be returned in responses but ignored in save/update
|
||||
requests.
|
||||
* - ``resource``
|
||||
- 0..1
|
||||
- ``URL``
|
||||
- Resource URL of the profile, will always be returned in responses but can be left out of save/update requests.
|
||||
* - ``volume``
|
||||
- 0..1
|
||||
- Object
|
||||
- The print volume, will always be returned in responses but can be left out of save/update requests.
|
||||
* - ``volume.formFactor``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- The form factor of the printer's bed, valid values are "rectangular" and "circular"
|
||||
* - ``volume.width``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The width of the print volume
|
||||
* - ``volume.depth``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The depth of the print volume
|
||||
* - ``volume.height``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The height of the print volume
|
||||
* - ``heatedBed``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
- Whether the printer has a heated bed (``true``) or not (``false``)
|
||||
* - ``axes``
|
||||
- 0..1
|
||||
- Object
|
||||
- Description of the printer's axes properties, one entry each for ``x``, ``y``, ``z`` and ``e`` holding maxium speed
|
||||
and whether this axis is inverted or not.
|
||||
* - ``axes.{axis}.speed``
|
||||
- 0..1
|
||||
- ``int``
|
||||
- Maximum speed of the axis in mm/s.
|
||||
* - ``axes.{axis}.inverted``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
- Whether the axis is inverted or not.
|
||||
* - ``extruder``
|
||||
- 0..1
|
||||
- Object
|
||||
- Information about the printer's extruders
|
||||
* - ``extruder.nozzleDiameter``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The diameter of the printer's nozzle(s) in mm.
|
||||
* - ``extruder.count``
|
||||
- 0..1
|
||||
- ``int``
|
||||
- Count of extruders on the printer (defaults to 1)
|
||||
* - ``extruder.offsets``
|
||||
- 0..1
|
||||
- Array of ``float`` tuples
|
||||
- Tuple of (x, y) values describing the offsets of the other extruders relative to the first extruder. E.g. for a
|
||||
printer with two extruders, if the second extruder is offset by 20mm in the X and 25mm in the Y direction, this
|
||||
array will read ``[ [0.0, 0.0], [20.0, 25.0] ]``
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
.. _sec-api-push:
|
||||
|
||||
************
|
||||
Push updates
|
||||
************
|
||||
|
||||
.. warning::
|
||||
|
||||
The interface documented here is the status quo that might be changed while the interfaces are streamlined for
|
||||
a more general consumption. If you happen to want to develop against it, you should drop me an email to make sure I can give you a heads-up when
|
||||
something changes.
|
||||
|
||||
.. contents::
|
||||
|
||||
To enable real time information exchange between client and server, OctoPrint uses
|
||||
`SockJS <https://github.com/sockjs/sockjs-protocol>`_ to push
|
||||
status updates, temperature changes etc to connected web interface instances.
|
||||
|
||||
Each pushed message consists of a simple JSON object that follows this basic structure:
|
||||
|
||||
.. sourcecode:: javascript
|
||||
|
||||
{
|
||||
"<type>": <payload>
|
||||
}
|
||||
|
||||
``type`` indicates the type of message being pushed to the client, the attached ``payload`` is message specific. The
|
||||
following message types are currently available for usage by 3rd party clients:
|
||||
|
||||
* ``current``: Rate limited general state update, payload contains information about the printer's state, job progress,
|
||||
accumulated temperature points and log lines since last update. OctoPrint will send these updates when new information
|
||||
is available, but not more often than twice per second in order to not flood the client with messages (e.g.
|
||||
during printing). See :ref:`the payload data model <sec-api-push-datamodel-currentandhistory>`.
|
||||
* ``history``: Current state, temperature and log history, sent upon initial connect to get the client up to date. Same
|
||||
payload data model as ``current``, see :ref:`below <sec-api-push-datamodel-currentandhistory>`.
|
||||
* ``event``: Events triggered within OctoPrint, such as e.g. ``PrintFailed`` or ``MovieRenderDone``. Payload is the event
|
||||
type and payload, see :ref:`below <sec-api-push-datamodel-event>`. Sent when an event is triggered internally.
|
||||
* ``slicingProgress``: Progress updates from an active slicing background job, payload contains information about the
|
||||
model being sliced, the target file, the slicer being used and the progress as a percentage.
|
||||
See :ref:`the payload data model <sec-api-push-datamodel-slicingprogress>`.
|
||||
|
||||
Clients must ignore any unknown messages.
|
||||
|
||||
The data model of the attached payloads is described further below.
|
||||
|
||||
OctoPrint's SockJS socket also accepts one command from the client to the server,
|
||||
the ``throttle`` command. Usually, OctoPrint will push the general state update
|
||||
in the ``current`` message twice per second. For some clients that might still
|
||||
be too fast, so they can signal a different factor to OctoPrint utilizing the
|
||||
``throttle`` message. OctoPrint expects a single integer here which represents
|
||||
the multiplier for the base rate limit of one message every 500ms. A value of
|
||||
1 hence will produce the default behaviour of getting every update. A value of
|
||||
2 will set the rate limit to maximally one message every 1s, 3 to maximally one
|
||||
message every 1.5s and so on.
|
||||
|
||||
Example for a ``throttle`` client-server-message:
|
||||
|
||||
.. sourcecode:: javascript
|
||||
|
||||
{
|
||||
"throttle": 2
|
||||
}
|
||||
|
||||
.. _sec-api-push-datamodel:
|
||||
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-push-datamodel-currentandhistory:
|
||||
|
||||
``current`` and ``history`` payload
|
||||
-----------------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``state``
|
||||
- 1
|
||||
- :ref:`State information <sec-api-datamodel-printer-state>`
|
||||
- Information about the current machine state
|
||||
* - ``job``
|
||||
- 1
|
||||
- :ref:`Job information <sec-api-datamodel-jobs-job>`
|
||||
- Information about the currently active print job
|
||||
* - ``progress``
|
||||
- 1
|
||||
- :ref:`Progress information <sec-api-datamodel-jobs-progress>`
|
||||
- Information about the current print/streaming progress
|
||||
* - ``currentZ``
|
||||
- 1
|
||||
- Float
|
||||
- Current height of the Z-Axis (= current height of model) during printing from a local file
|
||||
* - ``offsets``
|
||||
- 0..1
|
||||
- :ref:`Temperature offsets <sec-api-datamodel-printer-tempoffset>`
|
||||
- Currently configured temperature offsets
|
||||
* - ``temps``
|
||||
- 0..*
|
||||
- List of :ref:`Temperature Data Points <sec-api-datamodel-printer-temphistory>`
|
||||
- Temperature data points for plotting
|
||||
* - ``logs``
|
||||
- 0..*
|
||||
- List of String
|
||||
- Lines for the serial communication log (send/receive)
|
||||
* - ``messages``
|
||||
- 0..*
|
||||
- List of String
|
||||
- Lines for the serial communication log (special messages)
|
||||
|
||||
.. _sec-api-push-datamodel-event:
|
||||
|
||||
``event`` payload
|
||||
-----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``type``
|
||||
- 1
|
||||
- String
|
||||
- Name of the event
|
||||
* - ``payload``
|
||||
- 1
|
||||
- Object
|
||||
- Payload associated with the event
|
||||
|
||||
.. _sec-api-push-datamodel-slicingprogress:
|
||||
|
||||
``slicingProgress`` payload
|
||||
---------------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``slicer``
|
||||
- 1
|
||||
- String
|
||||
- Name of the slicer used
|
||||
* - ``source_location``
|
||||
- 1
|
||||
- String
|
||||
- Location of the source file being sliced, at the moment either ``local`` or ``sdcard``
|
||||
* - ``source_path``
|
||||
- 1
|
||||
- String
|
||||
- Path of the source file being sliced (e.g. an STL file)
|
||||
* - ``dest_location``
|
||||
- 1
|
||||
- String
|
||||
- Location of the destination file being created, at the moment either ``local`` or ``sdcard``
|
||||
* - ``dest_path``
|
||||
- 1
|
||||
- String
|
||||
- Path of the destination file being sliced (e.g. a GCODE file)
|
||||
* - ``progress``
|
||||
- 1
|
||||
- Number (Float)
|
||||
- Percentage of slicing job already completed
|
||||
@@ -0,0 +1,337 @@
|
||||
.. _sec-api-slicing:
|
||||
|
||||
*******
|
||||
Slicing
|
||||
*******
|
||||
|
||||
.. warning::
|
||||
|
||||
The interface documented here is the status quo that might be changed while the interfaces are streamlined for
|
||||
a more general consumption. If you happen to want to develop against it, you should drop me an email to make sure I can give you a heads-up when
|
||||
something changes.
|
||||
|
||||
.. contents::
|
||||
|
||||
The Slicing API on one hand offers methods for managing slicing profiles stored within OctoPrint, on the other hand
|
||||
it will be extended in the future to also allow for multi extruder slicing (which currently is not possible with the
|
||||
``slice`` command of the :ref:`File operations API <sec-api-fileops-filecommand>` and other things.
|
||||
|
||||
.. _sec-api-slicing-listall:
|
||||
|
||||
List All Slicers and Slicing Profiles
|
||||
=====================================
|
||||
|
||||
.. http:get:: /api/slicing
|
||||
|
||||
Returns a list of all available slicing profiles for all registered slicers in the system.
|
||||
|
||||
Returns a :http:statuscode:`200` response with a :ref:`Slicer list <sec-api-slicing-datamodel-slicerlist>`
|
||||
as the body upon successful completion.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/slicing HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"cura": {
|
||||
"key": "cura",
|
||||
"displayName": "CuraEngine",
|
||||
"default": true,
|
||||
"profiles": {
|
||||
"high_quality": {
|
||||
"key": "high_quality",
|
||||
"displayName": "High Quality",
|
||||
"default": false,
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/high_quality"
|
||||
},
|
||||
"medium_quality": {
|
||||
"key": "medium_quality",
|
||||
"displayName": "Medium Quality",
|
||||
"default": true,
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/medium_quality"
|
||||
},
|
||||
...
|
||||
}
|
||||
},
|
||||
...
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-slicing-list:
|
||||
|
||||
List Slicing Profiles of a Specific Slicer
|
||||
==========================================
|
||||
|
||||
.. http:get:: /api/slicing/(string:slicer)/profiles
|
||||
|
||||
Returns a list of all available slicing profiles for the requested slicer.
|
||||
|
||||
Returns a :http:statuscode:`200` response with a :ref:`Profile list <sec-api-slicing-datamodel-profilelist>`
|
||||
as the body upon successful completion.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/slicing/cura/profiles HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"high_quality": {
|
||||
"key": "high_quality",
|
||||
"displayName": "High Quality",
|
||||
"default": false,
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/high_quality"
|
||||
},
|
||||
"medium_quality": {
|
||||
"key": "medium_quality",
|
||||
"displayName": "Medium Quality",
|
||||
"default": true,
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/medium_quality"
|
||||
},
|
||||
...
|
||||
}
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to list the available profiles.
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If the ``slicer`` was unknown to the system or not yet configured.
|
||||
|
||||
.. _sec-api-slicing-listspecific:
|
||||
|
||||
Retrieve Specific Profile
|
||||
=========================
|
||||
|
||||
.. http:get:: /api/slicing/(string:slicer)/profiles/(string:key)
|
||||
|
||||
Retrieves the specified profile from the system.
|
||||
|
||||
Returns a :http:statuscode:`200` response with a :ref:`full Profile <sec-api-slicing-datamodel-profile>`
|
||||
as the body upon successful completion.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/slicing/cura/profiles/quick_test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"displayName": "Just a test",
|
||||
"description": "This is just a test",
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/quick_test",
|
||||
"data": {
|
||||
"bottom_layer_speed": 20.0,
|
||||
"bottom_thickness": 0.3,
|
||||
"brim_line_count": 20,
|
||||
"cool_head_lift": false,
|
||||
"cool_min_feedrate": 10.0,
|
||||
"cool_min_layer_time": 5.0,
|
||||
...
|
||||
}
|
||||
}
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to list the available profiles.
|
||||
:param name: The identifying key of the profile to retrieve
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If the ``slicer`` or the profile ``key`` was unknown to the system.
|
||||
|
||||
.. _sec-api-slicing-add:
|
||||
|
||||
Add Slicing Profile
|
||||
===================
|
||||
|
||||
.. http:put:: /api/slicing/(string:slicer)/profiles/(string:key)
|
||||
|
||||
Adds a new slicing profile for the given ``slicer`` to the system. If the profile identified by ``key`` already exists,
|
||||
it will be overwritten.
|
||||
|
||||
Expects a :ref:`Profile <sec-api-slicing-datamodel-profile>` as body.
|
||||
|
||||
Returns a :http:statuscode:`201` and an :ref:`abridged Profile <sec-api-slicing-datamodel-profile>` in the body
|
||||
upon successful completion.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
PUT /api/slicing/cura/profiles/quick_test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"displayName": "Just a test",
|
||||
"description": "This is just a test to show how to create a cura profile with a different layer height and skirt count",
|
||||
"data": {
|
||||
"layer_height": 0.2,
|
||||
"skirt_line_count": 3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 201 Created
|
||||
Content-Type: application/json
|
||||
Location: http://example.com/api/slicing/cura/profiles/quick_test
|
||||
|
||||
{
|
||||
"displayName": "Just a test",
|
||||
"description": "This is just a test to show how to create a cura profile with a different layer height and skirt count",
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/quick_test"
|
||||
}
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to add the profile
|
||||
:param key: The identifying key of the new profile
|
||||
:statuscode 201: No error
|
||||
:statuscode 404: If the ``slicer`` was unknown to the system.
|
||||
|
||||
.. _sec-api-slicing-delete:
|
||||
|
||||
Delete Slicing Profile
|
||||
======================
|
||||
|
||||
.. http:delete:: /api/slicing/(string:slicer)/profiles/(string:key)
|
||||
|
||||
Delete the slicing profile identified by ``key`` for the slicer ``slicer``. If the profile doesn't exist, the
|
||||
request will succeed anyway.
|
||||
|
||||
:param slicer: The identifying key of the slicer for which to delete the profile
|
||||
:param key: The identifying key of the profile to delete
|
||||
:statuscode 204: No error
|
||||
:statuscode 404: If the ``slicer`` was unknown to the system.
|
||||
|
||||
.. _sec-api-slicing-datamodel:
|
||||
|
||||
Datamodel
|
||||
=========
|
||||
|
||||
.. _sec-api-slicing-datamodel-slicerlist:
|
||||
|
||||
Slicer list
|
||||
-----------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``<slicer key>``
|
||||
- 0..*
|
||||
- :ref:`Slicer <sec-api-slicing-datamodel-slicer>`
|
||||
- Information about a slicer registered in the system, incl. stored profiles without ``data``.
|
||||
|
||||
.. _sec-api-slicing-datamodel-slicer:
|
||||
|
||||
Slicer
|
||||
------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``key``
|
||||
- 1
|
||||
- ``string``
|
||||
- Identifier of the slicer
|
||||
* - ``displayName``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Display name of the slicer
|
||||
* - ``default``
|
||||
- 1
|
||||
- ``boolean``
|
||||
- Whether the slicer is the default slicer to use (``true``) or not (``false``).
|
||||
* - ``profiles``
|
||||
- 0..*
|
||||
- :ref:`Profile list <sec-api-slicing-datamodel-profilelist>`
|
||||
- Slicing profiles available for this slicer, mapped by their ``key``
|
||||
|
||||
.. _sec-api-slicing-datamodel-profilelist:
|
||||
|
||||
Profile list
|
||||
------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``<profile key>``
|
||||
- 0..1
|
||||
- :ref:`Profile <sec-api-slicing-datamodel-profile>`
|
||||
- Information about a profile stored in the system, ``data`` field will be left out.
|
||||
|
||||
.. _sec-api-slicing-datamodel-profile:
|
||||
|
||||
Profile
|
||||
-------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``key``
|
||||
- 1
|
||||
- ``string``
|
||||
- Identifier of the profile
|
||||
* - ``displayName``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Display name of the profile
|
||||
* - ``description``
|
||||
- 0..1
|
||||
- ``string``
|
||||
- Description of the profile
|
||||
* - ``default``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
- Whether this is the default profile to be used with this slicer (``true``) or not (``false``). Will always be
|
||||
returned in responses but can be left out of save/update requests.
|
||||
* - ``resource``
|
||||
- 0..1
|
||||
- ``URL``
|
||||
- Resource URL of the profile, will always be returned in responses but can be left out of save/update requests.
|
||||
* - ``data``
|
||||
- 0..1
|
||||
- Object
|
||||
- The actual profile data, including any default values if the profile was retrieved from the server. May contain
|
||||
only the keys differing from the defaults when saving/updating a profile. The keys to be found in here a slicer
|
||||
specific. Will be left out for list responses.
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
.. _sec-api-version:
|
||||
|
||||
*******************
|
||||
Version information
|
||||
*******************
|
||||
|
||||
.. http:get:: /api/version
|
||||
|
||||
Retrieve information regarding server and API version. Returns a JSON object with two keys, ``api`` containing
|
||||
the API version, ``server`` containing the server version.
|
||||
|
||||
**Example Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/version HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
|
||||
**Example Response**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"api": "0.1",
|
||||
"server": "1.1.0"
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
@@ -16,16 +16,25 @@ import sys, os
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
sys.path.insert(0, os.path.abspath('../src/'))
|
||||
sys.path.append(os.path.abspath('sphinxext'))
|
||||
|
||||
import octoprint._version
|
||||
from datetime import date
|
||||
|
||||
year_since = 2013
|
||||
year_current = date.today().year
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
needs_sphinx = '1.3'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['sphinx.ext.todo']
|
||||
extensions = ['codeblockext', 'onlineinclude', 'sphinx.ext.todo', 'sphinx.ext.autodoc', 'sphinxcontrib.httpdomain',
|
||||
'sphinx.ext.napoleon']
|
||||
todo_include_todos = True
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
@@ -41,14 +50,14 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'OctoPrint'
|
||||
copyright = u'2013, Gina Häußge'
|
||||
copyright = u'%d-%d, Gina Häußge' % (year_since, year_current) if year_current > year_since else u'%d, Gina Häußge' % year_since
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = open("../VERSION").read().strip()
|
||||
version = octoprint._version.get_versions()["version"]
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = version
|
||||
|
||||
@@ -89,12 +98,21 @@ pygments_style = 'sphinx'
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
|
||||
numfig = True
|
||||
|
||||
# -- Options for HTML output ---------------------------------------------------
|
||||
|
||||
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
|
||||
if not on_rtd: # only import and set the theme if we're building docs locally
|
||||
import sphinx_rtd_theme
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'default'
|
||||
#html_theme = "sphinx_rtd_theme"
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
@@ -102,7 +120,7 @@ html_theme = 'default'
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
@@ -125,6 +143,9 @@ html_theme = 'default'
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
def setup(app):
|
||||
app.add_stylesheet("theme_overrides.css")
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
@@ -172,7 +193,7 @@ htmlhelp_basename = 'OctoPrintdoc'
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
#latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
@@ -181,14 +202,14 @@ latex_elements = {
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
#}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'OctoPrint.tex', u'OctoPrint Documentation',
|
||||
u'Gina Häußge', 'manual'),
|
||||
]
|
||||
#latex_documents = [
|
||||
# ('index', 'OctoPrint.tex', u'OctoPrint Documentation',
|
||||
# u'Gina Häußge', 'manual'),
|
||||
#]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
|
||||
@@ -0,0 +1,997 @@
|
||||
.. _sec-configuration-config_yaml:
|
||||
|
||||
config.yaml
|
||||
===========
|
||||
|
||||
If not specified via the command line, the main configuration file ``config.yaml`` for OctoPrint is expected in its
|
||||
settings folder, which unless defined differently via the command line is located at ``~/.octoprint`` on Linux, at
|
||||
``%APPDATA%/OctoPrint`` on Windows and at ``~/Library/Application Support/OctoPrint`` on MacOS. If the file is not there,
|
||||
you can just create it - it will only get created by OctoPrint once you save settings that deviate from the default
|
||||
settings.
|
||||
|
||||
Note that many of these settings are available from the "Settings" menu in OctoPrint itself.
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-configuration-config_yaml-accesscontrol:
|
||||
|
||||
Access Control
|
||||
--------------
|
||||
|
||||
Use the following settings to enable access control:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
accessControl:
|
||||
# whether to enable access control or not. Defaults to true
|
||||
enabled: true
|
||||
|
||||
# The user manager implementation to use for accessing user information. Currently only a filebased
|
||||
# user manager is implemented which stores configured accounts in a YAML file (Default: users.yaml
|
||||
# in the default configuration folder, see below)
|
||||
userManager: octoprint.users.FilebasedUserManager
|
||||
|
||||
# The YAML user file to use. If left out defaults to users.yaml in the default configuration folder.
|
||||
userFile: /path/to/users.yaml
|
||||
|
||||
# If set to true, will automatically log on clients originating from any of the networks defined in
|
||||
# "localNetworks" as the user defined in "autologinAs". Defaults to false.
|
||||
autologinLocal: true
|
||||
|
||||
# The name of the user to automatically log on clients originating from "localNetworks" as. Must
|
||||
# be the name of one of your configured users.
|
||||
autologinAs: someUser
|
||||
|
||||
# A list of networks or IPs for which an automatic logon as the user defined in "autologinAs" will
|
||||
# take place. If available OctoPrint will evaluate the "X-Forwarded-For" HTTP header for determining
|
||||
# the client's IP address (see https://code.google.com/p/haproxy-docs/wiki/forwardfor on how to
|
||||
# configure the sending of this header in HAProxy). Defaults to 127.0.0.0/8 (so basically anything
|
||||
# originating from localhost).
|
||||
localNetworks:
|
||||
- 127.0.0.0/8
|
||||
- 192.168.1.0/24
|
||||
|
||||
.. _sec-configuration-config_yaml-api:
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
Settings for the REST API:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
api:
|
||||
# Whether to enable the API
|
||||
enabled: True
|
||||
|
||||
# Current API key needed for accessing the API
|
||||
key: ...
|
||||
|
||||
# Whether to allow cross origin access to the API or not
|
||||
allowCrossOrigin: false
|
||||
|
||||
# Additional app api keys, see REST API > Apps in the docs
|
||||
apps:
|
||||
"some.app.identifier:some_version":
|
||||
pubkey: <RSA pubkey>
|
||||
enabled: true
|
||||
|
||||
.. _sec-configuration-config_yaml-appearance:
|
||||
|
||||
Appearance
|
||||
----------
|
||||
|
||||
Use the following settings to tweak OctoPrint's appearance a bit to better distinguish multiple instances/printers
|
||||
appearance or to modify the order and presence of the various UI components:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
appearance:
|
||||
# Use this to give your printer a name. It will be displayed in the title bar
|
||||
# (as "<Name> [OctoPrint]") and in the navigation bar (as "OctoPrint: <Name>")
|
||||
name: My Printer
|
||||
|
||||
# Use this to color the navigation bar. Supported colors are red, orange,
|
||||
# yellow, green, blue, violet and default.
|
||||
color: default
|
||||
|
||||
# Makes the color of the navigation bar "transparent". In case your printer uses
|
||||
# acrylic for its frame ;)
|
||||
colorTransparent: false
|
||||
|
||||
# Configures the order and availability of the UI components
|
||||
components:
|
||||
|
||||
# Defines the order of the components within their respective containers.
|
||||
#
|
||||
# If overridden by the user the resulting order for display will be calculated as
|
||||
# follows:
|
||||
#
|
||||
# - first all components as defined by the user
|
||||
# - then all enabled core components as define in the default order (see below)
|
||||
#
|
||||
# Components not contained within the default order (e.g. from plugins) will be either
|
||||
# prepended or appended to that result, depending on component type.
|
||||
#
|
||||
# Note that a component is not included in the order as defined by the user will still
|
||||
# be put into the container, according to the default order. To fully disable a
|
||||
# component, you'll need to add it to the container's disabled list further below.
|
||||
order:
|
||||
|
||||
# order of navbar items
|
||||
navbar:
|
||||
- settings
|
||||
- systemmenu
|
||||
- login
|
||||
|
||||
# order of sidebar items
|
||||
sidebar:
|
||||
- connection
|
||||
- state
|
||||
- files
|
||||
|
||||
# order of tab items
|
||||
tab:
|
||||
- temperature
|
||||
- control
|
||||
- gcodeviewer
|
||||
- terminal
|
||||
- timelapse
|
||||
|
||||
# order of settings, if settings plugins are registered gets extended internally by
|
||||
# section_plugins and all settings plugins
|
||||
settings
|
||||
- section_printer
|
||||
- serial
|
||||
- printerprofiles
|
||||
- temperatures
|
||||
- terminalfilters
|
||||
- gcodescripts
|
||||
- section_features
|
||||
- features
|
||||
- webcam
|
||||
- accesscontrol
|
||||
- api
|
||||
- section_octoprint
|
||||
- folders
|
||||
- appearance
|
||||
- logs
|
||||
|
||||
# order of user settings
|
||||
usersettings:
|
||||
- access
|
||||
- interface
|
||||
|
||||
# order of generic templates
|
||||
generic: []
|
||||
|
||||
# Disabled components per container. If a component is included here it will not
|
||||
# be included in OctoPrint's UI at all. Note that this might mean that critical
|
||||
# functionality will not be available if no replacement is registered.
|
||||
disabled:
|
||||
navbar: [],
|
||||
sidebar: [],
|
||||
tab: [],
|
||||
settings: [],
|
||||
usersettings: [],
|
||||
generic: []
|
||||
|
||||
# Default language of OctoPrint. If left unset OctoPrint will try to match up available
|
||||
# languages with the user's browser settings.
|
||||
defaultLanguage: null
|
||||
|
||||
.. note::
|
||||
|
||||
By modifying the ``components`` > ``order`` lists you may reorder OctoPrint's UI components as you like. You can also
|
||||
inject Plugins at another than their default location in their respective container by adding the entry
|
||||
``plugin_<plugin identifier>`` where you want them to appear.
|
||||
|
||||
Example: If you want the tab of the :ref:`Hello World Plugin <sec-plugins-gettingstarted>` to appear as the first tab
|
||||
in OctoPrint, you'd need to redefine ``components`` > ``order`` > ``tab`` by including something like this in your
|
||||
``config.yaml``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
appearance:
|
||||
components:
|
||||
order:
|
||||
tab:
|
||||
- plugin_helloworld
|
||||
|
||||
OctoPrint will then turn this into the order ``plugin_helloworld``, ``temperature``, ``control``, ``gcodeviewer``,
|
||||
``terminal``, ``timelapse`` plus any other plugins.
|
||||
|
||||
|
||||
.. _sec-configuration-config_yaml-controls:
|
||||
|
||||
Controls
|
||||
--------
|
||||
|
||||
Use the ``controls`` section to add :ref:`custom controls <sec-features-custom_controls>` to the "Controls" tab within
|
||||
OctoPrint.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
controls:
|
||||
- name: Fan
|
||||
layout: horizontal
|
||||
children:
|
||||
- name: Enable Fan
|
||||
type: parametric_command
|
||||
command: M106 S%(speed)s
|
||||
input:
|
||||
- name: Speed (0-255)
|
||||
parameter: speed
|
||||
default: 255
|
||||
- name: Disable Fan
|
||||
type: command
|
||||
command: M107
|
||||
|
||||
.. _sec-configuration-config_yaml-devel:
|
||||
|
||||
Development settings
|
||||
--------------------
|
||||
|
||||
The following settings are only relevant to you if you want to do OctoPrint development:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Settings only relevant for development
|
||||
devel:
|
||||
# Settings for OctoPrint's internal caching
|
||||
cache:
|
||||
# Whether to enable caching. Defaults to true. Setting it to false will cause the UI to always
|
||||
# be fully rerendered on request to / on the server.
|
||||
enabled: true
|
||||
|
||||
# Whether to enable the preemptive cache
|
||||
preemptive: true
|
||||
|
||||
# Settings for stylesheet preference. OctoPrint will prefer to use the stylesheet type
|
||||
# specified here. Usually (on a production install) that will be the compiled css (default).
|
||||
# Developers may specify less here too.
|
||||
stylesheet: css
|
||||
|
||||
# Settings for OctoPrint's web asset merging and minifying
|
||||
webassets:
|
||||
# If set to true, OctoPrint will merge all JS, all CSS and all Less files into one file per type
|
||||
# to reduce request count. Setting it to false will load all assets individually. Note: if this is set to
|
||||
# false, no minification will take place regardless of the minify setting below.
|
||||
bundle: true
|
||||
|
||||
# If set to true, OctoPrint will minify its viewmodels (that includes those of plugins). Note: if bundle is
|
||||
# set to false, no minification will take place either.
|
||||
minify: true
|
||||
|
||||
# Whether to delete generated web assets on server startup (forcing a regeneration)
|
||||
clean_on_startup: true
|
||||
|
||||
# Settings for the virtual printer
|
||||
virtualPrinter:
|
||||
|
||||
# Whether to enable the virtual printer and include it in the list of available serial connections.
|
||||
# Defaults to false.
|
||||
enabled: true
|
||||
|
||||
# Whether to send an additional "ok" after a resend request (like Repetier)
|
||||
okAfterResend: false
|
||||
|
||||
# Whether to force checksums and line number in the communication (like Repetier), if set to true
|
||||
# printer will only accept commands that come with linenumber and checksum and throw an error for
|
||||
# lines that don't. Defaults to false
|
||||
forceChecksum: false
|
||||
|
||||
# Whether to send "ok" responses with the line number that gets acknowledged by the "ok". Defaults
|
||||
# to false.
|
||||
okWithLinenumber: false
|
||||
|
||||
# Number of extruders to simulate on the virtual printer.
|
||||
numExtruders: 1
|
||||
|
||||
# Whether to include the current tool temperature in the M105 output as separate T segment or not.
|
||||
#
|
||||
# True: > M105
|
||||
# < ok T:23.5/0.0 T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
|
||||
# False: > M105
|
||||
# < ok T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
|
||||
includeCurrentToolInTemps: true
|
||||
|
||||
# Whether to include the selected filename in the M23 File opened response.
|
||||
#
|
||||
# True: > M23 filename.gcode
|
||||
# < File opened: filename.gcode Size: 27
|
||||
# False: > M23 filename.gcode
|
||||
# > File opened
|
||||
includeFilenameInOpened: true
|
||||
|
||||
# The maximum movement speeds of the simulated printer's axes, in mm/s
|
||||
movementSpeed:
|
||||
x: 6000
|
||||
y: 6000
|
||||
z: 200
|
||||
e: 300
|
||||
|
||||
# Whether the simulated printer should also simulate a heated bed or not
|
||||
hasBed: true
|
||||
|
||||
# If enabled, reports the set target temperatures as separate messages from the firmware
|
||||
#
|
||||
# True: > M109 S220.0
|
||||
# < TargetExtr0:220.0
|
||||
# < ok
|
||||
# > M105
|
||||
# < ok T0:34.3 T1:23.5 B:43.2
|
||||
# False: > M109 S220.0
|
||||
# < ok
|
||||
# > M105
|
||||
# < ok T0:34.3/220.0 T1:23.5/0.0 B:43.2/0.0
|
||||
repetierStyleTargetTemperature: false
|
||||
|
||||
# If enabled, uses repetier style resends, sending multiple resends for the same line
|
||||
# to make sure nothing gets lost on the line
|
||||
repetierStyleResends: false
|
||||
|
||||
# If enabled, reports the first extruder in M105 responses as T instead of T0
|
||||
#
|
||||
# True: > M105
|
||||
# < ok T:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
|
||||
# False: > M105
|
||||
# < ok T0:34.3/0.0 T1:23.5/0.0 B:43.2/0.0
|
||||
smoothieTemperatureReporting: false
|
||||
|
||||
# Whether M20 responses will include filesize or not
|
||||
#
|
||||
# True: <filename> <filesize in bytes>
|
||||
# False: <filename>
|
||||
extendedSdFileList: false
|
||||
|
||||
# Forced pause for retrieving from the outgoing buffer
|
||||
throttle: 0.01
|
||||
|
||||
# Whether to send "wait" responses every "waitInterval" seconds when serial rx buffer is empty
|
||||
sendWait: false
|
||||
|
||||
# Interval in which to send "wait" lines when rx buffer is empty
|
||||
waitInterval: 1
|
||||
|
||||
# Size of the simulated RX buffer in bytes, when it's full a send from OctoPrint's
|
||||
# side will block
|
||||
rxBuffer: 64
|
||||
|
||||
# Size of simulated command buffer
|
||||
commandBuffer: 4
|
||||
|
||||
# Whether to support the M112 command with simulated kill
|
||||
supportM112: true
|
||||
|
||||
# Whether to send messages received via M117 back as "echo:" lines
|
||||
echoOnM117: true
|
||||
|
||||
# Whether to simulate broken M29 behaviour (missing ok after response)
|
||||
brokenM29: true
|
||||
|
||||
.. _sec-configuration-config_yaml-estimation:
|
||||
|
||||
Estimation
|
||||
----------
|
||||
|
||||
The following settings provide parameters for estimators within OctoPrint. Currently only
|
||||
the estimation of the left print time during an active job utilizes this section.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
estimation:
|
||||
# Parameters for the print time estmation during an ongoing print job
|
||||
printTime:
|
||||
# Until which percentage to do a weighted mixture of statistical duration (analysis or
|
||||
# past prints) with the result from the calculated estimate if that's already available.
|
||||
# Utilized to compensate for the fact that the earlier in a print job, the least accuracy
|
||||
# even a stable calculated estimate provides.
|
||||
statsWeighingUntil: 0.5
|
||||
|
||||
# Range the assumed percentage (based on current estimated statistical, calculated or mixed
|
||||
# total vs elapsed print time so far) needs to be around the actual percentage for the
|
||||
# result to be used
|
||||
validityRange: 0.15
|
||||
|
||||
# If no estimate could be calculated until this percentage and no statistical data is available,
|
||||
# use dumb linear estimate
|
||||
forceDumbFromPercent: 0.3
|
||||
|
||||
# If no estimate could be calculated until this many minutes into the print and no statistical
|
||||
# data is available, use dumb linear estimate
|
||||
forceDumbAfterMin: 30
|
||||
|
||||
# Average fluctuation between individual calculated estimates to consider in stable range. Seconds
|
||||
# of difference.
|
||||
stableThreshold: 60
|
||||
|
||||
.. _sec-configuration-config_yaml-events:
|
||||
|
||||
Events
|
||||
------
|
||||
|
||||
Use the following settings to add shell/gcode commands to be executed on certain :ref:`events <sec-events>`:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
events:
|
||||
subscriptions:
|
||||
# example event consumer that prints a message to the system log if the printer is disconnected
|
||||
- event: Disconnected
|
||||
command: "logger 'Printer got disconnected'"
|
||||
type: system
|
||||
|
||||
# example event consumer that queries printer information from the firmware, prints a "Connected"
|
||||
# message to the LCD and homes the print head upon established printer connection, disabled though
|
||||
- event: Connected
|
||||
command: M115,M117 printer connected!,G28
|
||||
type: gcode
|
||||
enabled: False
|
||||
|
||||
.. note::
|
||||
|
||||
For debugging purposes, you can also add an additional property ``debug`` to your event subscription definitions
|
||||
that if set to true will make the event handler print a log line with your subscription's command after performing
|
||||
all placeholder replacements. Example:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
events:
|
||||
subscriptions:
|
||||
- event: Startup
|
||||
command: "logger 'OctoPrint started up'"
|
||||
type: system
|
||||
debug: true
|
||||
|
||||
This will be logged in OctoPrint's logfile as
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
Executing System Command: logger 'OctoPrint started up'
|
||||
|
||||
.. _sec-configuration-config_yaml-feature:
|
||||
|
||||
Feature
|
||||
-------
|
||||
|
||||
Use the following settings to enable or disable OctoPrint features:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
feature:
|
||||
# Whether to enable the gcode viewer in the UI or not
|
||||
gCodeVisualizer: true
|
||||
|
||||
# Whether to enable the temperature graph in the UI or not
|
||||
temperatureGraph: true
|
||||
|
||||
# Specifies whether OctoPrint should wait for the start response from the printer before trying to send commands
|
||||
# during connect.
|
||||
waitForStartOnConnect: false
|
||||
|
||||
# Specifies whether OctoPrint should send linenumber + checksum with every printer command. Needed for
|
||||
# successful communication with Repetier firmware
|
||||
alwaysSendChecksum: false
|
||||
|
||||
# Specifies whether OctoPrint should also send linenumber + checksum with commands that are *not*
|
||||
# detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)").
|
||||
sendChecksumWithUnknownCommands: false
|
||||
|
||||
# Specifies whether OctoPrint should also use up acknowledgments ("ok") for commands that are *not*
|
||||
# detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)").
|
||||
unknownCommandsNeedAck: false
|
||||
|
||||
# Whether to ignore the first ok after a resend response. Needed for successful communication with
|
||||
# Repetier firmware
|
||||
swallowOkAfterResend: false
|
||||
|
||||
# Specifies whether support for SD printing and file management should be enabled
|
||||
sdSupport: true
|
||||
|
||||
# Specifies whether firmware expects relative paths for selecting SD files
|
||||
sdRelativePath: false
|
||||
|
||||
# Whether to always assume that an SD card is present in the printer.
|
||||
# Needed by some firmwares which don't report the SD card status properly.
|
||||
sdAlwaysAvailable: false
|
||||
|
||||
# Whether the printer sends repetier style target temperatures in the format
|
||||
# TargetExtr0:<temperature>
|
||||
# instead of attaching that information to the regular M105 responses
|
||||
repetierTargetTemp: false
|
||||
|
||||
# Whether to enable external heatup detection (to detect heatup triggered e.g. through the printer's LCD panel or
|
||||
# while printing from SD) or not. Causes issues with Repetier's "first ok then response" approach to
|
||||
# communication, so disable for printers running Repetier firmware.
|
||||
externalHeatupDetection: true
|
||||
|
||||
# Whether to enable the keyboard control feature in the control tab
|
||||
keyboardControl: true
|
||||
|
||||
# Whether to actively poll the watched folder (true) or to rely on the OS's file system
|
||||
# notifications instead (false)
|
||||
pollWatched: false
|
||||
|
||||
# Whether to ignore identical resends from the printer (true, repetier) or not (false)
|
||||
ignoreIdenticalResends: false
|
||||
|
||||
# If ignoredIdenticalResends is true, how many consecutive identical resends to ignore
|
||||
identicalResendsCount: 7
|
||||
|
||||
.. _sec-configuration-config_yaml-folder:
|
||||
|
||||
Folder
|
||||
------
|
||||
|
||||
Use the following settings to set custom paths for folders used by OctoPrint:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
folder:
|
||||
# Absolute path where to store gcode uploads. Defaults to the uploads folder in the OctoPrint settings folder
|
||||
uploads: /path/to/upload/folder
|
||||
|
||||
# Absolute path where to store finished timelapse recordings. Defaults to the timelapse folder in the OctoPrint
|
||||
# settings dir
|
||||
timelapse: /path/to/timelapse/folder
|
||||
|
||||
# Absolute path where to store temporary timelapse files. Defaults to the timelapse/tmp folder in the OctoPrint
|
||||
# settings dir
|
||||
timelapse_tmp: /path/to/timelapse/tmp/folder
|
||||
|
||||
# Absolute path where to store log files. Defaults to the logs folder in the OctoPrint settings dir
|
||||
logs: /path/to/logs/folder
|
||||
|
||||
# Absolute path to the virtual printer's simulated SD card. Only useful for development, just ignore
|
||||
# it otherwise
|
||||
virtualSd: /path/to/virtualSd/folder
|
||||
|
||||
# Absolute path to a folder being watched for new files which then get automatically
|
||||
# added to OctoPrint (and deleted from that folder). Can e.g. be used to define a folder which
|
||||
# can then be mounted from remote machines and used as local folder for quickly adding downloaded
|
||||
# and/or sliced objects to print in the future.
|
||||
watched: /path/to/watched/folder
|
||||
|
||||
# Absolute path to a folder where manually installed plugins may reside
|
||||
plugins: /path/to/plugins/folder
|
||||
|
||||
# Absolute path where to store slicing profiles
|
||||
slicingProfiles: /path/to/slicingProfiles/folder
|
||||
|
||||
# Absolute path where to store printer profiles
|
||||
printerProfiles: /path/to/printerProfiles/folder
|
||||
|
||||
# Absolute path where to store (GCODE) scripts
|
||||
scripts: /path/to/scripts/folder
|
||||
|
||||
.. _sec-configuration-config_yaml-plugins:
|
||||
|
||||
Plugin settings
|
||||
---------------
|
||||
|
||||
The ``plugins`` section is where plugins can store their specific settings. It is also where the installed but disabled
|
||||
plugins are tracked:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Settings for plugins
|
||||
plugins:
|
||||
|
||||
# Identifiers of installed but disabled plugins
|
||||
_disabled:
|
||||
- ...
|
||||
|
||||
# The rest are individual plugin settings, each tracked by their identifier, e.g.:
|
||||
some_plugin:
|
||||
some_setting: true
|
||||
some_other_setting: false
|
||||
|
||||
.. _sec-configuration-config_yaml-printerprofiles:
|
||||
|
||||
Printer Profiles
|
||||
----------------
|
||||
|
||||
Defaults settings for printer profiles.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Settings for printer profiles
|
||||
printerProfiles:
|
||||
|
||||
# Name of the printer profile to default to
|
||||
default: _default
|
||||
|
||||
# Default printer profile
|
||||
defaultProfile:
|
||||
...
|
||||
|
||||
.. _sec-configuration-config_yaml-scripts:
|
||||
|
||||
Scripts
|
||||
-------
|
||||
|
||||
Default scripts and snippets. You'd usually not edit the ``config.yaml`` file to adjust those but instead create the
|
||||
corresponding files in ``~/.octoprint/scripts/``. See :ref:`GCODE Script <sec-features-gcode_scripts>`.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Configured scripts
|
||||
scripts:
|
||||
|
||||
# GCODE scripts and snippets
|
||||
gcode:
|
||||
|
||||
# Script called after OctoPrint connected to the printer.
|
||||
afterPrinterConnected:
|
||||
|
||||
# Script called before a print was started.
|
||||
beforePrintStarted:
|
||||
|
||||
# Script called after a print was cancelled.
|
||||
afterPrintCancelled: "; disable motors\nM84\n\n;disable all heaters\n{% snippet 'disable_hotends' %}\nM140 S0\n\n;disable fan\nM106 S0"
|
||||
|
||||
# Script called after a print was successfully completed.
|
||||
afterPrintDone:
|
||||
|
||||
# Script called after a print was paused.
|
||||
afterPrintPaused:
|
||||
|
||||
# Script called before a print was resumed.
|
||||
beforePrintResumed:
|
||||
|
||||
# Snippets that may be used in scripts
|
||||
snippets:
|
||||
disable_hotends: "{% for tool in range(printer_profile.extruder.count) %}M104 T{{ tool }} S0\n{% endfor %}"
|
||||
|
||||
.. _sec-configuration-config_yaml-serial:
|
||||
|
||||
Serial
|
||||
------
|
||||
|
||||
Use the following settings to configure the serial connection to the printer:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
serial:
|
||||
# Use the following option to define the default serial port, defaults to unset (= AUTO)
|
||||
port: /dev/ttyACM0
|
||||
|
||||
# Use the following option to define the default baudrate, defaults to unset (= AUTO)
|
||||
baudrate: 115200
|
||||
|
||||
# Whether to automatically connect to the printer on server startup (if available)
|
||||
autoconnect: false
|
||||
|
||||
# Whether to log whole communication to serial.log (warning: might decrease performance)
|
||||
log: false
|
||||
|
||||
# Timeouts used for the serial connection to the printer, you might want to adjust these if you are
|
||||
# experiencing connection problems
|
||||
timeout:
|
||||
|
||||
# Timeout for waiting for a response from the currently tested port during autodetect, in seconds.
|
||||
# Defaults to 0.5 sec
|
||||
detection: 0.5
|
||||
|
||||
# Timeout for waiting to establish a connection with the selected port, in seconds.
|
||||
# Defaults to 2 sec
|
||||
connection: 2
|
||||
|
||||
# Timeout during serial communication, in seconds.
|
||||
# Defaults to 5 sec
|
||||
communication: 5
|
||||
|
||||
# Use this to define additional patterns to consider for serial port listing. Must be a valid
|
||||
# "glob" pattern (see http://docs.python.org/2/library/glob.html). Defaults to not set.
|
||||
additionalPorts:
|
||||
- /dev/myPrinterSymlink
|
||||
|
||||
# Commands which are known to take a long time to be acknowledged by the firmware. E.g.
|
||||
# homing, dwelling, auto leveling etc. Defaults to the below commands.
|
||||
longRunningCommands:
|
||||
- G4
|
||||
- G28
|
||||
- G29
|
||||
- G30
|
||||
- G32
|
||||
- M400
|
||||
- M226
|
||||
|
||||
# Commands which need to always be send with a checksum. Defaults to only M110
|
||||
checksumRequiringCommands:
|
||||
- M110
|
||||
|
||||
# Command to send in order to initiate a handshake with the printer.
|
||||
# Defaults to "M110 N0" which simply resets the line numbers in the firmware and which
|
||||
# should be acknowledged with a simple "ok".
|
||||
helloCommand: M110 N0
|
||||
|
||||
# Whether to disconnect on errors or not
|
||||
disconnectOnErrors: true
|
||||
|
||||
# Whether to completely ignore errors from the firmware or not
|
||||
ignoreErrorsFromFirmware: false
|
||||
|
||||
# Whether to log resends to octoprint.log or not. Invaluable debug tool without performance
|
||||
# impact, leave on if possible please
|
||||
logResends: true
|
||||
|
||||
# Whether to support resends without follow-up ok or not
|
||||
supportResendsWithoutOk: false
|
||||
|
||||
# Whether to "manually" trigger an ok for M29 (a lot of versions of this command are buggy and
|
||||
# the responds skips on the ok)
|
||||
triggerOkForM29: true
|
||||
|
||||
.. _sec-configuration-config_yaml-server:
|
||||
|
||||
Server
|
||||
------
|
||||
|
||||
Use the following settings to configure the server:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
server:
|
||||
# Use this option to define the host to which to bind the server, defaults to "0.0.0.0" (= all
|
||||
# interfaces)
|
||||
host: 0.0.0.0
|
||||
|
||||
# Use this option to define the port to which to bind the server, defaults to 5000
|
||||
port: 5000
|
||||
|
||||
# If this option is true, OctoPrint will show the First Run dialog and set it to false after that
|
||||
# completes
|
||||
firstRun: false
|
||||
|
||||
# Secret key for encrypting cookies and such, randomly generated on first run
|
||||
secretKey: someSecretKey
|
||||
|
||||
# Settings if OctoPrint is running behind a reverse proxy (haproxy, nginx, apache, ...).
|
||||
# These are necessary in order to make OctoPrint generate correct external URLs so
|
||||
# that AJAX requests and download URLs work.
|
||||
reverseProxy:
|
||||
|
||||
# The request header from which to determine the url prefix under which OctoPrint
|
||||
# is served by the reverse proxy
|
||||
prefixHeader: X-Script-Name
|
||||
|
||||
# The request header from which to determine the scheme (http or https) under which
|
||||
# a specific request to OctoPrint was made to the reverse proxy
|
||||
schemeHeader: X-Scheme
|
||||
|
||||
# The request header from which to determine the host under which OctoPrint
|
||||
# is served by the reverse proxy
|
||||
hostHeader: X-Forwarded-Host
|
||||
|
||||
# Use this option to define an optional url prefix (with a leading /, so absolute to your
|
||||
# server's root) under which to run OctoPrint. This should only be needed if you want to run
|
||||
# OctoPrint behind a reverse proxy under a different root endpoint than `/` and can't configure
|
||||
# said reverse proxy to send a prefix HTTP header (X-Script-Name by default, see above) with
|
||||
# forwarded requests.
|
||||
prefixFallback:
|
||||
|
||||
# Use this option to define an optional forced scheme (http or https) under which to run
|
||||
# OctoPrint. This should only be needed if you want to run OctoPrint behind a reverse
|
||||
# proxy that also does HTTPS determination but can't configure said reverse proxy to
|
||||
# send a scheme HTTP header (X-Scheme by default, see above) with forwarded requests.
|
||||
schemeFallback:
|
||||
|
||||
# Use this option to define an optional forced host under which to run OctoPrint. This should
|
||||
# only be needed if you want to run OctoPrint behind a reverse proxy with a different hostname
|
||||
# than OctoPrint itself but can't configure said reverse proxy to send a host HTTP header
|
||||
# (X-Forwarded-Host by default, see above) with forwarded requests.
|
||||
hostFallback:
|
||||
|
||||
# Settings for file uploads to OctoPrint, such as maximum allowed file size and
|
||||
# header suffixes to use for streaming uploads. OctoPrint does some nifty things internally in
|
||||
# order to allow streaming of large file uploads to the application rather than just storing
|
||||
# them in memory. For that it needs to do some rewriting of the incoming upload HTTP requests,
|
||||
# storing the uploaded file to a temporary location on disk and then sending an internal request
|
||||
# to the application containing the original filename and the location of the temporary file.
|
||||
uploads:
|
||||
|
||||
# Maximum size of uploaded files in bytes, defaults to 1GB.
|
||||
maxSize: 1073741824
|
||||
|
||||
# Suffix used for storing the filename in the file upload headers when streaming uploads.
|
||||
nameSuffix: name
|
||||
|
||||
# Suffix used for storing the path to the temporary file in the file upload headers when
|
||||
# streaming uploads.
|
||||
pathSuffix: path
|
||||
|
||||
# Maximum size of requests other than file uploads in bytes, defaults to 100KB.
|
||||
maxSize: 102400
|
||||
|
||||
# Commands to restart/shutdown octoprint or the system it's running on
|
||||
commands:
|
||||
|
||||
# Command to restart OctoPrint, defaults to being unset
|
||||
serverRestartCommand: sudo service octoprint restart
|
||||
|
||||
# Command to restart the system OctoPrint is running on, defaults to being unset
|
||||
systemRestartCommand: sudo shutdown -r now
|
||||
|
||||
# Command to shut down the system OctoPrint is running on, defaults to being unset
|
||||
systemShutdownCommand: sudo shutdown -h now
|
||||
|
||||
# Settings of when to display what disk space warning
|
||||
diskspace:
|
||||
|
||||
# Threshold (bytes) after which to consider disk space becoming sparse,
|
||||
# defaults to 500MB
|
||||
warning: 63488000
|
||||
|
||||
# Threshold (bytes) after which to consider disk space becoming critical,
|
||||
# defaults to 200MB
|
||||
critical: 209715200
|
||||
|
||||
# Configuration of the preemptive cache
|
||||
preemptiveCache:
|
||||
|
||||
# which server paths to exclude from the preemptive cache
|
||||
exceptions:
|
||||
- /some/path
|
||||
|
||||
# How many days to leave unused entries in the preemptive cache config
|
||||
until: 7
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
If you want to run OctoPrint behind a reverse proxy such as HAProxy or Nginx and use a different base URL than the
|
||||
server root ``/`` you have two options to achieve this. One approach is using the configuration settings ``baseUrl`` and
|
||||
``scheme`` mentioned above in which OctoPrint will only work under the configured base URL.
|
||||
|
||||
The second and better approach is to make your proxy send a couple of custom headers with each forwarded requests:
|
||||
|
||||
* ``X-Script-Name``: should contain your custom baseUrl (absolute server path), e.g. ``/octoprint``
|
||||
* ``X-Scheme``: should contain your custom URL scheme to use (if different from ``http``), e.g. ``https``
|
||||
|
||||
If you use these headers OctoPrint will work both via the reverse proxy as well as when called directly. Take a look
|
||||
`into OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki/Reverse-proxy-configuration-examples>`_ for a couple
|
||||
of examples on how to configure this.
|
||||
|
||||
.. _sec-configuration-config_yaml-slicing:
|
||||
|
||||
Slicing
|
||||
-------
|
||||
|
||||
Settings for the built-in slicing support:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Slicing settings
|
||||
slicing:
|
||||
|
||||
# Whether to enable slicing support or not
|
||||
enabled:
|
||||
|
||||
# Default slicer to use
|
||||
defaultSlicer: cura
|
||||
|
||||
# Default slicing profiles per slicer
|
||||
defaultProfiles:
|
||||
cura: ...
|
||||
|
||||
.. _sec-configuration-config_yaml-system:
|
||||
|
||||
System
|
||||
------
|
||||
|
||||
Use the following settings to add custom system commands to the "System" dropdown within OctoPrint's top bar.
|
||||
|
||||
Commands consist of a name, an action identifier, the commandline to execute and an optional confirmation message to
|
||||
display before actually executing the command (should be set to False if a confirmation dialog is not desired).
|
||||
|
||||
The following example defines a command for shutting down the system under Linux. It assumes that the user under which
|
||||
OctoPrint is running is allowed to do this without password entry:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
system:
|
||||
actions:
|
||||
- name: Shutdown
|
||||
action: shutdown
|
||||
command: sudo shutdown -h now
|
||||
confirm: You are about to shutdown the system.
|
||||
|
||||
You can also add an divider by setting action to divider like this:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
system:
|
||||
actions:
|
||||
- action: divider
|
||||
|
||||
|
||||
.. _sec-configuration-config_yaml-temperature:
|
||||
|
||||
Temperature
|
||||
-----------
|
||||
|
||||
Use the following settings to configure temperature profiles which will be displayed in the temperature tab:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
temperature:
|
||||
profiles:
|
||||
- name: ABS
|
||||
extruder: 210
|
||||
bed: 100
|
||||
- name: PLA
|
||||
extruder: 180
|
||||
bed: 60
|
||||
|
||||
.. _sec-configuration-config_yaml-terminalfilters:
|
||||
|
||||
Terminal Filters
|
||||
----------------
|
||||
|
||||
Use the following settings to define a set of terminal filters to display in the terminal tab for filtering certain
|
||||
lines from the display terminal log.
|
||||
|
||||
Use `Javascript regular expressions <https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions>`_:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# A list of filters to display in the terminal tab. Defaults to the filters shown below
|
||||
terminalFilters:
|
||||
- name: Suppress M105 requests/responses
|
||||
regex: '(Send: M105)|(Recv: ok T:)'
|
||||
- name: Suppress M27 requests/responses
|
||||
regex: '(Send: M27)|(Recv: SD printing byte)'
|
||||
|
||||
.. _sec-configuration-config_yaml-webcam:
|
||||
|
||||
Webcam
|
||||
------
|
||||
|
||||
Use the following settings to configure webcam support:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
webcam:
|
||||
# Use this option to enable display of a webcam stream in the UI, e.g. via MJPG-Streamer.
|
||||
# Webcam support will be disabled if not set
|
||||
stream: http://<stream host>:<stream port>/?action=stream
|
||||
|
||||
# Use this option to enable timelapse support via snapshot, e.g. via MJPG-Streamer.
|
||||
# Timelapse support will be disabled if not set
|
||||
snapshot: http://<stream host>:<stream port>/?action=snapshot
|
||||
|
||||
# Path to ffmpeg binary to use for creating timelapse recordings.
|
||||
# Timelapse support will be disabled if not set
|
||||
ffmpeg: /path/to/ffmpeg
|
||||
|
||||
# Number of how many threads to instruct ffmpeg to use for encoding. Defaults to 1.
|
||||
# Should be left at 1 for RPi1.
|
||||
ffmpegThreads: 1
|
||||
|
||||
# The bitrate to use for rendering the timelapse video. This gets directly passed to ffmpeg.
|
||||
bitrate: 5000k
|
||||
|
||||
# Whether to include a "created with OctoPrint" watermark in the generated timelapse movies
|
||||
watermark: true
|
||||
|
||||
# The default timelapse settings.
|
||||
timelapse:
|
||||
|
||||
# The timelapse type. Can be either "off", "zchange" or "timed". Defaults to "off"
|
||||
type: timed
|
||||
|
||||
# Additional options depending on the timelapse type. All timelapses take a postRoll and an fps setting.
|
||||
options:
|
||||
# The number of seconds in the rendered video to add after a finished print. The exact way how the
|
||||
# additional images will be recorded depends on timelapse type. Timed timelapses continue to
|
||||
# record just like at the beginning, so the recording will continue another
|
||||
# fps * postRoll * interval seconds. Zchange timelapses will take one final picture and add it fps * postRoll
|
||||
postRoll: 0
|
||||
|
||||
# The framerate at which to render the movie
|
||||
fps: 25
|
||||
|
||||
# Timed timelapses only: The interval which to leave between images in seconds
|
||||
interval: 2
|
||||
@@ -0,0 +1,12 @@
|
||||
.. _sec-configuration:
|
||||
|
||||
#############
|
||||
Configuration
|
||||
#############
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
yaml.rst
|
||||
config_yaml.rst
|
||||
logging_yaml.rst
|
||||
@@ -0,0 +1,100 @@
|
||||
.. _sec-configuration-logging_yaml:
|
||||
|
||||
logging.yaml
|
||||
============
|
||||
|
||||
The logging configuration file ``logging.yaml`` for OctoPrint is expected in its settings folder, which unless defined
|
||||
differently on the command line is located at ``~/.octoprint`` on Linux, at ``%APPDATA%/OctoPrint`` on Windows and at
|
||||
``~/Library/Application Support/OctoPrint`` on MacOS.
|
||||
|
||||
You can use it to change the log levels of the individual components within OctoPrint, which might be necessary to help
|
||||
in debugging issues you are experiencing, or to change the configuration of the logging handlers themselves, e.g. in
|
||||
order to change size after which to rollover the ``serial.log``.
|
||||
|
||||
Changing log levels
|
||||
-------------------
|
||||
|
||||
If you need to change the default logging level within OctoPrint, create the file with a text editor of your choice
|
||||
(it's usually not there). The general format is this::
|
||||
|
||||
loggers:
|
||||
<component>:
|
||||
level: <loglevel>
|
||||
|
||||
with ``<component>`` being the internal OctoPrint component for which to change the loglevel, and ``<loglevel>`` being the
|
||||
new log level to set. An example for increasing the log level of the events and the file management components to
|
||||
``DEBUG`` (the highest amount of logging) would be this ``logging.yaml``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
loggers:
|
||||
octoprint.events:
|
||||
level: DEBUG
|
||||
octoprint.filemanager:
|
||||
level: DEBUG
|
||||
|
||||
A list of important components for which an increase in logging might be interesting follows:
|
||||
|
||||
* ``octoprint.events``: the event sub system
|
||||
* ``octoprint.filemanager``: the file management layer
|
||||
* ``octoprint.plugin``: the plugin sub system
|
||||
* ``octoprint.plugins.<plugin>``: the plugin ``<plugin>``, e.g. ``octoprint.plugins.discovery`` to change the log level of
|
||||
the `Discovery plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Discovery>`_ or ``octoprint.plugins.cura``
|
||||
to change the log level of the `Cura plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura>`_.
|
||||
* ``octoprint.slicing``: the slicing sub system
|
||||
|
||||
This list will be expanded when deemed necessary.
|
||||
|
||||
Changing logging handlers
|
||||
-------------------------
|
||||
|
||||
You can also change the configuration of the logging handlers themselves, e.g. in order to make the ``serial.log`` larger
|
||||
for debugging long running communications or to change the behaviour of the ``octoprint.log``.
|
||||
|
||||
You can find the default configurations of the ``file`` handler used for the ``octoprint.log``, the ``serialFile`` handler
|
||||
used for the ``serial.log`` and the ``console`` handler used for the output to stdout in YAML format below:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
handlers:
|
||||
# stdout
|
||||
console:
|
||||
class: logging.StreamHandler
|
||||
level: DEBUG
|
||||
formatter: simple
|
||||
stream: ext://sys.stdout
|
||||
|
||||
# octoprint.log
|
||||
file:
|
||||
class: logging.handlers.TimedRotatingFileHandler
|
||||
level: DEBUG
|
||||
formatter: simple
|
||||
when: D
|
||||
backupCount: 1
|
||||
filename: /path/to/octoprints/logs/octoprint.log
|
||||
|
||||
# serial.log
|
||||
serialFile:
|
||||
class: logging.handlers.RotatingFileHandler
|
||||
level: DEBUG
|
||||
formatter: simple
|
||||
maxBytes: 2097152 # 2 * 1024 * 1024 = 2 MB in bytes
|
||||
filename: /path/to/octoprints/logs/serial.log
|
||||
|
||||
You can find more information on the used logging handlers in the
|
||||
`Python documentation on logging handlers <https://docs.python.org/2/library/logging.handlers.html>`_.
|
||||
|
||||
Changing logging formatters
|
||||
---------------------------
|
||||
|
||||
The logging formatters can be defined via ``logging.yaml`` as well. The ``simple`` formatter as referenced above is
|
||||
expressed in YAML as follows:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
formatters:
|
||||
simple:
|
||||
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
||||
|
||||
The possible keys for the logging format can be found in the
|
||||
`Python documentation on LogRecord attributes <https://docs.python.org/2/library/logging.html#logrecord-attributes>`_.
|
||||
@@ -0,0 +1,224 @@
|
||||
.. _sec-configuration-yaml:
|
||||
|
||||
A YAML Primer
|
||||
=============
|
||||
|
||||
Most of OctoPrint's configuration is done under the hood through `YAML <https://en.wikipedia.org/wiki/YAML>`_ files,
|
||||
which is why it makes sense to shed some light on the basics of this data serialization format.
|
||||
|
||||
YAML is a text based format which excels at representing the most common of data structures in an easy and very human
|
||||
readable way, which is why it was chosen for OctoPrint's configuration files. A text editor is all you need in order
|
||||
to write YAML configuration files.
|
||||
|
||||
.. _sec-configuration-yaml-basic:
|
||||
|
||||
Basic Rules
|
||||
-----------
|
||||
|
||||
First of all some basic things to know about working with YAML files:
|
||||
|
||||
* Never use tabs outside of quoted strings, especially not for indentation. The tab character is illegal within
|
||||
YAML files.
|
||||
* Whitespace and indentation matters and plays an important part in structuring the data, so take special care
|
||||
to stay consistent here.
|
||||
* YAML's comments start with a ``#`` and go until the end of the line.
|
||||
|
||||
.. _sec-configuration-yaml-types:
|
||||
|
||||
Interesting data types
|
||||
----------------------
|
||||
|
||||
You will probably only come across the three most basic types of data within OctoPrint's YAML files: scalars
|
||||
(such as strings, integers, ...), lists and associated arrays (aka key-value-pairs, aka maps, aka dictionaries).
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar:
|
||||
|
||||
Scalars
|
||||
.......
|
||||
|
||||
Scalars are the most basic of all data types and are simple string, integer, float or boolean values.
|
||||
|
||||
For most scalars you don't need any quotes at all, but if you need to define some piece of data which contains characters
|
||||
that could be mistaken with YAML syntax you need to quote it in either double ``"`` or single ``'`` quotes for the
|
||||
YAML file to stay valid. As simple rule of thumb, if your data contains any of these characters ``:-{}[]!#|>&%@`` better
|
||||
quote it. Also quote it if you want a string but it could be mistaken for a valid number (integer or float) or if
|
||||
it consists only of "Yes", "No", "yes", "no", "true" or "false", which would be converted to a boolean without quotes.
|
||||
|
||||
In double quoted strings if you need to include a literal double quote in your string you can escape it by prefixing
|
||||
it with a backslash ``\`` (which you can in turn escape by itself). In single quoted strings the single quote character
|
||||
can be escaped by prefixing it with another single quote, basically doubling it. Backslashes in single quoted strings
|
||||
do not need to be escaped.
|
||||
|
||||
Quoted strings can also span across multiple lines, just indent the following lines. Note that you'll need to add a
|
||||
completely empty line in order for force a line break, the data will not be actually wrapped across multiple lines
|
||||
just because you spread its representation across multiple lines.
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar-int:
|
||||
|
||||
int
|
||||
'''
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
23
|
||||
|
||||
42
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar-float:
|
||||
|
||||
float
|
||||
'''''
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
23.5
|
||||
|
||||
100.0
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar-boolean:
|
||||
|
||||
boolean
|
||||
'''''''
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
true
|
||||
|
||||
false
|
||||
|
||||
Yes
|
||||
|
||||
No
|
||||
|
||||
yes
|
||||
|
||||
no
|
||||
|
||||
.. _sec-configuration-yaml-types-scalar-string:
|
||||
|
||||
string
|
||||
''''''
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
a string
|
||||
|
||||
"some quoted string with a : colon and a { bracket and a quote \" and a backslash \\ - phew"
|
||||
|
||||
'some single quoted string with a single quote '' and a backslash \ - yay'
|
||||
|
||||
"and a multiline string - just because we can we'll make it span
|
||||
across not two but four YAML lines!
|
||||
|
||||
Including this paragraph. But in fact it will only be two lines :)"
|
||||
|
||||
"23"
|
||||
|
||||
"42.3"
|
||||
|
||||
"Yes"
|
||||
|
||||
"No"
|
||||
|
||||
"true"
|
||||
|
||||
"false"
|
||||
|
||||
yes and no
|
||||
|
||||
true or false
|
||||
|
||||
.. _sec-configuration-yaml-types-lists:
|
||||
|
||||
Lists
|
||||
.....
|
||||
|
||||
Lists allow to "collect" a number of similar things into one data structure. They are created by prefixing one or more
|
||||
consecutive lines with a ``-``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
- item 1
|
||||
- 23.42
|
||||
- 57
|
||||
- true
|
||||
|
||||
Take special care to have all of your list items at the same indentation level!
|
||||
|
||||
.. _sec-configuration-yaml-types-dicts:
|
||||
|
||||
Dictionaries
|
||||
............
|
||||
|
||||
Dictionaries (aka associative arrays aka maps) allow organizing the data in key value pairs, with the key and the value
|
||||
being separated through a colon ``:``:
|
||||
|
||||
.. sourcecode:: yaml
|
||||
|
||||
key: value
|
||||
anotherkey: another value
|
||||
|
||||
.. _sec-configuration-yaml-examples:
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
Based on the three types explained above, quite complex data structures are possible (whitespace made visible to
|
||||
help track indentation):
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
:whitespace:
|
||||
|
||||
general:
|
||||
some_setting: some_value
|
||||
a_list:
|
||||
- item 1
|
||||
- 23.42
|
||||
- 57
|
||||
- true
|
||||
some_flag: true
|
||||
quoted_string: "This string is quoted because {we have this here} and also > this and : that"
|
||||
specific:
|
||||
setting1: value1
|
||||
setting2:
|
||||
subsetting21: value11
|
||||
subsetting22:
|
||||
- subsubsetting221
|
||||
- subsubsetting222
|
||||
- subsubsetting223
|
||||
the_end: yes
|
||||
|
||||
In this example we have a dictionary on the top most "layer" which has three keys, ``general``, ``specific`` and
|
||||
``the_end``.
|
||||
|
||||
``general`` in turn is a dictionary with the keys ``some_setting`` (a string), ``a_list`` (a list with four items,
|
||||
a string, a float, an int and a boolean), ``some_flag`` (a boolean) and ``quoted_string`` (a -- you guessed it -- string).
|
||||
|
||||
``specific`` is also a dictionary, with keys ``setting1`` (a string) and ``setting2``, a dictionary with two keys, one
|
||||
a string and the other again a list.
|
||||
|
||||
Finally, ``the_end`` is just a boolean, since an unquoted ``yes`` evaluates as a boolean value as we saw in the
|
||||
:ref:`section about boolean scalars above <sec-configuration-yaml-types-scalar-boolean>`.
|
||||
|
||||
Don't get confused by the list "dividing" one part of the dictionary under ``general`` from the other -- your mind is
|
||||
just playing a trick on you due to the list's dashes ``-`` being on the same levels as the dictionary keys. You could
|
||||
also just add two more spaces to your identation and write that part like this, which makes the structure a bit
|
||||
clearer (whitespace again made visible to help track indentation):
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
:whitespace:
|
||||
|
||||
general:
|
||||
some_setting: some_value
|
||||
a_list:
|
||||
- item 1
|
||||
- 23.42
|
||||
- 57
|
||||
- true
|
||||
some_flag: true
|
||||
# ...
|
||||
|
||||
Just make sure you follow a consistent way of indenting your files -- YAML is not as strict as Python when it comes to
|
||||
differing identation variants within the same file (as long as it's still valid), but consistency will help you as
|
||||
a lot as a human. Ideally you'll use a text editor which highlights white space characters for you (most editors can
|
||||
be configured this way), this will help tremendously when editing whitespace sensitive syntax such as YAML.
|
||||
@@ -0,0 +1,10 @@
|
||||
.. _sec-development:
|
||||
|
||||
###########
|
||||
Development
|
||||
###########
|
||||
|
||||
.. todo::
|
||||
|
||||
This is where notes regarding developing OctoPrint will be placed, such as workflow for setting up the
|
||||
development environment, code guidelines etc.
|
||||
@@ -0,0 +1,396 @@
|
||||
.. _sec-events:
|
||||
|
||||
######
|
||||
Events
|
||||
######
|
||||
|
||||
.. contents::
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
With release of OctoPrint 1.1.0, the payload data has been harmonized, it is now a key-value-map for all events.
|
||||
Additionally, the format of the placeholders in both system command and gcode command triggers has been changed to
|
||||
accommodate for this new format. Last but not least, the way of specifying event hooks has changed, OctoPrint no longer
|
||||
separates hooks into two sections (gcodeCommandTrigger and systemCommandTrigger) but instead event hooks are now typed
|
||||
to indicate what to do with the command contained.
|
||||
|
||||
.. _sec-events-configuration:
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Event hooks are configured via OctoPrint's configuration file ``config.yaml``. There they are contained in a
|
||||
``subscriptions`` list located directly under the ``events`` node. The ``command`` node accepts either a single string
|
||||
or a list of strings so that multiple commands can be executed in one go. Each hook carries an additional node type that
|
||||
must be either ``gcode`` (for GCODE commands to be sent to the printer based on the event) or ``system`` (for commands to be
|
||||
executed on the system OctoPrint is running on).
|
||||
|
||||
All event hooks can be disabled completely by setting ``event > enabled`` to ``false``. You can also disable individual
|
||||
hooks by setting the (optional) node ``enabled`` to false, see the example below.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
.. sourcecode:: yaml
|
||||
|
||||
events:
|
||||
enabled: True
|
||||
subscriptions:
|
||||
- event: Disconnected
|
||||
command: python ~/growl.py -t mygrowlserver -d "Lost connection to printer" -a OctoPrint -i http://raspi/Octoprint_logo.png
|
||||
type: system
|
||||
enabled: false
|
||||
- event: PrintStarted
|
||||
command: python ~/growl.py -t mygrowlserver -d "Starting {file}" -a OctoPrint -i http://raspi/Octoprint_logo.png
|
||||
type: system
|
||||
- event: PrintDone
|
||||
command: python ~/growl.py -t mygrowlserver -d "Completed {file}" -a OctoPrint -i http://raspi/Octoprint_logo.png
|
||||
type: system
|
||||
- event: Connected
|
||||
command:
|
||||
- M115
|
||||
- M117 printer connected!
|
||||
- G28
|
||||
type: gcode
|
||||
|
||||
.. _sec-events-placeholders:
|
||||
|
||||
Placeholders
|
||||
============
|
||||
|
||||
You can use the following generic placeholders in your event hooks:
|
||||
|
||||
* ``{__currentZ}``: the current Z position of the head if known, -1 if not available
|
||||
* ``{__filename}``: filename of the currently selected file, "NO FILE" if not available
|
||||
* ``{__progress}``: the progress of the print in percent, 0 if not available
|
||||
* ``{__data}``: a string representation of the payload
|
||||
* ``{__now}``: the date and time of the event in ISO 8601
|
||||
|
||||
Additionally, all data from the payload can be accessed by its key. Example: If the payload happens to be defined
|
||||
something like this:
|
||||
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
then you'll be able to access the filename via the placeholder ``{file}`` and the origin via the placeholder ``{origin}``.
|
||||
|
||||
|
||||
.. _sec-events-available_events:
|
||||
|
||||
Available Events
|
||||
================
|
||||
|
||||
Server
|
||||
------
|
||||
|
||||
Startup
|
||||
The server has started
|
||||
|
||||
ClientOpened
|
||||
A client has connected to the web server.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``remoteAddress``: the remote address (IP) of the client that connected
|
||||
|
||||
**Note:** Name changed in version 1.1.0
|
||||
|
||||
ClientClosed
|
||||
A client has disconnected from the webserver
|
||||
|
||||
Payload:
|
||||
|
||||
* ``remoteAddress``: the remote address (IP) of the client that disconnected
|
||||
|
||||
Printer communication
|
||||
---------------------
|
||||
|
||||
Connected
|
||||
The server has connected to the printer.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``port``: the connected serial port
|
||||
* ``baudrate``: the baud rate
|
||||
|
||||
Disconnected
|
||||
The server has disconnected from the printer
|
||||
|
||||
Error
|
||||
An error has occurred in the printer communication.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``error``: the error string
|
||||
|
||||
File handling
|
||||
-------------
|
||||
|
||||
Upload
|
||||
A file has been uploaded.
|
||||
|
||||
Payload:
|
||||
* ``file``: the file's name
|
||||
* ``target``: the target to which the file was uploaded, either ``local`` or ``sdcard``
|
||||
|
||||
UpdatedFiles
|
||||
A file list was modified.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``type``: the type of file list that was modified. Currently only ``printables`` and ``gcode`` (DEPRECATED) are supported here.
|
||||
|
||||
.. note::
|
||||
|
||||
The type ``gcode`` has been renamed to ``printables`` with the introduction of a new file management layer that
|
||||
supports STL files as first class citizens as well. For reasons of backwards compatibility the ``UpdatedFiles``
|
||||
event for printable files will be fired twice, once with ``type`` set to ``gcode``, once set to ``printables``.
|
||||
Support for the ``gcode`` type will be removed in the next release after version 1.2.0.
|
||||
|
||||
MetadataAnalysisStarted
|
||||
The metadata analysis of a GCODE file has started.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the file's name
|
||||
|
||||
MetadataAnalaysisFinished
|
||||
The metadata analysis of a GCODE file has finished.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the file's name
|
||||
* ``result``: the analysis result -- this is a python object currently only available for internal use
|
||||
|
||||
FileSelected
|
||||
A GCODE file has been selected for printing.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the full path to the file
|
||||
* ``filename``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
FileDeselected
|
||||
No file is selected any more for printing.
|
||||
|
||||
TransferStarted
|
||||
A GCODE file transfer to SD has started.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``local``: the file's name as stored locally
|
||||
* ``remote``: the file's name as stored on SD
|
||||
|
||||
**Note:** Name changed in version 1.1.0
|
||||
|
||||
TransferDone
|
||||
A GCODE file transfer to SD has finished.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``time``: the time it took for the transfer to complete in seconds
|
||||
* ``local``: the file's name as stored locally
|
||||
* ``remote``: the file's name as stored on SD
|
||||
|
||||
Printing
|
||||
--------
|
||||
|
||||
PrintStarted
|
||||
A print has started.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
PrintFailed
|
||||
A print failed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
PrintDone
|
||||
A print completed successfully.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
* ``time``: the time needed for the print, in seconds (float)
|
||||
|
||||
PrintCancelled
|
||||
The print has been cancelled via the cancel button.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
PrintPaused
|
||||
The print has been paused.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
PrintResumed
|
||||
The print has been resumed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the file's name
|
||||
* ``origin``: the origin of the file, either ``local`` or ``sdcard``
|
||||
|
||||
GCODE processing
|
||||
----------------
|
||||
|
||||
PowerOn
|
||||
The GCode has turned on the printer power via M80
|
||||
|
||||
PowerOff
|
||||
The GCODE has turned on the printer power via M81
|
||||
|
||||
Home
|
||||
The head has gone home via G28
|
||||
|
||||
ZChange
|
||||
The printer's Z-Height has changed (new layer)
|
||||
|
||||
Paused
|
||||
The print has been paused
|
||||
|
||||
Waiting
|
||||
The print is paused due to a gcode wait command
|
||||
|
||||
Cooling
|
||||
The GCODE has enabled the platform cooler via M245
|
||||
|
||||
Alert
|
||||
The GCODE has issued a user alert (beep) via M300
|
||||
|
||||
Conveyor
|
||||
The GCODE has enabled the conveyor belt via M240
|
||||
|
||||
Eject
|
||||
The GCODE has enabled the part ejector via M40
|
||||
|
||||
EStop
|
||||
The GCODE has issued a panic stop via M112
|
||||
|
||||
Timelapses
|
||||
----------
|
||||
|
||||
CaptureStart
|
||||
A timelapse image has started to be captured.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``file``: the name of the image file to be saved
|
||||
|
||||
CaptureDone
|
||||
A timelapse image has completed being captured.
|
||||
|
||||
Payload:
|
||||
* ``file``: the name of the image file that was saved
|
||||
|
||||
MovieRendering
|
||||
The timelapse movie has started rendering.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``gcode``: the GCODE file for which the timelapse would have been created (only the filename without the path)
|
||||
* ``movie``: the movie file that is being created (full path)
|
||||
* ``movie_basename``: the movie file that is being created (only the file name without the path)
|
||||
|
||||
MovieDone
|
||||
The timelapse movie is completed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``gcode``: the GCODE file for which the timelapse would have been created (only the filename without the path)
|
||||
* ``movie``: the movie file that has been created (full path)
|
||||
* ``movie_basename``: the movie file that has been created (only the file name without the path)
|
||||
|
||||
MovieFailed
|
||||
There was an error while rendering the timelapse movie.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``gcode``: the GCODE file for which the timelapse would have been created (only the filename without the path)
|
||||
* ``movie``: the movie file that would have been created (full path)
|
||||
* ``movie_basename``: the movie file that would have been created (only the file name without the path)
|
||||
* ``returncode``: the return code of ``ffmpeg`` that indicates the error that occurred
|
||||
|
||||
Slicing
|
||||
-------
|
||||
|
||||
SlicingStarted
|
||||
The slicing of a file has started.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``stl``: the STL's filename
|
||||
* ``gcode``: the sliced GCODE's filename
|
||||
* ``progressAvailable``: true if progress information via the ``slicingProgress`` push update will be available, false if not
|
||||
|
||||
SlicingDone
|
||||
The slicing of a file has completed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``stl``: the STL's filename
|
||||
* ``gcode``: the sliced GCODE's filename
|
||||
* ``time``: the time needed for slicing, in seconds (float)
|
||||
|
||||
SlicingCancelled
|
||||
The slicing of a file has been cancelled. This will happen if a second slicing job
|
||||
targeting the same GCODE file has been started by the user.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``stl``: the STL's filename
|
||||
* ``gcode``: the sliced GCODE's filename
|
||||
|
||||
SlicingFailed
|
||||
The slicing of a file has failed.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``stl``: the STL's filename
|
||||
* ``gcode``: the sliced GCODE's filename
|
||||
* ``reason``: the reason for the slicing having failed
|
||||
|
||||
SlicingProfileAdded
|
||||
A new slicing profile was added.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``slicer``: the slicer for which the profile was added
|
||||
* ``profile``: the profile that was added
|
||||
|
||||
SlicingProfileModified
|
||||
A new slicing profile was modified.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``slicer``: the slicer for which the profile was modified
|
||||
* ``profile``: the profile that was modified
|
||||
|
||||
SlicingProfileDeleted
|
||||
A slicing profile was deleted.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``slicer``: the slicer for which the profile was deleted
|
||||
* ``profile``: the profile that was deleted
|
||||
|
||||
Settings
|
||||
--------
|
||||
|
||||
SettingsUpdated
|
||||
The internal settings were updated.
|
||||
@@ -0,0 +1,69 @@
|
||||
.. _sec-features-access_control:
|
||||
|
||||
Access Control
|
||||
==============
|
||||
|
||||
When Access Control is enabled, anonymous users (not logged in) will only see
|
||||
the read-only parts of the UI which are the following:
|
||||
|
||||
* printer state
|
||||
* available gcode files and stats (upload is disabled)
|
||||
* temperature
|
||||
* webcam
|
||||
* gcode viewer
|
||||
* terminal output (sending commands is disabled)
|
||||
* available timelapse movies
|
||||
* any components provided through plugins which are enabled for anonymous
|
||||
users
|
||||
|
||||
Logged in users will get access to everything besides the Settings and System
|
||||
Commands, which are admin-only.
|
||||
|
||||
If Access Control is disabled, everything is directly accessible. **That also
|
||||
includes all administrative functionality as well as full control over the
|
||||
printer!**
|
||||
|
||||
Upon first start a configuration wizard is provided which allows configuration
|
||||
of the first administrator account or alternatively disabling Access Control
|
||||
(which is **NOT** recommended for systems that are directly accessible via the
|
||||
Internet!).
|
||||
|
||||
.. hint::
|
||||
|
||||
If you plan to have your OctoPrint instance accessible over the internet,
|
||||
**always enable Access Control**.
|
||||
|
||||
.. _sec-features-access_control-rerunning_wizard:
|
||||
|
||||
Rerunning the wizard
|
||||
--------------------
|
||||
|
||||
In case Access Control was disabled in the configuration wizard, it is
|
||||
possibly to re-run it by editing ``config.yaml`` [#f1]_ and setting ``firstRun``
|
||||
in the ``server`` section and ``enabled`` in the ``accessControl`` section to
|
||||
``true``:
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
|
||||
accessControl:
|
||||
enabled: true
|
||||
# ...
|
||||
server:
|
||||
firstRun: true
|
||||
|
||||
Then restart the server and connect to the web interface - the wizard should
|
||||
be shown again.
|
||||
|
||||
.. note::
|
||||
|
||||
If user accounts were created prior to disabling Access Control and those
|
||||
user accounts are not to be used any more, remove ``.octoprint/users.yaml``.
|
||||
If you don't remove this file, the above changes won't lead to the
|
||||
configuration being shown again, instead Access Control will just be
|
||||
enabled using the already existing login data. This is to prevent you from
|
||||
resetting access control by accident.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [#f1] For Linux that will be ``~/.octoprint/config.yaml``, for Windows it will be ``%APPDATA%/OctoPrint/config.yaml`` and for
|
||||
Mac ``~/Library/Application Support/OctoPrint/config.yaml``
|
||||
@@ -0,0 +1,36 @@
|
||||
.. _sec-features-action_commands:
|
||||
|
||||
Action Commands
|
||||
===============
|
||||
|
||||
Action commands are a feature defined for the GCODE based RepRap communication protocol. To quote from the
|
||||
`GCODE node of the RepRap wiki <http://reprap.org/wiki/Gcode#Replies_from_the_RepRap_machine_to_the_host_computer>`_:
|
||||
|
||||
The RepRap machine may also send lines that look like this:
|
||||
|
||||
**// This is some debugging or other information on a line on its own. It may be sent at any time.**
|
||||
|
||||
Such lines will always be preceded by //.
|
||||
|
||||
On the latest version of Pronterface and [...] OctoPrint a special comment of the form:
|
||||
|
||||
**// action:command**
|
||||
|
||||
is allowed to be sent from the firmware[. T]he command can currently be pause, resume or disconnect which will
|
||||
execute those commands on the host. As this is also a comment other hosts will just ignored these commands.
|
||||
|
||||
OctoPrint out of the box supports handling of the above mentioned commands:
|
||||
|
||||
pause
|
||||
When this command is received from the printer, OctoPrint will pause streaming of a current print job just like if the
|
||||
"Pause" button had been clicked.
|
||||
|
||||
resume
|
||||
When this command is received from the printer, OctoPrint will resume streaming of a current print job just like if
|
||||
the "Resume" button had been clicked.
|
||||
|
||||
disconnect
|
||||
When this command is Received from the printer, OctoPrint will immediately disconnect from it.
|
||||
|
||||
Support for additional commands may be added by plugins by implementing a handler for the
|
||||
:ref:`octoprint.comm.protocol.action <sec-plugins-hook-comm-protocol-action>` hook.
|
||||
@@ -0,0 +1,293 @@
|
||||
.. _sec-features-custom_controls:
|
||||
|
||||
Custom Controls
|
||||
===============
|
||||
|
||||
.. contents::
|
||||
|
||||
OctoPrint allows you to add custom controls to the "Control" tab of its interface. Control types reach from simple
|
||||
buttons which trigger sending of one or more lines of GCODE to the printer over more complex controls allowing
|
||||
parameterization of these commands with values entered by the user to full blown GCODE script templates backed by
|
||||
`Jinja2 <http://jinja.pocoo.org/>`_.
|
||||
|
||||
Custom controls are configured within :ref:`config.yaml <sec-configuration-config_yaml>` [#f1]_ in a ``controls`` section which
|
||||
basically represents a hierarchical structure of all configured custom controls of various types.
|
||||
|
||||
.. note::
|
||||
|
||||
To make sure that your ``config.yaml`` stays valid when adding custom controls, don't hesitate to take a look at the
|
||||
:ref:`YAML Primer <sec-configuration-yaml>`.
|
||||
|
||||
The following example defines a control for enabling the cooling fan with a variable speed defined by the user
|
||||
(default 255 and selectable through a slider UI element) and a control for disabling the fan, all within a section named
|
||||
"Fan", two example controls with multiple commands in a section "Example for multiple commands", a command with printer
|
||||
feedback evaluation for the result of the M114 "Get Position" gcode inside a section named "Reporting" and finally
|
||||
a GCODE script including user input.
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
|
||||
controls:
|
||||
- name: Fan
|
||||
layout: horizontal
|
||||
children:
|
||||
- name: Enable Fan
|
||||
command: M106 S%(speed)s
|
||||
input:
|
||||
- name: Speed (0-255)
|
||||
parameter: speed
|
||||
default: 255
|
||||
slider:
|
||||
min: 0
|
||||
max: 255
|
||||
- name: Disable Fan
|
||||
command: M107
|
||||
- name: Example for multiple commands
|
||||
children:
|
||||
- name: Move X (static)
|
||||
confirm: You are about to move the X axis right by 10mm with 3000mm/s.
|
||||
commands:
|
||||
- G91
|
||||
- G1 X10 F3000
|
||||
- G90
|
||||
- name: Move X (parametric)
|
||||
commands:
|
||||
- G91
|
||||
- G1 X%(distance)s F%(speed)s
|
||||
- G90
|
||||
input:
|
||||
- default: 10
|
||||
name: Distance
|
||||
parameter: distance
|
||||
- default: 3000
|
||||
name: Speed
|
||||
parameter: speed
|
||||
- name: Reporting
|
||||
children:
|
||||
- name: Get Position
|
||||
command: M114
|
||||
regex: "X:([-+]?[0-9.]+) Y:([-+]?[0-9.]+) Z:([-+]?[0-9.]+) E:([-+]?[0-9.]+)"
|
||||
template: "Position: X={0}, Y={1}, Z={2}, E={3}"
|
||||
- name: Fun stuff
|
||||
children:
|
||||
- name: Dance
|
||||
script: custom/dance.gco
|
||||
input:
|
||||
- name: Go arounds
|
||||
parameter: repetitions
|
||||
slider:
|
||||
max: 10
|
||||
min: 1
|
||||
step: 1
|
||||
|
||||
Adding this to ``config.yaml``, restarting the OctoPrint server and switching to the "Control" tab within its
|
||||
interface yields the visual representation in :numref:`fig-configuration-customcontrols-example`.
|
||||
|
||||
.. _fig-configuration-customcontrols-example:
|
||||
.. figure:: ../images/features-custom_controls-example.png
|
||||
:align: center
|
||||
:alt: The rendered output created through the example configuration
|
||||
|
||||
The rendered output created through the example configuration
|
||||
|
||||
As you can see you have two basic types of control definitions here: controls that actually do something (providing a
|
||||
button that sends one or more commands to the printer when clicked, displaying output received from the printer) and
|
||||
controls that just serve as *container* for other controls, the latter being identified by having a ``children``
|
||||
attribute wrapping more controls.
|
||||
|
||||
.. hint::
|
||||
|
||||
Take a look at the `Custom Control Editor plugin <http://plugins.octoprint.org/plugins/customControl/>`_
|
||||
which allows you configuring your Custom Controls through OctoPrint's
|
||||
settings interface without the need to manually edit the configuration
|
||||
file.
|
||||
|
||||
.. _sec-features-custom_controls-types:
|
||||
|
||||
Types
|
||||
-----
|
||||
|
||||
Let's take a closer look at the possible attributes that are available for both basic types.
|
||||
|
||||
.. _sec-features-custom_controls-types-containers:
|
||||
|
||||
Containers
|
||||
..........
|
||||
|
||||
.. list-table::
|
||||
:widths: 25 75
|
||||
|
||||
* - **Attribute**
|
||||
- **Description**
|
||||
* - ``children``
|
||||
- A list of children controls or containers contained within this container
|
||||
* - ``name``
|
||||
- (Optional) A name to display above the container, basically a section header
|
||||
* - ``layout``
|
||||
- (Optional) The layout to use for laying out the contained children, either from top to bottom (``vertical``) or
|
||||
from left to right (``horizontal``). Defaults to a ``vertical`` layout.
|
||||
|
||||
.. _sec-features-custom_controls-types-controls:
|
||||
|
||||
Controls
|
||||
........
|
||||
|
||||
.. list-table::
|
||||
:widths: 25 75
|
||||
|
||||
* - **Attribute**
|
||||
- **Description**
|
||||
* - ``name``
|
||||
- The name of the control, will be displayed either on the button if it's a control sending a command or as a label
|
||||
for controls which only display output.
|
||||
* - ``command``
|
||||
- (Optional) A single GCODE command to send to the printer. Will be rendered as a button which sends the command to
|
||||
the printer upon click. The button text will be the value of the ``name`` attribute. Mutually exclusive with
|
||||
``commands`` and ``script``. The rendered button be disabled if the printer is currently offline or printing or
|
||||
alternatively if the requirements defined via the ``enabled`` attribute are not met.
|
||||
* - ``commands``
|
||||
- (Optional) A list of GCODE commands to send to the printer. Will be rendered as a button which sends the commands
|
||||
to the printer upon click. The button text will be the value of the ``name`` attribute. Mutually exclusive with
|
||||
``command`` and ``script``. The rendered button will be disabled if the printer is currently offline or printing
|
||||
or alternatively if the requirements defined via the ``enabled`` attribute are not met.
|
||||
* - ``script``
|
||||
- (Optional) The name of a full blown :ref:`GCODE script <sec-features-gcode_scripts>` to send to the printer.
|
||||
Will be rendered as a button which sends the script to the printer upon click. The button text will be the value
|
||||
of the ``name`` attribute. Mutually exclusive with ``command`` and ``commands``. The rendered button will be
|
||||
disabled if the printer is currently offline or printing or alternatively if the requirements defined via the
|
||||
``enabled`` attribute are not met.
|
||||
|
||||
Values of input parameters will be available in the template context under the ``parameter`` variable (e.g.
|
||||
an input parameter ``speed`` will be available in the script template as ``parameter.speed``). On top of that all
|
||||
other variables defined in the :ref:`GCODE template context <sec-features-gcode_scripts-context>` will be available.
|
||||
|
||||
:ref:`See below for an example <sec-features-custom_controls-examples-gcode_script>`.
|
||||
* - ``javascript``
|
||||
- (Optional) A JavaScript snippet to be executed when the button rendered for ``command`` or ``commands`` is
|
||||
clicked. This allows to override the direct sending of the command or commands to the printer with more
|
||||
sophisticated behaviour. The JavaScript snippet is ``eval``'d and processed in a context where the control
|
||||
it is part of is provided as local variable ``data`` and the ``ControlViewModel`` is available as ``self``.
|
||||
* - ``enabled``
|
||||
- (Optional) A JavaScript snippet returning either ``true`` or ``false`` determining whether the control
|
||||
should be enabled or not. This allow to override the default logic for this (disabled if printer is offline
|
||||
or currently printing). The JavaScript snippet is ``eval``'d and processed in a context where the control
|
||||
it is part of is provided as local variable ``data`` and the ``ControlViewModel`` is available as ``self``.
|
||||
* - ``input``
|
||||
- (Optional) A list of definitions of input parameters for a ``command`` or ``commands``, to be rendered as
|
||||
additional input fields. ``command``/``commands`` may contain placeholders to be replaced by the values obtained
|
||||
from the user for the defined input fields:
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
|
||||
name: Enable Fan
|
||||
command: M106 S%(speed)s
|
||||
input:
|
||||
- name: Speed (0-255)
|
||||
parameter: speed
|
||||
default: 255
|
||||
slider:
|
||||
min: 0
|
||||
max: 255
|
||||
|
||||
In OctoPrint's default UI input fields are always rendered left to right (inline).
|
||||
* - ``input.name``
|
||||
- Name to display for the input field.
|
||||
* - ``input.parameter``
|
||||
- Internal parameter name for the input field, used as a placeholder in ``command``/``commands``.
|
||||
* - ``input.default``
|
||||
- Default value for the input field.
|
||||
* - ``input.slider``
|
||||
- (Optional) If this attribute is included, instead of an input field a slider control will
|
||||
be rendered. If you don't want to define any of ``min``, ``max`` or ``step``, write ``slider: {}`` to render
|
||||
a slider based on default values.
|
||||
* - ``input.slider.min``
|
||||
- (Optional) Minimum value of the slider, defaults to 0.
|
||||
* - ``input.slider.max``
|
||||
- (Optional) Maximum value of the slider, defaults to 255.
|
||||
* - ``input.slider.step``
|
||||
- (Optional) Step size per slider "tick", defaults to 1.
|
||||
* - ``regex``
|
||||
- (Optional) A `regular expression <https://docs.python.org/2/library/re.html#regular-expression-syntax>`_ to
|
||||
match against lines received from the printer to retrieve information from it (e.g. specific output). Together
|
||||
with ``template`` this allows rendition of received data from the printer within the UI.
|
||||
* - ``template``
|
||||
- (Optional) A template to use for rendering the match of ``regex``. May contain placeholders in
|
||||
`Python Format String Syntax <https://docs.python.org/2/library/string.html#format-string-syntax>`_ for either named
|
||||
groups within the regex (e.g. ``Temperature: {temperature}`` for a regex ``T:\s*(?P<temperature>\d+(\.\d*)``)
|
||||
or positional groups within the regex (e.g. ``Position: X={0}, Y={1}, Z={2}, E={3}`` for a regex
|
||||
``X:([0-9.]+) Y:([0-9.]+) Z:([0-9.]+) E:([0-9.]+)``).
|
||||
* - ``confirm``
|
||||
- (Optional) A text to display to the user to confirm his button press. Can be used with sensitive custom controls
|
||||
like changing EEPROM values in order to prevent accidental clicks. The text will be displayed in a confirmation
|
||||
dialog like in :numref:`fig-configuration-customcontrols-confirm`.
|
||||
|
||||
.. _fig-configuration-customcontrols-confirm:
|
||||
.. figure:: ../images/features-custom_controls-confirm.png
|
||||
:align: center
|
||||
:alt: An example confirmation dialog
|
||||
|
||||
An example confirmation dialog
|
||||
|
||||
.. _sec-features-custom_controls-examples:
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. _sec-features-custom_controls-examples-gcode_script:
|
||||
|
||||
Parameterized GCODE Script
|
||||
..........................
|
||||
|
||||
.. code-block-ext:: yaml
|
||||
:caption: Control definition in ~/.octoprint/config.yaml
|
||||
:name: code-features-custom_controls-example-gcode_script-config_yaml
|
||||
|
||||
name: Dance
|
||||
script: custom/dance.gco
|
||||
input:
|
||||
- default: 5
|
||||
name: Go arounds
|
||||
parameter: repetitions
|
||||
slider:
|
||||
max: 10
|
||||
min: 1
|
||||
step: 1
|
||||
|
||||
.. code-block-ext:: jinja
|
||||
:caption: ~/.octoprint/scripts/gcode/custom/dance.gco
|
||||
:name: code-features-custom_controls-example-gcode_script-dance_gco
|
||||
|
||||
{% set center_x = printer_profile.volume.width / 2 %}
|
||||
{% set center_y = printer_profile.volume.depth / 2 %}
|
||||
{% set speed_x = printer_profile.axes.x.speed %}
|
||||
{% set speed_y = printer_profile.axes.y.speed %}
|
||||
{% set speed_z = printer_profile.axes.z.speed %}
|
||||
M117 run {{ script.name }}
|
||||
G4 P500
|
||||
G1 Z10
|
||||
G1 X{{ center_x }} Y{{ center_y }} F{{ speed_x }}
|
||||
M117 let's dance!
|
||||
G91
|
||||
G1 X-1 Y-1 F{{ speed_x }}
|
||||
{% for n in range(parameters.repetitions) %}
|
||||
M117 and {{ n + 1 }}
|
||||
{% if n % 2 == 0 %}
|
||||
G1 Z1 F{{ speed_z }}
|
||||
G1 Z-2 F{{ speed_z }}
|
||||
G1 Z1 F{{ speed_z }}
|
||||
{% endif %}
|
||||
G1 X2 F{{ speed_x }}
|
||||
G1 Y2 F{{ speed_y }}
|
||||
G1 X-2 F{{ speed_x }}
|
||||
G1 Y-2 F{{ speed_y }}
|
||||
{% endfor %}
|
||||
G90
|
||||
G1 X{{ center_x }} Y{{ center_y }} F{{ speed_x }}
|
||||
G28 X0 Y0
|
||||
|
||||
Note the usage of the ``parameters.repetitions`` template variable in the GCODE script template, which will contain
|
||||
the value selected by the user for the "Go arounds" slider.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [#f1] For Linux that will be ``~/.octoprint/config.yaml``, for Windows it will be ``%APPDATA%/OctoPrint/config.yaml`` and for
|
||||
Mac ``~/Library/Application Support/OctoPrint/config.yaml``
|
||||
@@ -0,0 +1,121 @@
|
||||
.. _sec-features-gcode_scripts:
|
||||
|
||||
GCODE Scripts
|
||||
=============
|
||||
|
||||
.. contents::
|
||||
|
||||
OctoPrint allows you to define custom GCODE scripts to be executed on specified occasions, e.g. when a print
|
||||
starts, when OctoPrint connects to a printer, or when a :ref:`button defined as a custom control <sec-features-custom_controls>`
|
||||
is clicked.
|
||||
|
||||
Unless :ref:`configured otherwise <sec-configuration-config_yaml-folder>`, OctoPrint expects scripts to be located in
|
||||
the ``scripts/gcode`` folder in OctoPrint configuration directory (per default ``~/.octoprint`` on Linux, ``%APPDATA%\OctoPrint``
|
||||
on Windows and ``~/Library/Application Support/OctoPrint`` on MacOS).
|
||||
|
||||
These GCODE scripts are backed by the templating engine `Jinja2 <http://jinja.pocoo.org/>`_, allowing more than just
|
||||
simple "send-as-is" scripts but making use of a full blown templating language in order to create your scripts. To
|
||||
this end, OctoPrint injects a couple of variables into the :ref:`template rendering context <sec-features-gcode_scripts-context>`
|
||||
as described below.
|
||||
|
||||
.. _sec-features-gcode_scripts-predefined:
|
||||
|
||||
Predefined Scripts
|
||||
------------------
|
||||
|
||||
The following GCODE scripts are sent by OctoPrint automatically:
|
||||
|
||||
* ``afterPrinterConnected``: Sent after OctoPrint successfully connected to a printer. Defaults to an empty script.
|
||||
* ``beforePrintStarted``: Sent just before a print job is started. Defaults to an empty script.
|
||||
* ``afterPrintCancelled``: Sent just after a print job was cancelled. Defaults to the
|
||||
:ref:`bundled script listed below <sec-features-gcode_scripts-bundled>`.
|
||||
* ``afterPrintDone``: Sent just after a print job finished. Defaults to an empty script.
|
||||
* ``afterPrintPaused``: Sent just after a print job was paused. Defaults to an empty script.
|
||||
* ``beforePrintResumed``: Sent just before a print job is resumed. Defaults to an empty script.
|
||||
|
||||
.. note::
|
||||
|
||||
Plugins may extend these scripts through :ref:`a hook <sec-plugins-hook-comm-protocol-scripts>`.
|
||||
|
||||
.. _sec-features-gcode_scripts-snippets:
|
||||
|
||||
Snippets
|
||||
--------
|
||||
|
||||
For making small GCODE snippets reusable in a template (e.g. for :ref:`disabling all hotends <sec-features-gcode_scripts-bundled>`)
|
||||
there's an additional Jinja template command ``{% snippet '<snippet name>' %}`` available which allows including
|
||||
snippets stored under ``scripts/gcode/snippets`` in OctoPrint's configuration directory. They fully support
|
||||
the whole spectrum of the Jinja2 templating language (that includes including other snippets).
|
||||
|
||||
.. _sec-features-gcode_scripts-context:
|
||||
|
||||
Context
|
||||
-------
|
||||
|
||||
All GCODE scripts have access to the following template variables through the template context:
|
||||
|
||||
* ``printer_profile``: The currently selected Printer Profile, including
|
||||
information such as the extruder count, the build volume size, the filament diameter etc.
|
||||
* ``script``: An object wrapping the script's type (``gcode``) and name (e.g. ``afterPrintCancelled``) as ``script.type``
|
||||
and ``script.name`` respectively.
|
||||
|
||||
The :ref:`predefined GCODE scripts <sec-features-gcode_scripts-predefined>` are also called with the following additional
|
||||
template variables:
|
||||
|
||||
* ``event``: The payload of the ``Connected``, ``PrintStarted``, ``PrintCancelled``, ``PrintDone``, ``PrintPaused`` or
|
||||
``PrintResumed`` event. See :ref:`the documentation of events <sec-events-available_events>` for the contained values.
|
||||
|
||||
GCODE scripts attached to :ref:`custom controls <sec-features-custom_controls>` are called with the following
|
||||
additional template variables:
|
||||
|
||||
* ``parameters``: The parameters as defined for the custom control, if it has any inputs.
|
||||
* ``context``: Additional ``context`` included in the definition of the custom control.
|
||||
|
||||
.. _sec-features-gcode_scripts-bundled:
|
||||
|
||||
Bundled Scripts
|
||||
---------------
|
||||
|
||||
Out of the box, OctoPrint defaults to the following script setup for ``afterPrintCancelled``:
|
||||
|
||||
.. code-block:: jinja
|
||||
:caption: Default ``afterPrintCancelled`` script
|
||||
|
||||
; disable motors
|
||||
M84
|
||||
|
||||
;disable all heaters
|
||||
{% snippet 'disable_hotends' %}
|
||||
[% snippet 'disable_bed' %}
|
||||
|
||||
;disable fan
|
||||
M106 S0
|
||||
|
||||
The ``disable_hotends`` snippet is defined as follows:
|
||||
|
||||
.. code-block:: jinja
|
||||
:caption: Default ``disable_hotends`` snippet
|
||||
|
||||
{% for tool in range(printer_profile.extruder.count) %}
|
||||
M104 T{{ tool }} S0
|
||||
{% endfor %}
|
||||
|
||||
The ``disable_bed`` snippet is defined as follows:
|
||||
|
||||
.. code-block:: jinja
|
||||
:caption: Default ``disable_bed`` snippet
|
||||
|
||||
{% if printer_profile.heatedBed %}
|
||||
M140 S0
|
||||
{% endif %}
|
||||
|
||||
As you can see, the ``disable_hotends`` and ``disable_bed`` snippets utilize the
|
||||
``printer_profile`` context variable in order to iterate through all available
|
||||
extruders and set their temperature to 0, and to also set the bed temperature
|
||||
to 0 if a heated bed is configured.
|
||||
|
||||
.. seealso::
|
||||
|
||||
`Jinja Template Designer Documentation <http://jinja.pocoo.org/docs/dev/templates/>`_
|
||||
Jinja's Template Designer Documentation describes the syntax and semantics of the template language used
|
||||
also by OctoPrint's GCODE scripts.
|
||||
@@ -0,0 +1,14 @@
|
||||
.. _section-features:
|
||||
|
||||
********
|
||||
Features
|
||||
********
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
accesscontrol.rst
|
||||
custom_controls.rst
|
||||
gcode_scripts.rst
|
||||
action_commands.rst
|
||||
plugins.rst
|
||||
@@ -0,0 +1,70 @@
|
||||
.. _sec-features-plugins:
|
||||
|
||||
*******
|
||||
Plugins
|
||||
*******
|
||||
|
||||
Starting with OctoPrint 1.2.0, there's now a plugin system in place which allows to individually
|
||||
extend OctoPrint's functionality.
|
||||
|
||||
Right now plugins can be used to extend OctoPrint's web interface, to execute specific tasks on server startup and
|
||||
shutdown, to provide custom (API) endpoints or whole user interfaces with special functionality, to react to system
|
||||
events or progress reports or to add support for additional slicers. More plugin types are planned for the future.
|
||||
|
||||
.. _sec-features-plugins-available:
|
||||
|
||||
Finding Plugins
|
||||
===============
|
||||
|
||||
The official OctoPrint Plugin Repository can be found at `plugins.octoprint.org <http://plugins.octoprint.org>`_.
|
||||
|
||||
Some plugins may also be found in the list provided in `the OctoPrint wiki <https://github.com/foosel/OctoPrint/wiki#plugins>`_
|
||||
and on the `OctoPrint organization Github page <https://github.com/OctoPrint>`_.
|
||||
|
||||
.. _sec-features-plugins-installing:
|
||||
|
||||
Installing Plugins
|
||||
==================
|
||||
|
||||
Plugins can be installed through the bundled Plugin Manager, which allows installing plugins available in the
|
||||
`OctoPrint Plugin Repository <http://plugins.octoprint.org>`_, from a web address or from an uploaded file archive.
|
||||
|
||||
Please refer to the documentation of the plugin for additional installations instructions.
|
||||
|
||||
Manual Installation
|
||||
-------------------
|
||||
|
||||
If you don't want or can't use the Plugin Manager, plugins may also be installed manually either by copying and
|
||||
unpacking them into one of the configured plugin folders (regularly those are ``<octoprint source root>/plugins`` and
|
||||
``<octoprint config folder>/plugins`` [#f1]_ or by installing them as regular python modules via ``pip`` [#f2]_.
|
||||
|
||||
For a plugin available on the Python Package Index (PyPi), the process is as simple as issuing a
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install <plugin_name>
|
||||
|
||||
For plugins not available on PyPi, you'll have to give ``pip`` an URL from which to install the package (e.g. the URL to
|
||||
a ZIP file of the current master branch of a Github repository hosting a plugin, or even a ``git+https`` URL), example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pip install https://github.com/OctoPrint/OctoPrint-Growl/archive/master.zip
|
||||
|
||||
See `the pip install documentation <http://pip.readthedocs.org/en/latest/reference/pip_install.html>`_ for what URL
|
||||
types are possible.
|
||||
|
||||
.. _sec-features-plugins-developing:
|
||||
|
||||
Developing Plugins
|
||||
==================
|
||||
|
||||
See :ref:`Developing Plugins <sec-plugins>`.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [#f1] For Linux that will be ``~/.octoprint/plugins``, for Windows it will be ``%APPDATA%/OctoPrint/plugins`` and for
|
||||
Mac ``~/Library/Application Support/OctoPrint/plugins``
|
||||
.. [#f2] Make sure to use the exact same Python installation for installing the plugin that you also used for
|
||||
installing & running OctoPrint. For OctoPi this means using ``~/oprint/bin/pip`` for installing plugins
|
||||
instead of just ``pip``.
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 47 KiB |
@@ -0,0 +1,309 @@
|
||||
<?xml version="1.0"?>
|
||||
<Document xmlns="http://www.evolus.vn/Namespace/Pencil"><Properties/><Pages><Page><Properties><Property name="name">sidebar</Property><Property name="id">1421408377849_1407</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(200,211.5)" id="9c37daabc3ba46d8a8d9392db9c5bfec" p:sizing-gow="533.5" p:sizing-goh="366.5"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="db0858b72c864467b215dbf33d56f344" transform="matrix(1,0,0,1,57,-0.5)" p:sizing-ox="58" p:sizing-oy="0.5" p:sizing-ow="264" p:sizing-oh="368"><p:metadata><p:property name="box"><![CDATA[264,368]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,46]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="262" height="366" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="6a0c5dd8bb904291948a061be156b69a" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="47e2c5b978d04acdae01fb06a59a4447">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#6a0c5dd8bb904291948a061be156b69a" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#47e2c5b978d04acdae01fb06a59a4447)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="1bb1baaca7cc44c1b02cd9b42c705cc4"/>
|
||||
<use xlink:href="#6a0c5dd8bb904291948a061be156b69a" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="46" y="184" width="172" height="0" p:name="text" id="85bd2e4e256b4cb7842522f2f03f3c81" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="76483818cd584af4995434fb28810ce8" transform="matrix(1,0,0,1,73,15.5)" p:sizing-ox="74" p:sizing-oy="16.5" p:sizing-ow="232" p:sizing-oh="112"><p:metadata><p:property name="box"><![CDATA[232,112]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,14]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="230" height="110" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="3013ddbcc4fa492995a68798edd29384" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="d1e4f71d5d584c4791ec9a7c9e5be830">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#3013ddbcc4fa492995a68798edd29384" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#d1e4f71d5d584c4791ec9a7c9e5be830)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="99bedd6f63d44a4a98c846ef4bec10a1"/>
|
||||
<use xlink:href="#3013ddbcc4fa492995a68798edd29384" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="14" y="56" width="204" height="0" p:name="text" id="628f108cd2324e66b43059a0f6820ee6" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="cab18e5323344976a22116d09ed7f8d9" transform="matrix(1,0,0,1,73,143.5)" p:sizing-ox="74" p:sizing-oy="144.5" p:sizing-ow="232" p:sizing-oh="208"><p:metadata><p:property name="box"><![CDATA[232,208]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,25.999999999999993]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="230" height="206" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="81f28baf72ac469cbdebdcaeb5aeb243" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="d7c2713036ee43909c0c1edc167e270b">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#81f28baf72ac469cbdebdcaeb5aeb243" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#d7c2713036ee43909c0c1edc167e270b)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="825e8e4a336247cba2f89994b72de93e"/>
|
||||
<use xlink:href="#81f28baf72ac469cbdebdcaeb5aeb243" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="26" y="104" width="180" height="0" p:name="text" id="5da32f0eb5b64ebc8ed60f5ad52e1693" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="5bb69b63f17c4b90bab26e055b40809d" transform="matrix(1,0,0,1,88,52.5)" p:sizing-ox="89" p:sizing-oy="53.5" p:sizing-ow="200" p:sizing-oh="56"><p:metadata><p:property name="box"><![CDATA[200,56]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,7]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|5,5]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="198" height="54" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-dasharray: 5, 5;" p:name="rrRect" id="50d1edd378e8475a976ee62cc51e187a" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="646abf607f094b84b088ebb2615c88cd">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#50d1edd378e8475a976ee62cc51e187a" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#646abf607f094b84b088ebb2615c88cd)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="ebb65993472448b0827d87c3a3b09450"/>
|
||||
<use xlink:href="#50d1edd378e8475a976ee62cc51e187a" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="7" y="28" width="186" height="0" p:name="text" id="1ebe6438f1de49eaab62aa0ac42a63dd" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="253be0b8bade43249b1d0373589b4bde" transform="matrix(1,0,0,1,118,43.5)" p:sizing-ox="117.859375" p:sizing-oy="21.5" p:sizing-ow="79.7890625" p:sizing-oh="28"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[<name>]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Open Sans|bold|normal|20px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="a00b6941683d4803957395e5c0b93fc5" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="907a2badd36140fa9e10760dbe67b52d" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Open Sans; font-size: 20px; font-weight: bold; font-style: normal; text-decoration: none;"><tspan x="0" y="0"><name></tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="a7b1d219b2e04f00946f8ad6fb892a70" transform="matrix(1,0,0,1,333,186.5)" p:sizing-ox="305.5" p:sizing-oy="187" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-28,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">styles_content / styles<br />classes_content / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="d1b2e26143ba4dc9b5011127eaf859fa">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="1d983e33baff4b5db9814e8bc44d5ff2">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="9d05a5c681eb4e8690d7092cfde36dd4" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -28 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#1d983e33baff4b5db9814e8bc44d5ff2" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#d1b2e26143ba4dc9b5011127eaf859fa)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="0a8c818f34d64855927948dca5fdd21e"/>
|
||||
<use xlink:href="#1d983e33baff4b5db9814e8bc44d5ff2" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="24" width="184" height="33" p:name="text" id="4edecb8e11ca486cad7e10fecaff8778" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">styles_content / styles<br />classes_content / classes</span><br /></div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="c736be040cc84947b5eb28896b2f18b0" transform="matrix(1,0,0,1,333,-0.5)" p:sizing-ox="321.5" p:sizing-oy="0" p:sizing-ow="200" p:sizing-oh="94"><p:metadata><p:property name="box"><![CDATA[200,94]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,14.100000000000001]]></p:property><p:property name="leftEnd"><![CDATA[0,38.775]]></p:property><p:property name="rightStart"><![CDATA[200,14.100000000000001]]></p:property><p:property name="rightEnd"><![CDATA[200,38.775]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,94]]></p:property><p:property name="bottomEnd"><![CDATA[33,94]]></p:property><p:property name="pin"><![CDATA[-12,27.025000000000002]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_wrapper / styles<br />classes_wrapper / classes<br /></span>]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="da71a006d4af4ce6b8f0dc6b1763b086">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="9352a73150934cfd986e88ce1ab4a93e">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="1d692ff756b24c2aafa9c15372494c5d" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 86 C 200 91.33333333333333 197.33333333333334 94 192 94 L 8 94 C 2.6666666666666665 94 0 91.33333333333333 0 86 L 0 38.775 L -12 27.025000000000002 L 0 14.100000000000001 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#9352a73150934cfd986e88ce1ab4a93e" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#da71a006d4af4ce6b8f0dc6b1763b086)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="2186895b427e4e0bac628bdbf5b65fe6"/>
|
||||
<use xlink:href="#9352a73150934cfd986e88ce1ab4a93e" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="22" width="184" height="50" p:name="text" id="b02113fca2d14fa783c537fba5d391e6" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_wrapper / styles<br />classes_wrapper / classes<br /></span></div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="61991a849e7f4c72a857ddebed80da33" transform="matrix(1,0,0,1,89,166.5)" p:sizing-ox="87.3984375" p:sizing-oy="154.5" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="6d064b059239458684409f224ccbb316" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="dadbe69e489042ce8e4eb9fc489ea745" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="39a78451571e4e14b57426ec83d5c92a" transform="matrix(1,0,0,1,100,75.5)" p:sizing-ox="98.3984375" p:sizing-oy="63.5" p:sizing-ow="109.1640625" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template_header]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="538be6af592e49a686d10f714de79255" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="bb1be320b027418592c6edf7f319411d" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template_header</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="2f7cafb48e32492193fc2507d4a77a41" transform="matrix(1,0,0,1,88,24.5)" p:sizing-ox="89" p:sizing-oy="25.5" p:sizing-ow="24" p:sizing-oh="24"><p:metadata><p:property name="box"><![CDATA[24,24]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,3]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="22" height="22" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(255, 255, 255); stroke-opacity: 1;" p:name="rrRect" id="226ab97c12354c4c824fbf94a11a98b0" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="8ae0aa26919c481db673739e49601e78">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#226ab97c12354c4c824fbf94a11a98b0" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#8ae0aa26919c481db673739e49601e78)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="13e998ab0f984d15b0b4f7c8f136ac21"/>
|
||||
<use xlink:href="#226ab97c12354c4c824fbf94a11a98b0" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="3" y="12" width="18" height="0" p:name="text" id="998c2f0c678e447fa46f5424e9b8a698" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:arrow" id="f983474041574164a9ed540858755610" transform="matrix(1,0,0,1,-144,61.5)" p:sizing-ox="16" p:sizing-oy="30.5" p:sizing-ow="72" p:sizing-oh="63"><p:metadata><p:property name="startPin"><![CDATA[160,32]]></p:property><p:property name="endPin" p:connectedShapeId="2f7cafb48e32492193fc2507d4a77a41" p:connectedOutletId="middle-left" p:viax="222" p:viay="-25"><![CDATA[232,-25]]></p:property><p:property name="withStartArrow"><![CDATA[false]]></p:property><p:property name="withEndArrow"><![CDATA[true]]></p:property><p:property name="mode"><![CDATA[curvy]]></p:property><p:property name="detached"><![CDATA[false]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
<defs>
|
||||
<path style="stroke-linejoin: round; fill: none;" p:name="path" id="d96ef38bf8c04e81aec043fef0b2d21c" d="M 160 32 C 160 -14 186 -25 232 -25 M 226 -31 L 232 -25 L 226 -19"/>
|
||||
</defs>
|
||||
<use xlink:href="#d96ef38bf8c04e81aec043fef0b2d21c" xmlns:xlink="http://www.w3.org/1999/xlink" stroke-width="10" stroke-opacity="0" stroke="#FF0000"/>
|
||||
<use xlink:href="#d96ef38bf8c04e81aec043fef0b2d21c" xmlns:xlink="http://www.w3.org/1999/xlink" p:name="outArrow1" id="66e4484f068b49a09813e21c39d8994e" style="stroke: rgb(27, 50, 128); stroke-opacity: 1; stroke-width: 2;"/>
|
||||
<text p:name="text" id="b0d40ebba7664c20a9a4f1452c86a07d" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;">
|
||||
<textPath xlink:href="#d96ef38bf8c04e81aec043fef0b2d21c" xmlns:xlink="http://www.w3.org/1999/xlink" startOffset="50%" text-anchor="middle" alignment-baseline="middle">
|
||||
<tspan dy="-4.333333333333333" p:name="textSpan" id="73255d7945434ce9bc661341349735e1" dx="-16"></tspan>
|
||||
</textPath>
|
||||
</text>
|
||||
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="86ed3ea65aee42199bac08824c3826a6" transform="matrix(1,0,0,1,1,104.5)" p:sizing-ox="0" p:sizing-oy="92.5" p:sizing-ow="31.140625" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[icon]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="a9ecdbb9c77b4ce4928e46b7cfe54dcf" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="02a5711e99924fc4b34e5730e2a78fa8" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">icon</tspan></text>
|
||||
</g></g></Content></Page><Page><Properties><Property name="name">tab</Property><Property name="id">1421409530685_8513</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(201,144)" id="d8e8f6e0f752428680f67384aa52208f" p:sizing-gow="598.5" p:sizing-goh="310"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="9e881048fedf43d6a67dfad7f06548e9" transform="matrix(1,0,0,1,0,47)" p:sizing-ox="1" p:sizing-oy="48" p:sizing-ow="384" p:sizing-oh="264"><p:metadata><p:property name="box"><![CDATA[384,264]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,33]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="382" height="262" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="12a9d962fb7b4cabbe2795c5e396d6ec" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="76b2ce77019f45daad45b48817f65325">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#12a9d962fb7b4cabbe2795c5e396d6ec" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#76b2ce77019f45daad45b48817f65325)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="6ed5bd1e00f648a792981e16e260963e"/>
|
||||
<use xlink:href="#12a9d962fb7b4cabbe2795c5e396d6ec" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="33" y="132" width="318" height="0" p:name="text" id="14b2622dcb514c21a19fcf064f8abe55" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="fb37074399fd40dc8078a398f9299f3e" transform="matrix(1,0,0,1,16,63)" p:sizing-ox="17" p:sizing-oy="64" p:sizing-ow="352" p:sizing-oh="232"><p:metadata><p:property name="box"><![CDATA[352,232]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,29]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="350" height="230" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="d8debccd7e4f482b8c04420ef54ffa70" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="1eb07f64e796487984ddffea498f79b9">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#d8debccd7e4f482b8c04420ef54ffa70" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#1eb07f64e796487984ddffea498f79b9)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="9b45931ea5e84b15a01479b46dc76b83"/>
|
||||
<use xlink:href="#d8debccd7e4f482b8c04420ef54ffa70" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="29" y="116" width="294" height="0" p:name="text" id="6d8d3f3cce8b4da0b0f97ed8a5fce058" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:PlainTextV2" id="407ebd46fa5f48f395a7d5a0b8d46d2a" transform="matrix(1,0,0,1,26,83)" p:sizing-ox="24.3984375" p:sizing-oy="71" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="efd58ec8f2eb45dcbeea7bb13c573cc5" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="ba9f30328268467ba17566dbd14ae998" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:trapezoid" id="cb49850d258c4367abbee3628aa93512" transform="matrix(1,0,0,1,0,0)" p:sizing-ox="0" p:sizing-oy="0" p:sizing-ow="119" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[119,48]]></p:property><p:property name="a"><![CDATA[29.750000000000004,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
|
||||
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="ac794f7d717045878f0fdebc737e9adc" transform="translate(0,0)" d="M 29.750000000000004 0 L 89.25 0 L 119 48 L 0 48 z"/>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:trapezoid" id="b0b14e6d505d4af7a04a05a8cc7fe672" transform="matrix(1,0,0,1,87,0)" p:sizing-ox="87" p:sizing-oy="0" p:sizing-ow="120" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[120,48]]></p:property><p:property name="a"><![CDATA[30,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
|
||||
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="5c4e128120224a0f87c3c6f9e98f9183" transform="translate(0,0)" d="M 30 0 L 90 0 L 120 48 L 0 48 z"/>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:trapezoid" id="b95ce307dbc04cb297e1d019f1c31d0d" transform="matrix(1,0,0,1,263,0)" p:sizing-ox="263" p:sizing-oy="0" p:sizing-ow="120" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[120,48]]></p:property><p:property name="a"><![CDATA[30,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
|
||||
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="58f26895549a4afe87215738aad60c7f" transform="translate(0,0)" d="M 30 0 L 90 0 L 120 48 L 0 48 z"/>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:trapezoid" id="dd08c65002d54b4d963c0fc1ddd8da56" transform="matrix(1,0,0,1,175,0)" p:sizing-ox="175" p:sizing-oy="0" p:sizing-ow="120" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[120,48]]></p:property><p:property name="a"><![CDATA[30,0]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property></p:metadata>
|
||||
<path style="stroke-linejoin: round; stroke: rgb(0, 0, 0); stroke-opacity: 1; stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1;" p:name="path" id="2ff5fd3ed1174b1ca120e0521506dfdb" transform="translate(0,0)" d="M 30 0 L 90 0 L 120 48 L 0 48 z"/>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="c821784d3f6f4c54a482c9b800303096" transform="matrix(1,0,0,1,196,38)" p:sizing-ox="195.859375" p:sizing-oy="16" p:sizing-ow="79.7890625" p:sizing-oh="28"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[<name>]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Open Sans|bold|normal|20px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="45c9bc72749f4114b754dd78d39294d9" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="510af970bf6e4a3299e10d5726dc506b" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Open Sans; font-size: 20px; font-weight: bold; font-style: normal; text-decoration: none;"><tspan x="0" y="0"><name></tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="28819f317c9a44f487d89358bc01d35e" transform="matrix(1,0,0,1,398,0)" p:sizing-ox="284.5" p:sizing-oy="0.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-114,22]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="f46117a9847b442a848d6dc6d0f1ca02">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="7e565a2554874c8693bee8c3b1fb4a96">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="35606f3a84d34cfabef6fd7995e162c9" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -114 22 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#7e565a2554874c8693bee8c3b1fb4a96" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#f46117a9847b442a848d6dc6d0f1ca02)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="fba23d0e302047588af7e9e586dfb238"/>
|
||||
<use xlink:href="#7e565a2554874c8693bee8c3b1fb4a96" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="d94b77112885453db437a00ff25500ca" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br /></div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="6f1c4f61a1fb4f14a28d1793b958ba0a" transform="matrix(1,0,0,1,397,120)" p:sizing-ox="369.5" p:sizing-oy="120.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-28,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="acf275ea0a954d79ae41107f58d208ae">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="a75b69e48d5e40f4b6150b1ec2953af3">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="eb3218f33a0b49fb8ec0ad9f86d2872a" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -28 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#a75b69e48d5e40f4b6150b1ec2953af3" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#acf275ea0a954d79ae41107f58d208ae)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="809f63827dbe473db68c768a9299d7be"/>
|
||||
<use xlink:href="#a75b69e48d5e40f4b6150b1ec2953af3" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="31d16c095ee849c791565b6c88b93fad" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes</span><br /></div></foreignObject>
|
||||
</g></g></Content></Page><Page><Properties><Property name="name">settings</Property><Property name="id">1421410253180_3579</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(323,143)" id="7395842d34de4079b3029fbb8f377213" p:sizing-gow="769.5" p:sizing-goh="390"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="5267d389e1714536a6262df513ff7665" transform="matrix(1,0,0,1,-1,-1)" p:sizing-ox="0" p:sizing-oy="0" p:sizing-ow="144" p:sizing-oh="392"><p:metadata><p:property name="box"><![CDATA[144,392]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,49]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="142" height="390" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="cb16e9a309e341f1ba7f6440a0483dc7" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="54e55b5fad5d4a3995c3806b790f2d05">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#cb16e9a309e341f1ba7f6440a0483dc7" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#54e55b5fad5d4a3995c3806b790f2d05)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="904bde4e72cb4b5aa6cb5b963c339bdf"/>
|
||||
<use xlink:href="#cb16e9a309e341f1ba7f6440a0483dc7" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="49" y="196" width="46" height="0" p:name="text" id="e13fe7a85e1a4ca081470478b747bc8c" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="00107838b5c846ac87f4bbc67a235524" transform="matrix(1,0,0,1,143,-1)" p:sizing-ox="144" p:sizing-oy="0" p:sizing-ow="416" p:sizing-oh="392"><p:metadata><p:property name="box"><![CDATA[416,392]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,49]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="414" height="390" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="cbe5e6469a9647b9a54b064a30ee0c35" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="8d5eca961f8d499abcbcdb90c9f38da8">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#cbe5e6469a9647b9a54b064a30ee0c35" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#8d5eca961f8d499abcbcdb90c9f38da8)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="34141c77145742d3810b0e7474f6e012"/>
|
||||
<use xlink:href="#cbe5e6469a9647b9a54b064a30ee0c35" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="49" y="196" width="318" height="0" p:name="text" id="41ef32306e1e4d9da9165746657a5965" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="dfc036f4a3394f48abfd564cd42b2b0e" transform="matrix(1,0,0,1,159,15)" p:sizing-ox="160" p:sizing-oy="16" p:sizing-ow="384" p:sizing-oh="360"><p:metadata><p:property name="box"><![CDATA[384,360]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,45]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="382" height="358" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="29dc0c2600da465fb63911073183eafe" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="451d197a117c48f7a68d1c1be41304e5">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#29dc0c2600da465fb63911073183eafe" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#451d197a117c48f7a68d1c1be41304e5)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="6c260c83376042eda5122f600dac0784"/>
|
||||
<use xlink:href="#29dc0c2600da465fb63911073183eafe" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="45" y="180" width="294" height="0" p:name="text" id="cb978529c3144a3085a502964a33bfa4" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="f2e9506fa0ed4466890d1042d5ac901e" transform="matrix(1,0,0,1,15,175)" p:sizing-ox="16" p:sizing-oy="176" p:sizing-ow="112" p:sizing-oh="40"><p:metadata><p:property name="box"><![CDATA[112,40]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,5]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="110" height="38" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="76d805dced5640149e7d9b75b58e9479" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="4fc6940222be4d1bb3d1bba581209b59">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#76d805dced5640149e7d9b75b58e9479" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#4fc6940222be4d1bb3d1bba581209b59)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="60a990d0eb9e4ea69c10c41791e58323"/>
|
||||
<use xlink:href="#76d805dced5640149e7d9b75b58e9479" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="5" y="20" width="102" height="0" p:name="text" id="54e8a52460b84409b8c52e713918e527" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="3a5c9441f4dd450489ef6c32b84277bb" transform="matrix(1,0,0,1,22,202)" p:sizing-ox="21.859375" p:sizing-oy="180" p:sizing-ow="79.7890625" p:sizing-oh="28"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[<name>]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Open Sans|bold|normal|20px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="49590ece8832421093f480572615621e" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="638c493afd75474bba33ba6ed7f6b418" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Open Sans; font-size: 20px; font-weight: bold; font-style: normal; text-decoration: none;"><tspan x="0" y="0"><name></tspan></text>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="ebd3473021234611aefc9fa212dcc943" transform="matrix(1,0,0,1,175,37)" p:sizing-ox="173.3984375" p:sizing-oy="25" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="a7f7b8da20384df091964756d22bd5df" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="85ffc835cc2f4e8ea41c1857b55af53e" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="a0d9b8a91b8d4913bc11cca99c86a459" transform="matrix(1,0,0,1,569,15)" p:sizing-ox="541.5" p:sizing-oy="15.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-28,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes<br /></span>]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="2f5319b357c84839b3986162a515c00e">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="9c15a0a8bd764d0187e813cd78f906d4">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="0f6d812601a94e60b7f5e3f1d859d630" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -28 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#9c15a0a8bd764d0187e813cd78f906d4" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#2f5319b357c84839b3986162a515c00e)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="4a90c69f97384e74ae968cff348b2ed9"/>
|
||||
<use xlink:href="#9c15a0a8bd764d0187e813cd78f906d4" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="eac648dfa87d4f719c8d271b82f1c930" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_content / styles<br />classes_content / classes<br /></span></div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="bda1534d936b4b1a8851bd7316333963" transform="matrix(1,0,0,1,137,175)" p:sizing-ox="125.5" p:sizing-oy="175.5" p:sizing-ow="200" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[200,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[8,0]]></p:property><p:property name="leftStart"><![CDATA[0,12]]></p:property><p:property name="leftEnd"><![CDATA[0,33]]></p:property><p:property name="rightStart"><![CDATA[200,12]]></p:property><p:property name="rightEnd"><![CDATA[200,33]]></p:property><p:property name="topStart"><![CDATA[12,0]]></p:property><p:property name="topEnd"><![CDATA[33,0]]></p:property><p:property name="bottomStart"><![CDATA[12,80]]></p:property><p:property name="bottomEnd"><![CDATA[33,80]]></p:property><p:property name="pin"><![CDATA[-12,23]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="7190c91fd5a0498faee46f6a07e4ee36">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="e38975d273874cd7ac31fa1c63716ec1">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="72ab543eb28a48e6bedf116266c72fbb" d="M 8 0 L 192 0 C 197.33333333333334 0 200 2.6666666666666665 200 8 L 200 72 C 200 77.33333333333333 197.33333333333334 80 192 80 L 8 80 C 2.6666666666666665 80 0 77.33333333333333 0 72 L 0 33 L -12 23 L 0 12 L 0 8 C 0 2.6666666666666665 2.6666666666666665 0 8 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#e38975d273874cd7ac31fa1c63716ec1" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#7190c91fd5a0498faee46f6a07e4ee36)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="f143de029bc146c7a3a7bca494562509"/>
|
||||
<use xlink:href="#e38975d273874cd7ac31fa1c63716ec1" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="8" y="15" width="184" height="50" p:name="text" id="9ba09cfb0e0643c69291c6942df8c8c9" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles_link / styles<br />classes_link / classes</span><br /></div></foreignObject>
|
||||
</g></g></Content></Page><Page><Properties><Property name="name">navbar</Property><Property name="id">1421410510071_9693</Property><Property name="width">1531</Property><Property name="height">847</Property><Property name="dimBackground"/><Property name="transparentBackground">true</Property><Property name="backgroundColor">#FFFFFFFF</Property><Property name="background">transparent</Property></Properties><Content><g xmlns="http://www.w3.org/2000/svg" p:type="Group" xmlns:p="http://www.evolus.vn/Namespace/Pencil" transform="translate(126,121)" id="31a617e276fe4161a5e3b70380bb0e34" p:sizing-gow="490.5" p:sizing-goh="78"><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="fa8da9aed28744f5af9f11285080496c" transform="matrix(1,0,0,1,-1,-1)" p:sizing-ox="0" p:sizing-oy="0" p:sizing-ow="283" p:sizing-oh="80"><p:metadata><p:property name="box"><![CDATA[283,80]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,10]]></p:property><p:property name="fillColor"><![CDATA[#CCCCCCFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="281" height="78" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(204, 204, 204); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="ea12bfd96e974a0f8f92afced67bdd6f" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="d5043318357b49a1bb219a00f76eddd9">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#ea12bfd96e974a0f8f92afced67bdd6f" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#d5043318357b49a1bb219a00f76eddd9)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="0d42ff0970ff472aa4c006ef85d8e87a"/>
|
||||
<use xlink:href="#ea12bfd96e974a0f8f92afced67bdd6f" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="10" y="40" width="263" height="0" p:name="text" id="40018080392b490da490d8b286b95c41" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:RoundedRect" id="5b845ca54039496591b80db2010a32bc" transform="matrix(1,0,0,1,122,15)" p:sizing-ox="123" p:sizing-oy="16" p:sizing-ow="144" p:sizing-oh="48"><p:metadata><p:property name="box"><![CDATA[144,48]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[0,0]]></p:property><p:property name="textPadding"><![CDATA[0,6]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#000000FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[
|
||||
]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<rect width="142" height="46" rx="0" ry="0" x="0" y="0" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(0, 0, 0); stroke-opacity: 1;" p:name="rrRect" id="480225b90d8842139e20649d22caa757" transform="translate(1,1)"/>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="shadingFilter" id="db76ffd36668492aa45c3dacb4ed2d52">
|
||||
<feGaussianBlur stdDeviation="1" in="SourceAlpha"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<use xlink:href="#480225b90d8842139e20649d22caa757" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(2, 2)" p:filter="url(#db76ffd36668492aa45c3dacb4ed2d52)" style="opacity: 0.5; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="125928c2b681488ba446768b095a76a5"/>
|
||||
<use xlink:href="#480225b90d8842139e20649d22caa757" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="6" y="24" width="132" height="0" p:name="text" id="de5cbf018c224ba3adf8aed52ebc5f77" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml">
|
||||
</div></foreignObject>
|
||||
</g><g xmlns="http://www.w3.org/2000/svg" p:type="Shape" xmlns:p="http://www.evolus.vn/Namespace/Pencil" p:def="Evolus.Common:PlainTextV2" id="3637818ac51540849a753285e83d950d" transform="matrix(1,0,0,1,132,35)" p:sizing-ox="130.3984375" p:sizing-oy="23" p:sizing-ow="60" p:sizing-oh="16"><p:metadata><p:property name="disabled"><![CDATA[false]]></p:property><p:property name="width"><![CDATA[100,0]]></p:property><p:property name="fixedWidth"><![CDATA[false]]></p:property><p:property name="label"><![CDATA[template]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textFont"><![CDATA[Consolas|normal|normal|13px|none]]></p:property><p:property name="textAlign"><![CDATA[0,0]]></p:property></p:metadata>
|
||||
<rect x="0" y="0" style="fill: none; stroke: none; visibility: hidden; display: none;" p:name="bgRect" id="6f91157aa1354619ab2b7960baeb8cba" width="0" height="0"/>
|
||||
<text xml:space="preserve" p:name="text" id="638334d0a39b4b39a7e4806254e2e418" style="fill: rgb(0, 0, 0); fill-opacity: 1; font-family: Consolas; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none;"><tspan x="0" y="0">template</tspan></text>
|
||||
</g><g p:type="Shape" p:def="Evolus.Common:Balloon" id="c0be16ae150d4dc68b7bffdc19d19262" transform="matrix(1,0,0,1,294,7)" p:sizing-ox="266.5" p:sizing-oy="7.5" p:sizing-ow="196" p:sizing-oh="64"><p:metadata><p:property name="box"><![CDATA[196,64]]></p:property><p:property name="withBlur"><![CDATA[false]]></p:property><p:property name="radius"><![CDATA[7.84,0]]></p:property><p:property name="leftStart"><![CDATA[0,9.84]]></p:property><p:property name="leftEnd"><![CDATA[0,26.400000000000002]]></p:property><p:property name="rightStart"><![CDATA[196,9.84]]></p:property><p:property name="rightEnd"><![CDATA[196,26.400000000000002]]></p:property><p:property name="topStart"><![CDATA[11.76,0]]></p:property><p:property name="topEnd"><![CDATA[32.339999999999996,0]]></p:property><p:property name="bottomStart"><![CDATA[11.76,64]]></p:property><p:property name="bottomEnd"><![CDATA[32.339999999999996,64]]></p:property><p:property name="pin"><![CDATA[-28,18]]></p:property><p:property name="fillColor"><![CDATA[#FFFFFFFF]]></p:property><p:property name="strokeColor"><![CDATA[#1B3280FF]]></p:property><p:property name="strokeStyle"><![CDATA[2|]]></p:property><p:property name="textContent"><![CDATA[<span style="font-family: Consolas;">data_bind<br />styles<br />classes</span><br />]]></p:property><p:property name="textFont"><![CDATA["Liberation Sans",Arial,sans-serif|normal|normal|13px|none]]></p:property><p:property name="textColor"><![CDATA[#000000FF]]></p:property><p:property name="textAlign"><![CDATA[1,1]]></p:property></p:metadata>
|
||||
|
||||
<defs>
|
||||
<filter height="1.2558399" y="-0.12792" width="1.06396" x="-0.03198" p:name="imageShading" id="f3a0f53acfa3492abf13b69eb2bf8e75">
|
||||
<feGaussianBlur stdDeviation="1.3325" in="SourceAlpha"/>
|
||||
</filter>
|
||||
<g p:name="container" id="8eaa88f76ee748fdbb66142e124db376">
|
||||
<path transform="translate(0.5 0.5)" style="stroke-width: 2; fill: rgb(255, 255, 255); fill-opacity: 1; stroke: rgb(27, 50, 128); stroke-opacity: 1;" p:name="rect" id="e5ed7702279b485f83a84e170232b245" d="M 7.84 0 L 188.16 0 C 193.38666666666666 0 196 2.6133333333333333 196 7.84 L 196 56.16 C 196 61.38666666666667 193.38666666666666 64 188.16 64 L 7.84 64 C 2.6133333333333333 64 0 61.38666666666667 0 56.16 L 0 26.400000000000002 L -28 18 L 0 9.84 L 0 7.84 C 0 2.6133333333333333 2.6133333333333333 0 7.84 0"/>
|
||||
</g>
|
||||
</defs>
|
||||
<use xlink:href="#8eaa88f76ee748fdbb66142e124db376" xmlns:xlink="http://www.w3.org/1999/xlink" transform="translate(1, 1)" p:filter="url(#f3a0f53acfa3492abf13b69eb2bf8e75)" style="opacity: 0.6; visibility: hidden; display: none;" p:heavy="true" p:name="bgCopy" id="e7a7687af8d14f2888d588636e0cd333"/>
|
||||
<use xlink:href="#8eaa88f76ee748fdbb66142e124db376" xmlns:xlink="http://www.w3.org/1999/xlink"/>
|
||||
<foreignObject x="7.84" y="7" width="180.32" height="50" p:name="text" id="cdcded6607b7463ea18aa393da7520bc" style="font-family: "Liberation Sans",Arial,sans-serif; font-size: 13px; font-weight: normal; font-style: normal; text-decoration: none; fill: rgb(0, 0, 0); fill-opacity: 1; color: rgb(0, 0, 0); opacity: 1; text-align: center;"><div xmlns="http://www.w3.org/1999/xhtml"><span style="font-family: Consolas;">data_bind<br />styles<br />classes</span><br /></div></foreignObject>
|
||||
</g></g></Content></Page></Pages></Document>
|
||||
@@ -1,22 +1,25 @@
|
||||
.. OctoPrint documentation master file, created by
|
||||
sphinx-quickstart on Mon Dec 02 17:08:50 2013.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
#####################################
|
||||
Welcome to OctoPrint's documentation!
|
||||
=====================================
|
||||
#####################################
|
||||
|
||||
Contents:
|
||||
.. image:: images/octoprint-logo.png
|
||||
:alt: The OctoPrint Logo
|
||||
:align: right
|
||||
|
||||
This documentation is still in the process of being migrated from
|
||||
`OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki>`_, so also take
|
||||
a look there!
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
features/index.rst
|
||||
configuration/index.rst
|
||||
api/index.rst
|
||||
events/index.rst
|
||||
plugins/index.rst
|
||||
modules/index.rst
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
.. _sec-modules-filemanager:
|
||||
|
||||
octoprint.filemanager
|
||||
---------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager
|
||||
:members:
|
||||
|
||||
.. _sec-modules-filemanager-analysis:
|
||||
|
||||
octoprint.filemanager.analysis
|
||||
------------------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager.analysis
|
||||
:members:
|
||||
|
||||
.. _sec-modules-filemanager-destinations:
|
||||
|
||||
octoprint.filemanager.destinations
|
||||
----------------------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager.destinations
|
||||
:members:
|
||||
|
||||
.. _sec-modules-filemanager-storage:
|
||||
|
||||
octoprint.filemanager.storage
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager.storage
|
||||
:members: StorageInterface, LocalFileStorage
|
||||
|
||||
.. _sec-modules-filemanager-util:
|
||||
|
||||
octoprint.filemanager.util
|
||||
--------------------------
|
||||
|
||||
.. automodule:: octoprint.filemanager.util
|
||||
:members:
|
||||
@@ -0,0 +1,16 @@
|
||||
.. _sec-modules:
|
||||
|
||||
################
|
||||
Internal Modules
|
||||
################
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
filemanager.rst
|
||||
plugin.rst
|
||||
printer.rst
|
||||
server.rst
|
||||
settings.rst
|
||||
slicing.rst
|
||||
util.rst
|
||||
@@ -0,0 +1,20 @@
|
||||
.. _sec-modules-plugin:
|
||||
|
||||
octoprint.plugin
|
||||
----------------
|
||||
|
||||
.. automodule:: octoprint.plugin
|
||||
|
||||
.. _sec-modules-plugin-core:
|
||||
|
||||
octoprint.plugin.core
|
||||
---------------------
|
||||
|
||||
.. automodule:: octoprint.plugin.core
|
||||
|
||||
.. _sec-modules-plugin-types:
|
||||
|
||||
octoprint.plugin.types
|
||||
----------------------
|
||||
|
||||
.. automodule:: octoprint.plugin.types
|
||||
@@ -0,0 +1,6 @@
|
||||
.. _sec-modules-printer:
|
||||
|
||||
octoprint.printer
|
||||
-----------------
|
||||
|
||||
.. automodule:: octoprint.printer
|
||||
@@ -0,0 +1,42 @@
|
||||
.. _sec-modules-server:
|
||||
|
||||
octoprint.server
|
||||
----------------
|
||||
|
||||
.. automodule:: octoprint.server
|
||||
:members:
|
||||
|
||||
.. _sec-modules-server-util:
|
||||
|
||||
octoprint.server.util
|
||||
---------------------
|
||||
|
||||
.. automodule:: octoprint.server.util
|
||||
:members:
|
||||
|
||||
.. _sec-modules-server-util-flask:
|
||||
|
||||
octoprint.server.util.flask
|
||||
---------------------------
|
||||
|
||||
.. automodule:: octoprint.server.util.flask
|
||||
:members:
|
||||
|
||||
.. _sec-modules-server-util-sockjs:
|
||||
|
||||
octoprint.server.util.sockjs
|
||||
----------------------------
|
||||
|
||||
.. automodule:: octoprint.server.util.sockjs
|
||||
:members:
|
||||
|
||||
.. _sec-modules-server-util-tornado:
|
||||
|
||||
octoprint.server.util.tornado
|
||||
-----------------------------
|
||||
|
||||
.. automodule:: octoprint.server.util.tornado
|
||||
:members:
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
.. _sec-modules-settings:
|
||||
|
||||
octoprint.settings
|
||||
------------------
|
||||
|
||||
.. automodule:: octoprint.settings
|
||||
@@ -0,0 +1,13 @@
|
||||
.. _sec-modules-slicing:
|
||||
|
||||
octoprint.slicing
|
||||
-----------------
|
||||
|
||||
.. automodule:: octoprint.slicing
|
||||
|
||||
.. _sec-modules-slicing-exceptions:
|
||||
|
||||
octoprint.slicing.exceptions
|
||||
----------------------------
|
||||
|
||||
.. automodule:: octoprint.slicing.exceptions
|
||||
@@ -0,0 +1,9 @@
|
||||
.. _sec-modules-util:
|
||||
|
||||
octoprint.util
|
||||
--------------
|
||||
|
||||
.. automodule:: octoprint.util
|
||||
:members:
|
||||
|
||||
|
||||
@@ -0,0 +1,349 @@
|
||||
.. _sec-plugin-concepts:
|
||||
|
||||
Concepts
|
||||
========
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
OctoPrint's plugins are `Python Packages <https://docs.python.org/2/tutorial/modules.html#packages>`_ which in their
|
||||
top-level module define a bunch of :ref:`control properties <sec-plugin-concepts-controlproperties>` defining
|
||||
metadata (like name, version etc of the plugin) as well as information on how to initialize the plugin and into what
|
||||
parts of the system the plugin will actually plug in to perform its job.
|
||||
|
||||
There are three types of ways a plugin might attach itself to the system, through so called
|
||||
:ref:`mixin <sec-plugin-concepts-mixins>` implementations, by attaching itself to specified
|
||||
:ref:`hook <sec-plugin-concepts-hooks>` or by offering :ref:`helper <sec-plugin-concepts-helpers>` functionality to be
|
||||
used by other plugins.
|
||||
|
||||
Plugin mixin implementations will get a bunch of :ref:`properties injected <sec-plugins-concepts-injectedproperties>`
|
||||
by OctoPrint plugin system to help them work.
|
||||
|
||||
.. _sec-plugin-concepts-controlproperties:
|
||||
|
||||
Control Properties
|
||||
------------------
|
||||
|
||||
As already mentioned above, plugins are Python packages which provide certain pieces of metadata to tell OctoPrint's
|
||||
plugin subsystem about themselves. These are simple package attributes defined in the top most package file, e.g.:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import octoprint.plugin
|
||||
|
||||
# ...
|
||||
|
||||
__plugin_name__ = "My Plugin"
|
||||
def __plugin_load__():
|
||||
# whatever you need to do to load your plugin, if anything at all
|
||||
pass
|
||||
|
||||
The following properties are recognized:
|
||||
|
||||
``__plugin_name__``
|
||||
Name of your plugin, optional, overrides the name specified in ``setup.py`` if provided. If neither this property nor
|
||||
a name from ``setup.py`` is available to the plugin subsystem, the plugin's identifier (= package name) will be
|
||||
used instead.
|
||||
``__plugin_version__``
|
||||
Version of your plugin, optional, overrides the version specified in ``setup.py`` if provided.
|
||||
``__plugin_description__``
|
||||
Description of your plugin, optional, overrides the description specified in ``setup.py`` if provided.
|
||||
``__plugin_author__``
|
||||
Author of your plugin, optional, overrides the author specified in ``setup.py`` if provided.
|
||||
``__plugin_url__``
|
||||
URL of the webpage of your plugin, e.g. the Github repository, optional, overrides the URL specified in ``setup.py`` if
|
||||
provided.
|
||||
``__plugin_license__``
|
||||
License of your plugin, optional, overrides the license specified in ``setup.py`` if provided.
|
||||
``__plugin_implementation__``
|
||||
Instance of an implementation of one or more :ref:`plugin mixins <sec-plugins-mixins>`.
|
||||
``__plugin_hooks__``
|
||||
Handlers for one or more of the various :ref:`plugin hooks <sec-plugins-hooks>`.
|
||||
``__plugin_check__``
|
||||
Method called upon discovery of the plugin by the plugin subsystem, should return ``True`` if the
|
||||
plugin can be instantiated later on, ``False`` if there are reasons why not, e.g. if dependencies
|
||||
are missing.
|
||||
``__plugin_load__``
|
||||
Method called upon loading of the plugin by the plugin subsystem, can be used to instantiate
|
||||
plugin implementations, connecting them to hooks etc.
|
||||
``__plugin_unload__``
|
||||
Method called upon unloading of the plugin by the plugin subsystem, can be used to do any final clean ups.
|
||||
``__plugin_enable__``
|
||||
Method called upon enabling of the plugin by the plugin subsystem. Also see :func:`~octoprint.plugin.core.Plugin.on_plugin_enabled``.
|
||||
``__plugin_disable__``
|
||||
Method called upon disabling of the plugin by the plugin subsystem. Also see :func:`~octoprint.plugin.core.Plugin.on_plugin_disabled``.
|
||||
|
||||
.. _sec-plugin-concepts-mixins:
|
||||
|
||||
Mixins
|
||||
------
|
||||
|
||||
Plugin mixins are the heart of OctoPrint's plugin system. They are :ref:`special base classes <sec-plugins-mixins>`
|
||||
which are to be subclassed and extended to add functionality to OctoPrint. Plugins declare their instances that
|
||||
implement one or multiple mixins using the ``__plugin_implementation__`` control property. OctoPrint's plugin core
|
||||
collects those from the plugins and offers methods to access them based on the mixin type, which get used at multiple
|
||||
locations within OctoPrint.
|
||||
|
||||
Using mixins always follows the pattern of retrieving the matching implementations from the plugin subsystem, then
|
||||
calling the specific mixin's methods as defined and necessary.
|
||||
|
||||
The following snippet taken from OctoPrint's code for example shows how all :class:`~octoprint.plugin.AssetPlugin`
|
||||
implementations are collected and then all assets they return via their ``get_assets`` methods are retrieved and
|
||||
merged into one big asset map (differing between javascripts and stylesheets of various types) for use during
|
||||
rendition of the UI.
|
||||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
asset_plugins = pluginManager.get_implementations(octoprint.plugin.AssetPlugin)
|
||||
for name, implementation in asset_plugins.items():
|
||||
all_assets = implementation.get_assets()
|
||||
|
||||
if "js" in all_assets:
|
||||
for asset in all_assets["js"]:
|
||||
assets["js"].append(url_for('plugin_assets', name=name, filename=asset))
|
||||
|
||||
if preferred_stylesheet in all_assets:
|
||||
for asset in all_assets[preferred_stylesheet]:
|
||||
assets["stylesheets"].append((preferred_stylesheet, url_for('plugin_assets', name=name, filename=asset)))
|
||||
else:
|
||||
for stylesheet in supported_stylesheets:
|
||||
if not stylesheet in all_assets:
|
||||
continue
|
||||
|
||||
for asset in all_assets[stylesheet]:
|
||||
assets["stylesheets"].append((stylesheet, url_for('plugin_assets', name=name, filename=asset)))
|
||||
break
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Available Mixins <sec-plugins-mixins>`
|
||||
An overview of all mixin types available for extending OctoPrint.
|
||||
|
||||
:ref:`The Getting Started Guide <sec-plugins-gettingstarted>`
|
||||
Tutorial on how to write a simple OctoPrint module utilizing mixins for various types of extension.
|
||||
|
||||
.. _sec-plugin-concepts-hooks:
|
||||
|
||||
Hooks
|
||||
-----
|
||||
|
||||
Hooks are the smaller siblings of mixins, allowing to extend functionality or data processing where a custom mixin type
|
||||
would be too much overhead. Where mixins are based on classes, hooks are based on methods. Like with the mixin
|
||||
implementations, plugins inform OctoPrint about hook handlers using a control property, ``__plugin_hooks__``.
|
||||
|
||||
Each hook defines a contract detailing the call parameters for the hook handler method and the expected return type.
|
||||
OctoPrint will call the hook with the define parameters and process the result depending on the hook.
|
||||
|
||||
An example for a hook within OctoPrint is ``octoprint.comm.protocol.scripts``, which allows adding additional
|
||||
lines to OctoPrint's :ref:`GCODE scripts <sec-features-gcode_scripts>`, either as ``prefix`` (before the existing lines)
|
||||
or as ``postfix`` (after the existing lines).
|
||||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
self._gcode_hooks = self._pluginManager.get_hooks("octoprint.comm.protocol.scripts")
|
||||
|
||||
# ...
|
||||
|
||||
for hook in self._gcodescript_hooks:
|
||||
try:
|
||||
retval = self._gcodescript_hooks[hook](self, "gcode", scriptName)
|
||||
except:
|
||||
self._logger.exception("Error while processing gcodescript hook %s" % hook)
|
||||
else:
|
||||
if retval is None:
|
||||
continue
|
||||
if not isinstance(retval, (list, tuple)) or not len(retval) == 2:
|
||||
continue
|
||||
|
||||
def to_list(data):
|
||||
if isinstance(data, str):
|
||||
data = map(str.strip, data.split("\n"))
|
||||
elif isinstance(data, unicode):
|
||||
data = map(unicode.strip, data.split("\n"))
|
||||
|
||||
if isinstance(data, (list, tuple)):
|
||||
return list(data)
|
||||
else:
|
||||
return None
|
||||
|
||||
prefix, suffix = map(to_list, retval)
|
||||
if prefix:
|
||||
scriptLines = list(prefix) + scriptLines
|
||||
if suffix:
|
||||
scriptLines += list(suffix)
|
||||
|
||||
As you can see, the hook's method signature is defined to take the current ``self`` (as in, the current comm layer instance),
|
||||
the general type of script for which to look for additions ("gcode") and the script name for which to look (e.g.
|
||||
``beforePrintStarted`` for the GCODE script executed before the beginning of a print job). The hook is expected to
|
||||
return a 2-tuple of prefix and postfix if has something for either of those, otherwise ``None``. OctoPrint will then take
|
||||
care to add prefix and suffix as necessary after a small round of preprocessing.
|
||||
|
||||
.. note::
|
||||
|
||||
At the moment there exists no way to determine the execution order of various hook handlers within OctoPrint,
|
||||
or to prevent the execution of further handlers down the chain.
|
||||
|
||||
This is planned for the very near future though.
|
||||
|
||||
Plugins can easily add their own hooks too. For example, the `Software Update Plugin <https://github.com/OctoPrint/OctoPrint-SoftwareUpdate>`_
|
||||
declares a custom hook "octoprint.plugin.softwareupdate.check_config" which other plugins can add handlers for in order
|
||||
to register themselves with the Software Update Plugin by returning their own update check configuration.
|
||||
|
||||
If you want your hook handler to be an instance method of a mixin implementation of your plugin (for example since you
|
||||
need access to instance variables handed to your implementation via mixin invocations), you can get this work
|
||||
by using a small trick. Instead of defining it directly via ``__plugin_hooks__`` utilize the ``__plugin_load__``
|
||||
property instead, manually instantiate your implementation instance and then add its hook handler method to the
|
||||
``__plugin_hooks__`` property and itself to the ``__plugin_implementation__`` property. See the following example.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_action_command.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `custom_action_command.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_action_command.py>`_
|
||||
:name: sec-plugin-concepts-hooks-example
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Available Hooks <sec-plugins-hooks>`
|
||||
An overview of all hooks defined in OctoPrint itself.
|
||||
|
||||
|
||||
.. _sec-plugin-concepts-helpers:
|
||||
|
||||
Helpers
|
||||
-------
|
||||
|
||||
Helpers are methods that plugin can exposed to other plugins in order to make common functionality available on the
|
||||
system. They are registered with the OctoPrint plugin system through the use of the control property ``__plugin_helpers__``.
|
||||
|
||||
An example for providing a couple of helper functions to the system can be found in the
|
||||
`Discovery Plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Discovery>`_,
|
||||
which provides it's SSDP browsing and Zeroconf browsing and publishing functions as helper methods.
|
||||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
:emphasize-lines: 11-20
|
||||
:caption: Excerpt from the Discovery Plugin showing the declaration of its exported helpers.
|
||||
:name: sec-plugin-concepts-helpers-example-export
|
||||
|
||||
def __plugin_load__():
|
||||
if not pybonjour:
|
||||
# no pybonjour available, we can't use that
|
||||
logging.getLogger("octoprint.plugins." + __name__).info("pybonjour is not installed, Zeroconf Discovery won't be available")
|
||||
|
||||
plugin = DiscoveryPlugin()
|
||||
|
||||
global __plugin_implementation__
|
||||
__plugin_implementation__ = plugin
|
||||
|
||||
global __plugin_helpers__
|
||||
__plugin_helpers__ = dict(
|
||||
ssdp_browse=plugin.ssdp_browse
|
||||
)
|
||||
if pybonjour:
|
||||
__plugin_helpers__.update(dict(
|
||||
zeroconf_browse=plugin.zeroconf_browse,
|
||||
zeroconf_register=plugin.zeroconf_register,
|
||||
zeroconf_unregister=plugin.zeroconf_unregister
|
||||
))
|
||||
|
||||
An example of how to use helpers can be found in the `Growl Plugin <https://github.com/OctoPrint/OctoPrint-Growl>`_.
|
||||
Using :meth:`~octoprint.plugin.code.PluginManager.get_helpers` plugins can retrieve exported helper methods and call
|
||||
them as (hopefully) documented.
|
||||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
:emphasize-lines: 6-8,20
|
||||
:caption: Excerpt from the Growl Plugin showing utilization of the helpers published by the Discovery Plugin.
|
||||
:name: sec-plugin-concepts-helpers-example-usage
|
||||
|
||||
def on_after_startup(self):
|
||||
host = self._settings.get(["hostname"])
|
||||
port = self._settings.getInt(["port"])
|
||||
password = self._settings.get(["password"])
|
||||
|
||||
helpers = self._plugin_manager.get_helpers("discovery", "zeroconf_browse")
|
||||
if helpers and "zeroconf_browse" in helpers:
|
||||
self.zeroconf_browse = helpers["zeroconf_browse"]
|
||||
|
||||
self.growl, _ = self._register_growl(host, port, password=password)
|
||||
|
||||
# ...
|
||||
|
||||
def on_api_get(self, request):
|
||||
if not self.zeroconf_browse:
|
||||
return flask.jsonify(dict(
|
||||
browsing_enabled=False
|
||||
))
|
||||
|
||||
browse_results = self.zeroconf_browse("_gntp._tcp", block=True)
|
||||
growl_instances = [dict(name=v["name"], host=v["host"], port=v["port"]) for v in browse_results]
|
||||
|
||||
return flask.jsonify(dict(
|
||||
browsing_enabled=True,
|
||||
growl_instances=growl_instances
|
||||
))
|
||||
|
||||
.. _sec-plugins-concepts-injectedproperties:
|
||||
|
||||
Injected Properties
|
||||
-------------------
|
||||
|
||||
OctoPrint's plugin subsystem will inject a bunch of properties into each :ref:`mixin implementation <sec-plugin-concepts-mixins>`.
|
||||
An overview of these properties follows.
|
||||
|
||||
``self._identifier``
|
||||
The plugin's identifier.
|
||||
``self._plugin_name``
|
||||
The plugin's name, as taken from either the ``__plugin_name__`` control property or the package info.
|
||||
``self._plugin_version``
|
||||
The plugin's version, as taken from either the ``__plugin_version__`` control property or the package info.
|
||||
``self._plugin_info``
|
||||
The :class:`octoprint.plugin.core.PluginInfo` object associated with the plugin.
|
||||
``self._basefolder``
|
||||
The plugin's base folder where it's installed. Can be used to refer to files relative to the plugin's installation
|
||||
location, e.g. included scripts, templates or assets.
|
||||
``self._datafolder``
|
||||
The plugin's additional data folder path. Can be used to store additional files needed for the plugin's operation (cache,
|
||||
data files etc). Plugins should not access this property directly but instead utilize :func:`~octoprint.plugin.types.OctoPrintPlugin.get_plugin_data_folder`
|
||||
which will make sure the path actually does exist and if not create it before returning it.
|
||||
``self._logger``
|
||||
A `python logger instance <https://docs.python.org/2/library/logging.html>`_ logging to the log target
|
||||
``octoprint.plugin.<plugin identifier>``.
|
||||
``self._settings``
|
||||
The plugin's personalized settings manager, injected only into plugins that include the :class:`~octoprint.plugin.SettingsPlugin` mixin.
|
||||
An instance of :class:`octoprint.plugin.PluginSettings`.
|
||||
``self._plugin_manager``
|
||||
OctoPrint's plugin manager object, an instance of :class:`octoprint.plugin.core.PluginManager`.
|
||||
``self._printer_profile_manager``
|
||||
OctoPrint's printer profile manager, an instance of :class:`octoprint.printer.profile.PrinterProfileManager`.
|
||||
``self._event_bus``
|
||||
OctoPrint's event bus, an instance of :class:`octoprint.events.EventManager`.
|
||||
``self._analysis_queue``
|
||||
OctoPrint's analysis queue for analyzing GCODEs or other files, an instance of :class:`octoprint.filemanager.analysis.AnalysisQueue`.
|
||||
``self._slicing_manager``
|
||||
OctoPrint's slicing manager, an instance of :class:`octoprint.slicing.SlicingManager`.
|
||||
``self._file_manager``
|
||||
OctoPrint's file manager, an instance of :class:`octoprint.filemanager.FileManager`.
|
||||
``self._printer``
|
||||
OctoPrint's printer management object, an instance of :class:`octoprint.printer.PrinterInterface`.
|
||||
``self._app_session_manager``
|
||||
OctoPrint's application session manager, an instance of :class:`octoprint.server.util.flask.AppSessionManager`.
|
||||
|
||||
.. seealso::
|
||||
|
||||
:class:`~octoprint.plugin.core.Plugin` and :class:`~octoprint.plugin.types.OctoPrintPlugin`
|
||||
Class documentation also containing the properties shared among all mixing implementations.
|
||||
|
||||
:ref:`Available Mixins <sec-plugins-mixins>`
|
||||
Some mixin types trigger the injection of additional properties.
|
||||
|
||||
.. _sec-plugins-concept-lifecycle:
|
||||
|
||||
Lifecycle
|
||||
---------
|
||||
|
||||
.. image:: ../images/plugins_lifecycle.png
|
||||
:align: center
|
||||
:alt: The lifecycle of OctoPrint plugins.
|
||||
@@ -0,0 +1,49 @@
|
||||
.. _sec-plugins-distribution:
|
||||
|
||||
Distributing your plugin
|
||||
========================
|
||||
|
||||
You can distribute a plugin with OctoPrint via two ways.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
.. _sec-plugins-distribution-manual:
|
||||
|
||||
Manual file distribution
|
||||
------------------------
|
||||
|
||||
You can have your users copy it to OctoPrint's plugin folder (normally located at ``~/.octoprint/plugins`` under Linux,
|
||||
``%APPDATA%\OctoPrint\plugins`` on Windows and ... on Mac). In this case your plugin will be distributed directly
|
||||
as a Python module (a single ``.py`` file containing all of your plugin's code directly and named
|
||||
like your plugin) or a package (a folder named like your plugin + ``__init.py__`` contained within).
|
||||
|
||||
.. _sec-plugins-distribution-pip:
|
||||
|
||||
Proper packages installable via pip
|
||||
-----------------------------------
|
||||
|
||||
You can have your users install it via ``pip`` and register it for the `entry point <https://pythonhosted.org/setuptools/setuptools.html#dynamic-discovery-of-services-and-plugins>`_ ``octoprint.plugin`` via
|
||||
your plugin's ``setup.py``, this way it will be found automatically by OctoPrint upon initialization of the
|
||||
plugin subsystem [#f1]_.
|
||||
|
||||
For an example of how the directory structure and related files would look like in this case, please take a
|
||||
look at the `helloworld example from OctoPrint's example plugins <https://github.com/OctoPrint/Plugin-Examples/tree/master/helloworld>`_.
|
||||
|
||||
This variant is highly recommended for pretty much any plugin besides the most basic ones since it also allows
|
||||
requirements management and pretty much any thing else that Python's setuptools provide to the developer.
|
||||
|
||||
.. seealso::
|
||||
|
||||
`OctoPrint Plugin Skeleton <https://github.com/OctoPrint/OctoPrint-PluginSkeleton>`_
|
||||
A basic plugin skeleton providing you with all you need to get started with distributing your plugin as a proper
|
||||
package. See the :ref:`Getting Started Guide <sec-plugins-gettingstarted>` for an
|
||||
:ref:`example <sec-plugins-gettingstarted-growingup>` on how to use this.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [#f1] The automatic registration will only work within the same Python installation (this also includes virtual
|
||||
environments), so make sure to instruct your users to use the exact same Python installation for installing
|
||||
the plugin that they also used for installing & running OctoPrint. For OctoPi this means using
|
||||
``~/oprint/bin/pip`` for installing plugins instead of just ``pip``.
|
||||
|
||||
@@ -0,0 +1,546 @@
|
||||
.. _sec-plugins-hooks:
|
||||
|
||||
Available plugin hooks
|
||||
======================
|
||||
|
||||
.. note::
|
||||
|
||||
All of the hooks below take at least two parameters, ``*args`` and ``**kwargs``. Please make sure those are present.
|
||||
They will act as placeholders if additional parameters are added to the hooks in the future and will allow
|
||||
your plugin to stay compatible to OctoPrint without any necessary adjustments from you in these cases.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
.. _sec-plugins-hook-accesscontrol-appkey:
|
||||
|
||||
octoprint.accesscontrol.appkey
|
||||
------------------------------
|
||||
|
||||
.. py:function:: hook(*args, **kwargs)
|
||||
|
||||
By handling this hook plugins may register additional :ref:`App session key providers <sec-api-apps-sessionkey>`
|
||||
within the system.
|
||||
|
||||
Overrides this to return your additional app information to be used for validating app session keys. You'll
|
||||
need to return a list of 3-tuples of the format (id, version, public key).
|
||||
|
||||
The ``id`` should be the (unique) identifier of the app. Using a domain prefix might make sense here, e.g.
|
||||
``org.octoprint.example.MyApp``.
|
||||
|
||||
``version`` should be a string specifying the version of the app for which the public key is valid. You can
|
||||
provide the string ``any`` here, in which case the provided public key will be valid for all versions of the
|
||||
app for which no specific public key is defined.
|
||||
|
||||
Finally, the public key is expected to be provided as a PKCS1 string without newlines.
|
||||
|
||||
:return: A list of 3-tuples as described above
|
||||
:rtype: list
|
||||
|
||||
.. _sec-plugins-hook-comm-protocol-action:
|
||||
|
||||
octoprint.comm.protocol.action
|
||||
------------------------------
|
||||
|
||||
.. py:function:: hook(comm_instance, line, action, *args, **kwargs)
|
||||
|
||||
React to a :ref:`action command <sec-features-action_commands>` received from the printer.
|
||||
|
||||
Hook handlers may use this to react to react to custom firmware messages. OctoPrint parses the received action
|
||||
command ``line`` and provides the parsed ``action`` (so anything after ``// action:``) to the hook handler.
|
||||
|
||||
No returned value is expected.
|
||||
|
||||
**Example:**
|
||||
|
||||
Logs if the ``custom`` action (``// action:custom``) is received from the printer's firmware.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_action_command.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `custom_action_command.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_action_command.py>`_
|
||||
|
||||
:param object comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
|
||||
:param str line: The complete line as received from the printer, format ``// action:<command>``
|
||||
:param str action: The parsed out action command, so for a ``line`` like ``// action:some_command`` this will be
|
||||
``some_command``
|
||||
|
||||
.. _sec-plugins-hook-comm-protocol-gcode-phase:
|
||||
|
||||
octoprint.comm.protocol.gcode.<phase>
|
||||
-------------------------------------
|
||||
|
||||
This describes actually four hooks:
|
||||
|
||||
* ``octoprint.comm.protocol.gcode.queuing``
|
||||
* ``octoprint.comm.protocol.gcode.queued``
|
||||
* ``octoprint.comm.protocol.gcode.sending``
|
||||
* ``octoprint.comm.protocol.gcode.sent``
|
||||
|
||||
.. py:function:: hook(comm_instance, phase, cmd, cmd_type, gcode, *args, **kwargs)
|
||||
|
||||
Pre- and postprocess commands as they progress through the various phases of being sent to the printer. The phases
|
||||
are the following:
|
||||
|
||||
* ``queuing``: This phase is triggered just before the command is added to the send queue of the communication layer. This
|
||||
corresponds to the moment a command is being read from a file that is currently being printed. Handlers
|
||||
may suppress or change commands or their command type here.
|
||||
* ``queued``: This phase is triggered just after the command was added to the send queue of the communication layer.
|
||||
No manipulation is possible here anymore (returned values will be ignored).
|
||||
* ``sending``: This phase is triggered just before the command is actually being sent to the printer. Right afterwards
|
||||
a line number will be assigned and the command will be sent. Handlers may suppress or change commands here. The
|
||||
command type is not taken into account anymore.
|
||||
* ``sent``: This phase is triggered just after the command was handed over to the serial connection to the printer.
|
||||
No manipulation is possible here anymore (returned values will be ignored). A command that reaches the sent phase
|
||||
must not necessarily have reached the printer yet and it might also still run into communication problems and a
|
||||
resend might be triggered for it.
|
||||
|
||||
Hook handlers may use this to rewrite or completely suppress certain commands before they enter the send queue of
|
||||
the communication layer or before they are actually sent over the serial port, or to react to the queuing or sending
|
||||
of commands after the fact. The hook handler will be called with the processing ``phase``, the ``cmd`` to be sent to
|
||||
the printer as well as the ``cmd_type`` parameter used for enqueuing (OctoPrint will make sure that the send queue
|
||||
will never contain more than one line with the same ``cmd_type``) and the detected gcode command (if it is one).
|
||||
|
||||
Defining a ``cmd_type`` other than None will make sure OctoPrint takes care of only having one command of that type
|
||||
in its sending queue. Predefined types are ``temperature_poll`` for temperature polling via ``M105`` and
|
||||
``sd_status_poll`` for polling the SD printing status via ``M27``.
|
||||
|
||||
``phase`` will always match the ``<phase>`` part of the implemented hook (e.g. ``octoprint.comm.protocol.gcode.queued``
|
||||
handlers will always be called with ``phase`` set to ``queued``). This parameter is provided so that plugins may
|
||||
utilize the same hook for mulitple phases if required.
|
||||
|
||||
Handlers are expected to return one of the following result variants:
|
||||
|
||||
* ``None``: Don't change anything. Note that Python functions will also automatically return ``None`` if
|
||||
an empty ``return`` statement is used or just nothing is returned explicitely from the handler. Hence, the following
|
||||
examples are all falling into this category:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def one(*args, **kwargs):
|
||||
print("I return None explicitly")
|
||||
return None
|
||||
|
||||
def two(*args, **kwargs):
|
||||
print("I just return without any values")
|
||||
return
|
||||
|
||||
def three(*args, **kwargs):
|
||||
print("I don't explicitly return anything at all")
|
||||
|
||||
Handlers which do not wish to modify (or suppress) ``cmd`` or ``cmd_type`` at all should use this option.
|
||||
* A string with the rewritten version of the ``cmd``, e.g. ``return "M110"``. To avoid situations which will be
|
||||
difficult to debug should the returned command be later changed to ``None`` (with the intent to suppress the
|
||||
command instead but actually causing ``cmd`` and ``cmd_type`` to just staying as-is), this variant should be
|
||||
entirely avoided by handlers.
|
||||
* A 1-tuple consisting of a rewritten version of the ``cmd``, e.g. ``return "M110",``, or ``None`` in order to
|
||||
suppress the command, e.g. ``return None,``. Handlers which wish to rewrite the command or to suppress it completely
|
||||
should use this option.
|
||||
* A 2-tuple consisting of a rewritten version of the ``cmd`` and the ``cmd_type``, e.g. ``return "M105", "temperature_poll"``.
|
||||
Handlers which wish to rewrite both the command and the command type should use this option.
|
||||
|
||||
**Example**
|
||||
|
||||
The following hook handler replaces all ``M107`` ("Fan Off", deprecated) with an ``M106 S0`` ("Fan On" with speed
|
||||
parameter) upon queuing and logs all sent ``M106``.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/rewrite_m107.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `rewrite_m107.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/rewrite_m107.py>`_
|
||||
|
||||
:param object comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
|
||||
:param str phase: The current phase in the command progression, either ``queuing``, ``queued``, ``sending`` or
|
||||
``sent``. Will always match the ``<phase>`` of the hook.
|
||||
:param str cmd: The GCODE command for which the hook was triggered. This is the full command as taken either
|
||||
from the currently streamed GCODE file or via other means (e.g. user input our status polling).
|
||||
:param str cmd_type: Type of command, e.g. ``temperature_poll`` for temperature polling or ``sd_status_poll`` for SD
|
||||
printing status polling.
|
||||
:param str gcode: Parsed GCODE command, e.g. ``G0`` or ``M110``, may also be None if no known command could be parsed
|
||||
:return: None, 1-tuple, 2-tuple or string, see the description above for details.
|
||||
|
||||
.. _sec-plugins-hook-comm-protocol-scripts:
|
||||
|
||||
octoprint.comm.protocol.scripts
|
||||
-------------------------------
|
||||
|
||||
.. py:function:: hook(comm_instance, script_type, script_name, *args, **kwargs)
|
||||
|
||||
Return a prefix to prepend and a postfix to append to the script ``script_name`` of type ``type``. Handlers should
|
||||
make sure to only proceed with returning additional scripts if the ``script_type`` and ``script_name`` match
|
||||
handled scripts. If not, None should be returned directly.
|
||||
|
||||
If the hook handler has something to add to the specified script, it may return a 2-tuple, with the first entry
|
||||
defining the prefix (what to *prepend* to the script in question) and the last entry defining the postfix (what to
|
||||
*append* to the script in question). Both prefix and postfix can be None to signify that nothing should be prepended
|
||||
respectively appended.
|
||||
|
||||
The returned entries may be either iterables of script lines or a string including newlines of the script lines (which
|
||||
will be split by the caller if necessary).
|
||||
|
||||
**Example:**
|
||||
|
||||
Appends an ``M117 OctoPrint connected`` to the configured ``afterPrinterConnected`` GCODE script.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/message_on_connect.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `message_on_connect.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/message_on_connect.py>`_
|
||||
|
||||
:param MachineCom comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
|
||||
:param str script_type: The type of the script for which the hook was called, currently only "gcode" is supported here.
|
||||
:param str script_name: The name of the script for which the hook was called.
|
||||
:return: A 2-tuple in the form ``(prefix, postfix)`` or None
|
||||
:rtype: tuple or None
|
||||
|
||||
.. _sec-plugins-hook-comm-transport-serial-factory:
|
||||
|
||||
octoprint.comm.transport.serial.factory
|
||||
---------------------------------------
|
||||
|
||||
.. py:function:: hook(comm_instance, port, baudrate, read_timeout, *args, **kwargs)
|
||||
|
||||
Return a serial object to use as serial connection to the printer. If a handler cannot create a serial object
|
||||
for the specified ``port`` (and ``baudrate``), it should just return ``None``.
|
||||
|
||||
If the hook handler needs to perform state switches (e.g. for autodetection) or other operations on the
|
||||
:class:`~octoprint.util.comm.MachineCom` instance, it can use the supplied ``comm_instance`` to do so. Plugin
|
||||
authors should keep in mind however that due to a pending change in the communication layer of
|
||||
OctoPrint, that interface will change in the future. Authors are advised to follow OctoPrint's development
|
||||
closely if directly utilizing :class:`~octoprint.util.comm.MachineCom` functionality.
|
||||
|
||||
A valid serial instance is expected to provide the following methods, analogue to PySerial's
|
||||
`serial.Serial <https://pythonhosted.org//pyserial/pyserial_api.html#serial.Serial>`_:
|
||||
|
||||
readline(size=None, eol='\n')
|
||||
Reads a line from the serial connection, compare `serial.Filelike.readline <https://pythonhosted.org//pyserial/pyserial_api.html#serial.FileLike.readline>`_.
|
||||
write(data)
|
||||
Writes data to the serial connection, compare `serial.Filelike.write <https://pythonhosted.org//pyserial/pyserial_api.html#serial.FileLike.write>`_.
|
||||
close()
|
||||
Closes the serial connection, compare `serial.Serial.close <https://pythonhosted.org//pyserial/pyserial_api.html#serial.Serial.close>`_.
|
||||
|
||||
Additionally setting the following attributes need to be supported if baudrate detection is supposed to work:
|
||||
|
||||
baudrate
|
||||
An integer describing the baudrate to use for the serial connection, compare `serial.Serial.baudrate <https://pythonhosted.org//pyserial/pyserial_api.html#serial.Serial.baudrate>`_.
|
||||
timeout
|
||||
An integer describing the read timeout on the serial connection, compare `serial.Serial.timeout <https://pythonhosted.org//pyserial/pyserial_api.html#serial.Serial.timeout>`_.
|
||||
|
||||
**Example:**
|
||||
|
||||
Serial factory similar to the default one which performs auto detection of the serial port if ``port`` is ``None``
|
||||
or ``AUTO``.
|
||||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
def default(comm_instance, port, baudrate, connection_timeout):
|
||||
if port is None or port == 'AUTO':
|
||||
# no known port, try auto detection
|
||||
comm_instance._changeState(comm_instance.STATE_DETECT_SERIAL)
|
||||
serial_obj = comm_instance._detectPort(False)
|
||||
if serial_obj is None:
|
||||
comm_instance._log("Failed to autodetect serial port")
|
||||
comm_instance._errorValue = 'Failed to autodetect serial port.'
|
||||
comm_instance._changeState(comm_instance.STATE_ERROR)
|
||||
eventManager().fire(Events.ERROR, {"error": comm_instance.getErrorString()})
|
||||
return None
|
||||
|
||||
else:
|
||||
# connect to regular serial port
|
||||
comm_instance._log("Connecting to: %s" % port)
|
||||
if baudrate == 0:
|
||||
serial_obj = serial.Serial(str(port), 115200, timeout=connection_timeout, writeTimeout=10000, parity=serial.PARITY_ODD)
|
||||
else:
|
||||
serial_obj = serial.Serial(str(port), baudrate, timeout=connection_timeout, writeTimeout=10000, parity=serial.PARITY_ODD)
|
||||
serial_obj.close()
|
||||
serial_obj.parity = serial.PARITY_NONE
|
||||
serial_obj.open()
|
||||
|
||||
return serial_obj
|
||||
|
||||
:param MachineCom comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
|
||||
:param str port: The port for which to construct a serial instance. May be ``None`` or ``AUTO`` in which case port
|
||||
auto detection is to be performed.
|
||||
:param int baudrate: The baudrate for which to construct a serial instance. May be 0 in which case baudrate auto
|
||||
detection is to be performed.
|
||||
:param int read_timeout: The read timeout to set on the serial port.
|
||||
:return: The constructed serial object ready for use, or ``None`` if the handler could not construct the object.
|
||||
:rtype: A serial instance implementing implementing the methods ``readline(...)``, ``write(...)``, ``close()`` and
|
||||
optionally ``baudrate`` and ``timeout`` attributes as described above.
|
||||
|
||||
.. _sec-plugins-hook-filemanager-extensiontree:
|
||||
|
||||
octoprint.filemanager.extension_tree
|
||||
------------------------------------
|
||||
|
||||
.. py:function:: hook(*args, **kwargs)
|
||||
|
||||
Return additional entries for the tree of accepted file extensions for uploading/handling by the file manager.
|
||||
|
||||
Should return a dictionary to merge with the existing extension tree, adding additional extension groups to
|
||||
``machinecode`` or ``model`` types.
|
||||
|
||||
**Example:**
|
||||
|
||||
The following handler would add a new file type "x3g" as accepted ``machinecode`` format, with extensions ``x3g``
|
||||
and ``s3g``:
|
||||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
def support_x3g_machinecode(*args, **kwargs):
|
||||
return dict(
|
||||
machinecode=dict(
|
||||
x3g=["x3g", "s3g"]
|
||||
)
|
||||
)
|
||||
|
||||
.. note::
|
||||
|
||||
This will only add the supplied extensions to the extension tree, allowing the files to be uploaded and managed
|
||||
through the file manager. Plugins will need to add further steps to ensure that the files will be processable
|
||||
in the rest of the system (e.g. handling/preprocessing new machine code file types for printing etc)!
|
||||
|
||||
:return: The partial extension tree to merge with the full extension tree.
|
||||
:rtype: dict
|
||||
|
||||
.. _sec-plugins-hook-filemanager-preprocessor:
|
||||
|
||||
octoprint.filemanager.preprocessor
|
||||
----------------------------------
|
||||
|
||||
.. py:function:: hook(path, file_object, links=None, printer_profile=None, allow_overwrite=False, *args, **kwargs)
|
||||
|
||||
Replace the ``file_object`` used for saving added files to storage by calling :func:`~octoprint.filemanager.util.AbstractFileWrapper.save`.
|
||||
|
||||
``path`` will be the future path of the file on the storage. The file's name is accessible via
|
||||
:attr:`~octoprint.filemanager.util.AbstractFileWrapper.filename`.
|
||||
|
||||
``file_object`` will be a subclass of :class:`~octoprint.filemanager.util.AbstractFileWrapper`. Handlers may
|
||||
access the raw data of the file via :func:`~octoprint.filemanager.util.AbstractFileWrapper.stream`, e.g.
|
||||
to wrap it further. Handlers which do not wish to handle the `file_object`
|
||||
|
||||
**Example**
|
||||
|
||||
The following plugin example strips all comments from uploaded/generated GCODE files ending on the name postfix ``_strip``.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/strip_all_comments.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `strip_all_comments.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/strip_all_comments.py>`_
|
||||
|
||||
:param str path: The path on storage the `file_object` is to be stored
|
||||
:param AbstractFileWrapper file_object: The :class:`~octoprint.filemanager.util.AbstractFileWrapper` instance
|
||||
representing the file object to store.
|
||||
:param dict links: The links that are going to be stored with the file.
|
||||
:param dict printer_profile: The printer profile associated with the file.
|
||||
:param boolean allow_overwrite: Whether to allow overwriting an existing file named the same or not.
|
||||
:return: The `file_object` as passed in or None, or a replaced version to use instead for further processing.
|
||||
:rtype: AbstractFileWrapper or None
|
||||
|
||||
.. _sec-plugins-hook-server-http-bodysize:
|
||||
|
||||
octoprint.server.http.bodysize
|
||||
------------------------------
|
||||
|
||||
.. py:function:: hook(current_max_body_sizes, *args, **kwargs)
|
||||
|
||||
Allows extending the list of custom maximum body sizes on the web server per path and HTTP method with custom entries
|
||||
from plugins.
|
||||
|
||||
Your plugin might need this if you want to allow uploading files larger than 100KB (the default maximum upload size
|
||||
for anything but the ``/api/files`` endpoint).
|
||||
|
||||
``current_max_body_sizes`` will be a (read-only) list of the currently configured maximum body sizes, in case you
|
||||
want to check from your plugin if you need to even add a new entry.
|
||||
|
||||
The hook must return a list of 3-tuples (the list's length can be 0). Each 3-tuple should have the HTTP method
|
||||
against which to match as first, a regular expression for the path to match against and the maximum body size as
|
||||
an integer as the third entry.
|
||||
|
||||
The path of the route will be prefixed by OctoPrint with ``/plugin/<plugin identifier>/`` (if the path already begins
|
||||
with a ``/`` that will be stripped first).
|
||||
|
||||
**Example**
|
||||
|
||||
The following plugin example sets the maximum body size for ``POST`` requests against four custom URLs to 100, 200,
|
||||
500 and 1024KB. To test its functionality try uploading files larger or smaller than an endpoint's configured maximum
|
||||
size (as multipart request with the file upload residing in request parameter ``file``) and observe the behaviour.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/increase_bodysize.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `increase_bodysize.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/increase_bodysize.py>`_
|
||||
|
||||
:param list current_max_body_sizes: read-only list of the currently configured maximum body sizes
|
||||
:return: A list of 3-tuples with additional request specific maximum body sizes as defined above
|
||||
:rtype: list
|
||||
|
||||
.. _sec-plugins-hook-server-http-routes:
|
||||
|
||||
octoprint.server.http.routes
|
||||
----------------------------
|
||||
|
||||
.. py:function:: hook(server_routes, *args, **kwargs)
|
||||
|
||||
Allows extending the list of routes registered on the web server.
|
||||
|
||||
This is interesting for plugins which want to provide their own download URLs which will then be delivered statically
|
||||
following the same path structure as regular downloads.
|
||||
|
||||
``server_routes`` will be a (read-only) list of the currently defined server routes, in case you want to check from
|
||||
your plugin against that.
|
||||
|
||||
The hook must return a list of 3-tuples (the list's length can be 0). Each 3-tuple should have the path of the route
|
||||
(a string defining its regular expression) as the first, the `RequestHandler <http://tornado.readthedocs.org/en/branch4.0/web.html#request-handlers>`_
|
||||
class to use for the route as the second and a dictionary with keywords parameters for the defined request handler as
|
||||
the third entry.
|
||||
|
||||
The path of the route will be prefixed by OctoPrint with ``/plugin/<plugin identifier>/`` (if the path already begins
|
||||
with a ``/`` that will be stripped first).
|
||||
|
||||
.. note::
|
||||
|
||||
Static routes provided through this hook take precedence over routes defined through blueprints.
|
||||
|
||||
If your plugin also implements the :class:`~octoprint.plugin.BlueprintPlugin` mixin and has defined a route for a
|
||||
view on that which matches one of the paths provided via its ``octoprint.server.http.routes`` hook handler, the
|
||||
view of the blueprint will thus not be reachable since processing of the request will directly be handed over
|
||||
to your defined handler class.
|
||||
|
||||
**Example**
|
||||
|
||||
The following example registers two new routes ``/plugin/add_tornado_route/download`` and ``/plugin/add_tornado_route/forward``
|
||||
in the webserver which roughly replicate the functionality of ``/downloads/files/local`` and ``/downloads/camera/current``.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/add_tornado_route.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `add_tornado_route.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/add_tornado_route.py>`_
|
||||
|
||||
.. seealso::
|
||||
|
||||
:class:`~octoprint.server.util.tornado.LargeResponseHandler`
|
||||
Customized `tornado.web.StaticFileHandler <http://tornado.readthedocs.org/en/branch4.0/web.html#tornado.web.StaticFileHandler>`_
|
||||
that allows delivery of the requested resource as attachment and access validation through an optional callback.
|
||||
:class:`~octoprint.server.util.tornado.UrlForwardHandler`
|
||||
`tornado.web.RequestHandler <http://tornado.readthedocs.org/en/branch4.0/web.html#request-handlers>`_ that proxies
|
||||
requests to a preconfigured url and returns the response.
|
||||
|
||||
:param list server_routes: read-only list of the currently configured server routes
|
||||
:return: a list of 3-tuples with additional routes as defined above
|
||||
:rtype: list
|
||||
|
||||
.. _sec-plugins-hook-ui-web-templatetypes:
|
||||
|
||||
octoprint.ui.web.templatetypes
|
||||
------------------------------
|
||||
|
||||
.. py:function:: hook(template_sorting, template_rules, *args, **kwargs)
|
||||
|
||||
Allows extending the set of supported template types in the web interface. This is interesting for plugins which want
|
||||
to offer other plugins to hook into their own offered UIs. Handlers must return a list of additional template
|
||||
specifications in form of 3-tuples.
|
||||
|
||||
The first entry of the tuple must be the name of the template type and will be automatically prefixed with
|
||||
``plugin_<identifier>_``.
|
||||
|
||||
The second entry must be a sorting specification that defines how OctoPrint should sort multiple templates injected
|
||||
through plugins of this template type. The sorting specification should be a dict with the following possible
|
||||
entries:
|
||||
|
||||
.. list-table::
|
||||
:widths: 5 95
|
||||
|
||||
* - **Key**
|
||||
- **Description**
|
||||
* - key
|
||||
- The sorting key within the template config to use for sorting the list of template injections. This may be
|
||||
``None`` in which case no sorting will be taking place. Defaults to ``name``.
|
||||
* - add
|
||||
- Usually irrelevant for custom template types, only listed for the sake of completeness. The method of adding
|
||||
the sorted list of template injections from plugins to the template injections from the
|
||||
core. May be ``append`` to append the list, ``prepend`` to prepend the list, or ``custom_append`` or
|
||||
``custom_prepend`` to append respectively prepend but going so after preprocessing the entries and order data
|
||||
with custom functions (e.g. to inject additional entries such as the "Plugins" section header in the settings
|
||||
dialog). For custom template types this defaults to ``append``.
|
||||
* - custom_add_entries
|
||||
- Usually irrelevant for custom template types, only listed for the sake of completeness. Custom preprocessor
|
||||
for the entries provided through plugins, before they are added to the general template entries
|
||||
context variable for the current template type.
|
||||
* - custom_add_order
|
||||
- Usually irrelevant for custom template types, only listed for the sake of completeness. Custom preprocessor
|
||||
for the template order provided through plugins, before they are added to the general template order
|
||||
context variable for the current template type.
|
||||
|
||||
The third entry must be a rule specification in form of a dict which tells OctoPrint how to process the template
|
||||
configuration entries provided by :func:`~octoprint.plugin.TemplatePlugin.get_template_configs` by providing
|
||||
transformation functions of various kinds:
|
||||
|
||||
.. list-table::
|
||||
:widths: 5 95
|
||||
|
||||
* - **Key**
|
||||
- **Description**
|
||||
* - div
|
||||
- Function that returns the id of the container for template content if not explicitely provided by the template
|
||||
config, input parameter is the name of the plugin providing the currently processed template config. If not
|
||||
provided this defaults to a lambda function of the form ``lambda x: "<plugin identifier>_<template type>_plugin_" + x``
|
||||
with ``plugin identifier`` being the identifier of the plugin providing the additional template type.
|
||||
* - template
|
||||
- Function that returns the default template filename for a template type to attempt to include in case no
|
||||
template name is explicitly provided by the template config, input parameter is the name of the plugin provifing
|
||||
the current processed template config. If not provided this defaults to a lambda function of the form
|
||||
``lambda x: x + "_plugin_<plugin identifier>_<template type>.jinja2"`` with ``plugin identifier`` being the
|
||||
identifier of the plugin providing the additional template type.
|
||||
* - to_entry
|
||||
- Function to transform a template config to the data structure stored in the Jinja context for the injected
|
||||
template. If not provided this defaults to a lambda function returning a 2-tuple of the ``name`` value of
|
||||
the template config and the template config itself (``lambda data: (data["name"], data)``)
|
||||
* - mandatory
|
||||
- A list of keys that must be included in the template config for this template type. Template configs not containing
|
||||
all of the keys in this list will be ignored. Defaults to an empty list.
|
||||
|
||||
OctoPrint will provide all template configs for custom template types in the Jinja rendering context in the same way
|
||||
as it provides the template configs for core template types, through the ``templates`` context variable which is a
|
||||
dict mapping from the template type name (``plugin_<plugin identifier>_<template type>`` for custom ones) to a dict
|
||||
with ``entries`` and ``order`` values, the first containing a dict of all registered template configs, the latter
|
||||
an ordered list of all registered template keys of the type in the order they should be rendered. Plugins should
|
||||
iterate over the ``order`` list and then render each entry utilizing the template entry as provided for the key in
|
||||
the ``entries`` dict (note that this entry will have the format specified through the ``to_entry`` section in the
|
||||
template rule).
|
||||
|
||||
**Example**
|
||||
|
||||
The example consists of two plugins, one providing a custom template type and the other consuming it.
|
||||
|
||||
First the provider:
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_template_provider/__init__.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `custom_template_provider/__init__.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_template_provider/__init__.py>`_
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_template_provider/templates/custom_template_provider_settings.jinja2
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `custom_template_provider/templates/custom_template_provider_settings.jinja2 <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_template_provider/templates/custom_template_provider_settings.jinja2>`_
|
||||
|
||||
Then the consumer:
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_template_consumer/__init__.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `custom_template_consumer/__init__.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_template_consumer/__init__.py>`_
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_template_consumer/templates/custom_template_consumer_awesometemplate.jinja2
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `custom_template_consumer/templates/custom_template_consumer_awesometemplate.jinja2 <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_template_consumer/templates/custom_template_consumer_awesometemplate.jinja2>`_
|
||||
|
||||
|
||||
:param dict template_rules: read-only dictionary of currently configured template rules
|
||||
:param dict template_sorting: read-only dictionary of currentl configured template sorting specifications
|
||||
:return: a list of 3-tuples (template type, rule, sorting spec)
|
||||
:rtype: list
|
||||
@@ -0,0 +1,15 @@
|
||||
.. _sec-plugins:
|
||||
|
||||
##################
|
||||
Developing Plugins
|
||||
##################
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
gettingstarted.rst
|
||||
concepts.rst
|
||||
distributing.rst
|
||||
mixins.rst
|
||||
hooks.rst
|
||||
viewmodels.rst
|
||||
@@ -0,0 +1,93 @@
|
||||
.. _sec-plugins-mixins:
|
||||
|
||||
Available plugin mixins
|
||||
=======================
|
||||
|
||||
The following plugin mixins are currently available:
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Please note that all plugin mixins inherit from :class:`~octoprint.plugin.core.Plugin` and
|
||||
:class:`~octoprint.plugin.types.OctoPrintPlugin`, which also provide attributes of interest to plugin developers.
|
||||
|
||||
.. _sec-plugins-mixins-startupplugin:
|
||||
|
||||
StartupPlugin
|
||||
-------------
|
||||
|
||||
.. autoclass:: octoprint.plugin.StartupPlugin
|
||||
:members:
|
||||
|
||||
.. _sec-plugins-mixins-shutdownplugin:
|
||||
|
||||
ShutdownPlugin
|
||||
--------------
|
||||
|
||||
.. autoclass:: octoprint.plugin.ShutdownPlugin
|
||||
:members:
|
||||
|
||||
.. _sec-plugins-mixins-settingsplugin:
|
||||
|
||||
SettingsPlugin
|
||||
--------------
|
||||
|
||||
.. autoclass:: octoprint.plugin.SettingsPlugin
|
||||
:members:
|
||||
|
||||
.. _sec-plugins-mixins-assetplugin:
|
||||
|
||||
AssetPlugin
|
||||
-----------
|
||||
|
||||
.. autoclass:: octoprint.plugin.AssetPlugin
|
||||
:members:
|
||||
|
||||
.. _sec-plugins-mixins-templateplugin:
|
||||
|
||||
TemplatePlugin
|
||||
--------------
|
||||
|
||||
.. autoclass:: octoprint.plugin.TemplatePlugin
|
||||
:members:
|
||||
|
||||
.. _sec-plugins-mixins-simpleapiplugin:
|
||||
|
||||
SimpleApiPlugin
|
||||
---------------
|
||||
|
||||
.. autoclass:: octoprint.plugin.SimpleApiPlugin
|
||||
:members:
|
||||
|
||||
.. _sec-plugins-mixins-blueprintplugin:
|
||||
|
||||
BlueprintPlugin
|
||||
---------------
|
||||
|
||||
.. autoclass:: octoprint.plugin.BlueprintPlugin
|
||||
:members:
|
||||
|
||||
.. _sec-plugins-mixins-eventhandlerplugin:
|
||||
|
||||
EventHandlerPlugin
|
||||
------------------
|
||||
|
||||
.. autoclass:: octoprint.plugin.EventHandlerPlugin
|
||||
:members:
|
||||
|
||||
.. _sec-plugins-mixins-progressplugin:
|
||||
|
||||
ProgressPlugin
|
||||
--------------
|
||||
|
||||
.. autoclass:: octoprint.plugin.ProgressPlugin
|
||||
:members:
|
||||
|
||||
.. _sec-plugins-mixins-slicerplugin:
|
||||
|
||||
SlicerPlugin
|
||||
------------
|
||||
|
||||
.. autoclass:: octoprint.plugin.SlicerPlugin
|
||||
:members:
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
.. _sec-plugins-viewmodels:
|
||||
|
||||
Viewmodels
|
||||
==========
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
When implementing frontend components, you'll sooner or later want to define your own `KnockoutJS viewmodels <http://knockoutjs.com/>`_
|
||||
in order to provide custom functionality.
|
||||
|
||||
.. _sec-plugins-viewmodels-registering:
|
||||
|
||||
Registering custom viewmodels
|
||||
-----------------------------
|
||||
|
||||
Register your viewmodel with OctoPrint's web app by pushing a 3-tuple consisting of your viewmodel's class, a list
|
||||
of all required dependencies to be injected into the constructor and a list of all elements to bind the viewmodel to.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
$(function() {
|
||||
function MyCustomViewModel(parameters) {
|
||||
var self = this;
|
||||
|
||||
self.loginState = parameters[0]; // requested as first constructor parameter below
|
||||
|
||||
// more of your viewmodel's implementation
|
||||
}
|
||||
|
||||
OCTOPRINT_VIEWMODELS.push([
|
||||
MyCustomViewModel,
|
||||
["loginStateViewModel"],
|
||||
["#some_div", "#some_other_div"]
|
||||
]);
|
||||
})
|
||||
|
||||
.. note::
|
||||
|
||||
Each provided binding target may be either a string which will then be passed to jQuery's ``$(...)`` method to resolve
|
||||
the target, or alternatively directly a jQuery element.
|
||||
|
||||
.. _sec-plugins-viewmodels-dependencies:
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
OctoPrint will try to inject all viewmodel dependencies requested by your viewmodel. In order to do this it will
|
||||
perform multiple passes iterating over all registered viewmodels and collecting the necessary depedencies prior to
|
||||
construction. Circular depedencies (A dependens on B, B on C, C on A) naturally cannot be resolved and will cause an
|
||||
error to be logged to the Javascript console.
|
||||
|
||||
OctoPrint's core currently comes with the following viewmodels that your plugin can request for injection:
|
||||
|
||||
appearanceViewModel
|
||||
Viewmodel that holds the appearance settings (name, color and transparency flag).
|
||||
connectionViewModel
|
||||
Viewmodel for the connection sidebar entry.
|
||||
controlViewModel
|
||||
Viewmodel for the control tab.
|
||||
gcodeFilesViewModel
|
||||
Viewmodel for the files sidebar entry.
|
||||
firstRunViewModel
|
||||
Viewmodel for the first run dialog.
|
||||
gcodeViewModel
|
||||
Viewmodel for the gcode viewer tab.
|
||||
logViewModel
|
||||
Viewmodel for the logfile settings dialog.
|
||||
loginStateViewModel
|
||||
Viewmodel for the current loginstate of the user, very interesting for plugins that need to
|
||||
evaluate the current login state or information about the current user, e.g. associated roles.
|
||||
navigationViewModel
|
||||
Viewmodel for the navigation bar.
|
||||
printerProfilesViewModel
|
||||
Viewmodel for the printer profiles settings dialog.
|
||||
printerStateViewModel
|
||||
Viewmodel for the current printer state, very intersting for plugins that need
|
||||
to know information about the current print job, if the printer is connected, operational etc.
|
||||
settingsViewModel
|
||||
Viewmodel for the settings dialog, also holds all settings to be used by other viewmodels, hence
|
||||
very interesting for plugins as well.
|
||||
slicingViewModel
|
||||
Viewmodel for the slicing dialog.
|
||||
temperatureViewModel
|
||||
Viewmodel for the temperature tab, also holds current temperature information which
|
||||
might be interesting for plugins.
|
||||
terminalViewModel
|
||||
Viewmodel for the terminal tab, also holds terminal log entries.
|
||||
timelapseViewModel
|
||||
Viewmodel for the timelapse tab.
|
||||
usersViewModel
|
||||
Viewmodel for the user management in the settings dialog.
|
||||
userSettingsViewModel
|
||||
Viewmodel for settings associated with the currently logged in user, used for
|
||||
the user settings dialog.
|
||||
|
||||
Additionally each plugin's viewmodel will be added to the viewmodel map used for resolving dependencies as well, using
|
||||
the viewmodel's class name with a lower case first character as identifier (so "MyCustomViewModel" will be registered
|
||||
for dependency injection as "myCustomViewModel").
|
||||
|
||||
.. _sec-plugins-viewmodels-callbacks:
|
||||
|
||||
Callbacks
|
||||
---------
|
||||
|
||||
OctoPrint's web application will call several callbacks on all registered viewmodels, provided they implement them.
|
||||
Those are listed below:
|
||||
|
||||
onStartup()
|
||||
Called when the first initialization has been done: All viewmodels are constructed and hence their dependencies
|
||||
resolved, no bindings have been done yet.
|
||||
|
||||
onBeforeBinding()
|
||||
Called per viewmodel before attempting to bind it to its binding targets.
|
||||
|
||||
onAfterBinding()
|
||||
Called per viewmodel after binding it to its binding targets.
|
||||
|
||||
onAllBound(allViewModels)
|
||||
Called after all viewmodels have been bound, with the list of all viewmodels as the single parameter.
|
||||
|
||||
onStartupComplete()
|
||||
Called after the startup of the web app has been completed.
|
||||
|
||||
onServerDisconnect()
|
||||
Called if a disconnect from the server is detected.
|
||||
|
||||
onDataUpdaterReconnect()
|
||||
Called when the connection to the server has been reestablished after a disconnect.
|
||||
|
||||
fromHistoryData(data)
|
||||
Called when history data is received from the server. Usually that happens only after initial connect in order to
|
||||
transmit the temperature and terminal log history to the connecting client. Called with the ``data`` as single parameter.
|
||||
|
||||
fromCurrentData(data)
|
||||
Called when current printer status data is received from the server with the ``data`` as single parameter.
|
||||
|
||||
onSlicingProgress(slicer, modelPath, machineCodePath, progress)
|
||||
Called on slicing progress, call rate is once per percentage point of the progress at maximum.
|
||||
|
||||
onEvent<EventName>(payload)
|
||||
Called on firing of an event of type ``EventName``, e.g. ``onEventPrintDone``. See :ref:`the list of available events <sec-events-available_events>`
|
||||
for the possible events and their payloads.
|
||||
|
||||
fromTimelapseData(data)
|
||||
Called when timelapse configuration data is received from the server. Usually that happens after initial connect.
|
||||
|
||||
onDataUpdaterPluginMessage(plugin, message)
|
||||
Called when a plugin message is pushed from the server with the identifier of the calling plugin as first
|
||||
and the actual message as the second parameter. Note that the latter might be a full fledged object, depending
|
||||
on the plugin sending the message. You can use this method to asynchronously push data from your plugin's server
|
||||
component to it's frontend component.
|
||||
|
||||
onUserLoggedIn(user)
|
||||
Called when a user gets logged into the web app, either passively (upon initial load of the page due to a valid
|
||||
"Remember Me" cookie) or due to an active completion of the login dialog. The user data of the just logged in user
|
||||
will be provided as only parameter.
|
||||
|
||||
onUserLoggedOut()
|
||||
Called when a user gets logged out of the web app.
|
||||
|
||||
onTabChange(current, previous)
|
||||
Called before the main tab view switches to a new tab, so `before` the new tab becomes visible. Called with the
|
||||
current and previous tab's hash (e.g. ``#control``).
|
||||
|
||||
onAfterTabChange
|
||||
Called after the main tab view switches to a new tab, so `after` the new tab becomes visible. Called with the
|
||||
current and previous tab's hash (e.g. ``#control``).
|
||||
|
||||
getAdditionalControls
|
||||
Your viewmodel may return additional custom control definitions for inclusion on the "Control" tab of OctoPrint's
|
||||
interface. See :ref:`the custom control feature<sec-features-custom_controls>`.
|
||||
|
||||
onSettingsShown
|
||||
Called when the settings dialog is shown.
|
||||
|
||||
onSettingsHidden
|
||||
Called when the settings dialog is hidden.
|
||||
|
||||
onSettingsBeforeSave
|
||||
Called just before the settings viewmodel is sent to the server. This is useful, for example, if your plugin
|
||||
needs to compute persisted settings from a custom viewmodel.
|
||||
|
||||
onUserSettingsShown
|
||||
Called when the user settings dialog is shown.
|
||||
|
||||
onUserSettingsHidden
|
||||
Called when the user settings dialog is hidden.
|
||||
|
||||
In order to hook into any of those callbacks, just have your viewmodel define a function named accordingly, e.g.
|
||||
to get called after all viewmodels have been bound during application startup, implement a function ``onAllBound``
|
||||
on your viewmodel, taking a list of all bound viewmodels:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
$(function() {
|
||||
function MyCustomViewModel(parameters) {
|
||||
var self = this;
|
||||
|
||||
// ...
|
||||
|
||||
self.onAllBound = function(allViewModels) {
|
||||
// do something with them
|
||||
}
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
OCTOPRINT_VIEWMODELS.push([
|
||||
MyCustomViewModel,
|
||||
["loginStateViewModel"],
|
||||
["#some_div", "#some_other_div"]
|
||||
]);
|
||||
})
|
||||
|
||||
.. seealso::
|
||||
|
||||
`OctoPrint's core viewmodels <https://github.com/foosel/OctoPrint/tree/devel/src/octoprint/static/js/app/viewmodels>`_
|
||||
OctoPrint's own viewmodels use the same mechanisms for interacting with each other and the web application as
|
||||
plugins. Their sourcecode is therefore a good point of reference on how to achieve certain things.
|
||||
`KnockoutJS documentation <http://knockoutjs.com/documentation/introduction.html>`_
|
||||
OctoPrint makes heavy use of KnockoutJS for building up its web app.
|
||||
@@ -0,0 +1,258 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
__author__ = "Gina Häußge <osd@foosel.net>"
|
||||
__license__ = 'The MIT License <http://opensource.org/licenses/MIT>'
|
||||
__copyright__ = "Copyright (C) 2015 Gina Häußge - Released under terms of the MIT License"
|
||||
|
||||
from sphinx.directives.code import CodeBlock
|
||||
|
||||
import sphinx.highlighting
|
||||
from sphinx.highlighting import PygmentsBridge
|
||||
from sphinx.ext import doctest
|
||||
from sphinx.util.texescape import tex_hl_escape_map_new
|
||||
|
||||
from docutils.nodes import General, FixedTextElement, literal_block, container
|
||||
from docutils.parsers.rst import directives
|
||||
|
||||
from six import text_type
|
||||
|
||||
from pygments import highlight
|
||||
from pygments.filters import VisibleWhitespaceFilter, ErrorToken
|
||||
from pygments.lexers.python import PythonConsoleLexer
|
||||
from pygments.util import ClassNotFound
|
||||
|
||||
def _merge_dict(a, b):
|
||||
"""
|
||||
Little helper to merge two dicts a and b on the fly.
|
||||
"""
|
||||
result = dict(a)
|
||||
result.update(b)
|
||||
return result
|
||||
|
||||
class literal_block_ext(General, FixedTextElement):
|
||||
"""
|
||||
Custom node which is basically the same as a :class:`literal_block`, just with whitespace support and introduced
|
||||
in order to be able to have a custom visitor.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def from_literal_block(cls, block):
|
||||
"""
|
||||
Factory method constructing an instance exactly copying all attributes over from ``block`` and settings a
|
||||
custom ``tagname``.
|
||||
"""
|
||||
new = literal_block_ext()
|
||||
for a in ("attributes", "basic_attributes", "child_text_separator", "children", "document", "known_attributes",
|
||||
"line", "list_attributes", "local_attributes", "parent", "rawsource", "source"):
|
||||
setattr(new, a, getattr(block, a))
|
||||
new.tagname = "literal_block_ext"
|
||||
return new
|
||||
|
||||
class CodeBlockExt(CodeBlock):
|
||||
"""
|
||||
This is basically an extension of a regular :class:`CodeBlock` directive which just supports an additional option
|
||||
``whitespace`` which if present will enable (together with everything else in here) to render whitespace in
|
||||
code blocks.
|
||||
"""
|
||||
|
||||
option_spec = _merge_dict(CodeBlock.option_spec, dict(whitespace=directives.flag))
|
||||
|
||||
def run(self):
|
||||
# get result from parent implementation
|
||||
code_block = CodeBlock.run(self)
|
||||
|
||||
def find_and_wrap_literal_block(node):
|
||||
"""
|
||||
Recursive method to turn all literal blocks located within a node into :class:`literal_block_ext`.
|
||||
"""
|
||||
|
||||
if isinstance(node, container):
|
||||
# container node => handle all children
|
||||
children = []
|
||||
for child in node.children:
|
||||
children.append(find_and_wrap_literal_block(child))
|
||||
node.children = children
|
||||
return node
|
||||
|
||||
elif isinstance(node, literal_block):
|
||||
# literal block => replace it
|
||||
return self._wrap_literal_block(node)
|
||||
|
||||
else:
|
||||
# no idea what that is => leave it alone
|
||||
return node
|
||||
|
||||
# replace all created literal_blocks with literal_block_ext instances
|
||||
return map(find_and_wrap_literal_block, code_block)
|
||||
|
||||
def _wrap_literal_block(self, node):
|
||||
literal = literal_block_ext.from_literal_block(node)
|
||||
literal["whitespace"] = "whitespace" in self.options
|
||||
return literal
|
||||
|
||||
class PygmentsBridgeExt(object):
|
||||
"""
|
||||
Wrapper for :class:`PygmentsBridge`, delegates everything to the wrapped ``bridge`` but :method:`highlight_block`,
|
||||
which calls the parent implementation for lexer selection, then
|
||||
"""
|
||||
|
||||
def __init__(self, bridge, whitespace):
|
||||
self._bridge = bridge
|
||||
self._whitespace = whitespace
|
||||
|
||||
def __getattr__(self, item):
|
||||
return getattr(self._bridge, item)
|
||||
|
||||
def highlight_block(self, source, lang, opts=None, warn=None, force=False, **kwargs):
|
||||
if not self._whitespace:
|
||||
return self._bridge.highlight_block(source, lang, opts=opts, warn=warn, force=force, **kwargs)
|
||||
|
||||
# We are still here => we need to basically do everything the parent implementation does (and does so in a very
|
||||
# unextensible way...), but inject the whitespace filter into the used lexer just before the highlighting run
|
||||
# and remove it afterwards so the lexer can be safely reused.
|
||||
#
|
||||
# For this we define a context manager that will allow us to wrap a lexer and modify its filters on the fly to
|
||||
# include the whitespace filter.
|
||||
|
||||
class whitespace(object):
|
||||
def __init__(self, lexer):
|
||||
self._lexer = lexer
|
||||
self._orig_filters = lexer.filters
|
||||
self._orig_tabsize = lexer.tabsize
|
||||
|
||||
def __enter__(self):
|
||||
new_filters = list(self._orig_filters)
|
||||
new_filters.append(VisibleWhitespaceFilter(spaces=True, tabs=True, tabsize=self._lexer.tabsize))
|
||||
self._lexer.filters = new_filters
|
||||
self._lexer.tabsize = 0
|
||||
return self._lexer
|
||||
|
||||
def __exit__(self, type, value, traceback):
|
||||
self._lexer.filters = self._orig_filters
|
||||
self._lexer.tabsize = self._orig_tabsize
|
||||
|
||||
# Then a ton of copy-pasted code follows. Sadly, we need to do this since we have no way to inject ourselves
|
||||
# into the highlighting call otherwise - lexer selection and actual call are tightly coupled in the original
|
||||
# "highlight_block" method, with no means for external code to inject different functionality.
|
||||
#
|
||||
# Unless otherwise marked ("MODIFIED"), any code in this method after this line is copied verbatim from the
|
||||
# implementation of sphinx.highlighting.PygmentsBridge, released under the Simplified BSD License, the copyright
|
||||
# lies with the respective authors.
|
||||
|
||||
if not isinstance(source, text_type):
|
||||
source = source.decode()
|
||||
|
||||
# find out which lexer to use
|
||||
if lang in ('py', 'python'):
|
||||
if source.startswith('>>>'):
|
||||
# interactive session
|
||||
lexer = sphinx.highlighting.lexers['pycon']
|
||||
elif not force:
|
||||
# maybe Python -- try parsing it
|
||||
if self.try_parse(source):
|
||||
lexer = sphinx.highlighting.lexers['python']
|
||||
else:
|
||||
lexer = sphinx.highlighting.lexers['none']
|
||||
else:
|
||||
lexer = sphinx.highlighting.lexers['python']
|
||||
elif lang in ('python3', 'py3') and source.startswith('>>>'):
|
||||
# for py3, recognize interactive sessions, but do not try parsing...
|
||||
lexer = sphinx.highlighting.lexers['pycon3']
|
||||
elif lang == 'guess':
|
||||
try:
|
||||
lexer = sphinx.highlighting.guess_lexer(source)
|
||||
except Exception:
|
||||
lexer = sphinx.highlighting.lexers['none']
|
||||
else:
|
||||
if lang in sphinx.highlighting.lexers:
|
||||
lexer = sphinx.highlighting.lexers[lang]
|
||||
else:
|
||||
try:
|
||||
lexer = sphinx.highlighting.lexers[lang] = sphinx.highlighting.get_lexer_by_name(lang, **opts or {})
|
||||
except ClassNotFound:
|
||||
if warn:
|
||||
warn('Pygments lexer name %r is not known' % lang)
|
||||
lexer = sphinx.highlighting.lexers['none']
|
||||
else:
|
||||
raise
|
||||
else:
|
||||
lexer.add_filter('raiseonerror')
|
||||
|
||||
if not isinstance(source, text_type):
|
||||
source = source.decode()
|
||||
|
||||
# trim doctest options if wanted
|
||||
if isinstance(lexer, PythonConsoleLexer) and self._bridge.trim_doctest_flags:
|
||||
source = doctest.blankline_re.sub('', source)
|
||||
source = doctest.doctestopt_re.sub('', source)
|
||||
|
||||
# highlight via Pygments
|
||||
formatter = self._bridge.get_formatter(**kwargs)
|
||||
try:
|
||||
# MODIFIED: replaced by whitespace wrapped call
|
||||
with whitespace(lexer) as l:
|
||||
hlsource = highlight(source, l, formatter)
|
||||
# /MODIFIED
|
||||
except ErrorToken:
|
||||
# this is most probably not the selected language,
|
||||
# so let it pass unhighlighted
|
||||
|
||||
# MODIFIED: replaced by whitespace wrapped call
|
||||
with whitespace(sphinx.highlighting.lexers["none"]) as l:
|
||||
hlsource = highlight(source, l, formatter)
|
||||
# /MODIFIED
|
||||
if self._bridge.dest == 'html':
|
||||
return hlsource
|
||||
else:
|
||||
if not isinstance(hlsource, text_type): # Py2 / Pygments < 1.6
|
||||
hlsource = hlsource.decode()
|
||||
return hlsource.translate(tex_hl_escape_map_new)
|
||||
|
||||
|
||||
class whitespace_highlighter(object):
|
||||
"""
|
||||
Context manager for adapting the used highlighter on a translator for a given node's whitespace properties.
|
||||
"""
|
||||
def __init__(self, translator, node):
|
||||
self.translator = translator
|
||||
self.node = node
|
||||
|
||||
self._orig_highlighter = self.translator.highlighter
|
||||
|
||||
def __enter__(self):
|
||||
whitespace = self.node["whitespace"] if "whitespace" in self.node else False
|
||||
if whitespace:
|
||||
self.translator.highlighter = PygmentsBridgeExt(self._orig_highlighter, whitespace)
|
||||
return self.translator
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
self.translator.highlighter = self._orig_highlighter
|
||||
|
||||
|
||||
def visit_literal_block_ext(translator, node):
|
||||
"""
|
||||
When our custom code block is visited, we temporarily exchange the highlighter used in the translator, call the
|
||||
visitor for regular literal blocks, then switch back again.
|
||||
"""
|
||||
with whitespace_highlighter(translator, node):
|
||||
translator.visit_literal_block(node)
|
||||
|
||||
|
||||
def depart_literal_block_ext(translator, node):
|
||||
"""
|
||||
Just call the depart function for regular literal blocks.
|
||||
"""
|
||||
with whitespace_highlighter(translator, node):
|
||||
translator.depart_literal_block(node)
|
||||
|
||||
|
||||
def setup(app):
|
||||
# custom directive
|
||||
app.add_directive("code-block-ext", CodeBlockExt)
|
||||
|
||||
# custom node type
|
||||
handler = (visit_literal_block_ext, depart_literal_block_ext)
|
||||
app.add_node(literal_block_ext, html=handler, latex=handler, text=handler)
|
||||
|
||||
return dict(version="0.1")
|
||||
@@ -0,0 +1,56 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
__author__ = "Gina Häußge <osd@foosel.net>"
|
||||
__license__ = 'The MIT License <http://opensource.org/licenses/MIT>'
|
||||
__copyright__ = "Copyright (C) 2015 Gina Häußge - Released under terms of the MIT License"
|
||||
|
||||
|
||||
import codecs
|
||||
import urllib2
|
||||
|
||||
from sphinx.directives import LiteralInclude, dedent_lines
|
||||
|
||||
cache = dict()
|
||||
|
||||
class OnlineIncludeDirective(LiteralInclude):
|
||||
|
||||
def read_with_encoding(self, filename, document, codec_info, encoding):
|
||||
global cache
|
||||
|
||||
f = None
|
||||
try:
|
||||
if not self.arguments[0] in cache:
|
||||
f = codecs.StreamReaderWriter(urllib2.urlopen(self.arguments[0]), codec_info[2],
|
||||
codec_info[3], 'strict')
|
||||
lines = f.readlines()
|
||||
cache[self.arguments[0]] = lines
|
||||
else:
|
||||
lines = cache[self.arguments[0]]
|
||||
|
||||
lines = dedent_lines(lines, self.options.get('dedent'))
|
||||
return lines
|
||||
except (IOError, OSError, urllib2.URLError):
|
||||
return [document.reporter.warning(
|
||||
'Include file %r not found or reading it failed' % self.arguments[0],
|
||||
line=self.lineno)]
|
||||
except UnicodeError:
|
||||
return [document.reporter.warning(
|
||||
'Encoding %r used for reading included file %r seems to '
|
||||
'be wrong, try giving an :encoding: option' %
|
||||
(encoding, self.arguments[0]))]
|
||||
finally:
|
||||
if f is not None:
|
||||
f.close()
|
||||
|
||||
def visit_onlineinclude(translator, node):
|
||||
translator.visit_literal_block(node)
|
||||
|
||||
def depart_onlineinclude(translator, node):
|
||||
translator.depart_literal_block(node)
|
||||
|
||||
def setup(app):
|
||||
app.add_directive("onlineinclude", OnlineIncludeDirective)
|
||||
|
||||
handler = (visit_onlineinclude, depart_onlineinclude)
|
||||
app.add_node(OnlineIncludeDirective, html=handler, latex=handler, text=handler)
|
||||
@@ -1,10 +0,0 @@
|
||||
flask==0.9
|
||||
werkzeug==0.8.3
|
||||
tornado==3.0.2
|
||||
sockjs-tornado>=1.0.0
|
||||
PyYAML==3.10
|
||||
Flask-Login==0.2.2
|
||||
Flask-Principal==0.3.5
|
||||
netaddr>=0.7.10
|
||||
mock>=1.0.1
|
||||
nose>=1.3.0
|
||||
@@ -1,11 +1,10 @@
|
||||
flask==0.9
|
||||
werkzeug==0.8.3
|
||||
tornado==3.0.2
|
||||
sockjs-tornado>=1.0.0
|
||||
PyYAML==3.10
|
||||
Flask-Login==0.2.2
|
||||
Flask-Principal==0.3.5
|
||||
pyserial>=2.6
|
||||
netaddr>=0.7.10
|
||||
mock>=1.0.1
|
||||
nose>=1.3.0
|
||||
###
|
||||
# This file is only here to make sure that something like
|
||||
#
|
||||
# pip install -e .[develop]
|
||||
#
|
||||
# works as expected. Requirements can be found in setup.py in the
|
||||
# variables INSTALL_REQUIRES and EXTRA_REQUIRES.
|
||||
###
|
||||
|
||||
.
|
||||
@@ -1,13 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
print """
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!! You are using an old startup method for OctoPrint. !!!
|
||||
!!! Please perform 'sudo python setup.py install' and !!!
|
||||
!!! use the 'octoprint' executable instead. !!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -24,7 +16,7 @@ I don't know anything about).
|
||||
"""
|
||||
os.rename(old, os.path.join(basedir, "octoprint.backup"))
|
||||
|
||||
sys.path.append(os.path.join(basedir, "src"))
|
||||
sys.path.insert(0, os.path.join(basedir, "src"))
|
||||
|
||||
import octoprint
|
||||
octoprint.main()
|
||||
@@ -15,5 +15,9 @@ DAEMON_ARGS="--port=$PORT"
|
||||
# Umask of files octoprint generates, Change this to 000 if running octoprint as its own, separate user
|
||||
UMASK=022
|
||||
|
||||
# Process priority, 0 here will result in a priority 20 process.
|
||||
# -2 ensures Octoprint has a slight priority over user processes.
|
||||
NICELEVEL=-2
|
||||
|
||||
# Should we run at startup?
|
||||
START=yes
|
||||
@@ -18,7 +18,7 @@
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC="Octoprint Daemon"
|
||||
NAME="Octoprint"
|
||||
DAEMON=/usr/bin/octoprint
|
||||
DAEMON=/usr/local/bin/octoprint
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
PKGNAME=octoprint
|
||||
SCRIPTNAME=/etc/init.d/$PKGNAME
|
||||
@@ -73,7 +73,8 @@ do_start()
|
||||
|
||||
if [ $RETVAL != 0 ]; then
|
||||
start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
|
||||
--exec $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK -- $DAEMON_ARGS
|
||||
--exec $DAEMON --chuid $OCTOPRINT_USER --user $OCTOPRINT_USER --umask $UMASK --nicelevel=$NICELEVEL \
|
||||
-- $DAEMON_ARGS
|
||||
RETVAL="$?"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
[metadata]
|
||||
description-file = README.md
|
||||
|
||||
[versioneer]
|
||||
VCS = git
|
||||
style = pep440-post
|
||||
versionfile_source = src/octoprint/_version.py
|
||||
versionfile_build = octoprint/_version.py
|
||||
tag_prefix =
|
||||
parentdir_prefix =
|
||||
lookupfile = .versioneer-lookup
|
||||
@@ -1,15 +1,148 @@
|
||||
# coding=utf-8
|
||||
#!/usr/bin/env python
|
||||
# coding=utf-8
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
from distutils.command.build_py import build_py as _build_py
|
||||
import os
|
||||
import versioneer
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "src"))
|
||||
import octoprint_setuptools
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# Requirements for our application
|
||||
INSTALL_REQUIRES = [
|
||||
"flask>=0.9,<0.11",
|
||||
"werkzeug>=0.8.3,<0.9",
|
||||
"tornado>=4.0.1,<4.1",
|
||||
"sockjs-tornado>=1.0.1,<1.1",
|
||||
"PyYAML>=3.10,<3.11",
|
||||
"Flask-Login>=0.2.2,<0.3",
|
||||
"Flask-Principal>=0.3.5,<0.4",
|
||||
"Flask-Babel>=0.9,<0.10",
|
||||
"Flask-Assets>=0.10,<0.11",
|
||||
"markdown>=2.6.4,<2.7",
|
||||
"pyserial>=2.7,<2.8",
|
||||
"netaddr>=0.7.17,<0.8",
|
||||
"watchdog>=0.8.3,<0.9",
|
||||
"sarge>=0.1.4,<0.2",
|
||||
"netifaces>=0.10,<0.11",
|
||||
"pylru>=1.0.9,<1.1",
|
||||
"rsa>=3.2,<3.3",
|
||||
"pkginfo>=1.2.1,<1.3",
|
||||
"requests>=2.7.0,<2.8",
|
||||
"semantic_version>=2.4.2,<2.5",
|
||||
"psutil>=3.2.1,<3.3",
|
||||
"awesome-slugify>=1.6.5,<1.7",
|
||||
"feedparser>=5.2.1,<5.3"
|
||||
]
|
||||
|
||||
# Additional requirements for optional install options
|
||||
EXTRA_REQUIRES = dict(
|
||||
# Dependencies for developing OctoPrint
|
||||
develop=[
|
||||
# Testing dependencies
|
||||
"mock>=1.0.1,<1.1",
|
||||
"nose>=1.3.0,<1.4",
|
||||
"ddt",
|
||||
|
||||
# Documentation dependencies
|
||||
"sphinx>=1.3,<1.4",
|
||||
"sphinxcontrib-httpdomain",
|
||||
"sphinx_rtd_theme",
|
||||
|
||||
# PyPi upload related
|
||||
"pypandoc"
|
||||
],
|
||||
|
||||
# Dependencies for developing OctoPrint plugins
|
||||
plugins=[
|
||||
"cookiecutter>=1.4,<1.5"
|
||||
]
|
||||
)
|
||||
|
||||
# Additional requirements for setup
|
||||
SETUP_REQUIRES = []
|
||||
|
||||
# Dependency links for any of the aforementioned dependencies
|
||||
DEPENDENCY_LINKS = []
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
# Anything below here is just command setup and general setup configuration
|
||||
|
||||
def data_copy_build_py_factory(files, baseclass):
|
||||
class data_copy_build_py(baseclass):
|
||||
files = dict()
|
||||
|
||||
def run(self):
|
||||
import shutil
|
||||
if not self.dry_run:
|
||||
for directory, files in self.__class__.files.items():
|
||||
target_dir = os.path.join(self.build_lib, directory)
|
||||
self.mkpath(target_dir)
|
||||
|
||||
for entry in files:
|
||||
if isinstance(entry, tuple):
|
||||
if len(entry) != 2:
|
||||
continue
|
||||
source, dest = entry
|
||||
else:
|
||||
source = dest = entry
|
||||
shutil.copy(source, os.path.join(target_dir, dest))
|
||||
|
||||
baseclass.run(self)
|
||||
|
||||
return type(data_copy_build_py)(data_copy_build_py.__name__,
|
||||
(data_copy_build_py,),
|
||||
dict(files=files))
|
||||
|
||||
def get_cmdclass():
|
||||
cmdclass = versioneer.get_cmdclass()
|
||||
|
||||
# add clean command
|
||||
cmdclass.update(dict(clean=octoprint_setuptools.CleanCommand.for_options(source_folder="src", eggs=["OctoPrint*.egg-info"])))
|
||||
|
||||
# add translation commands
|
||||
translation_dir = "translations"
|
||||
pot_file = os.path.join(translation_dir, "messages.pot")
|
||||
bundled_dir = os.path.join("src", "octoprint", "translations")
|
||||
cmdclass.update(octoprint_setuptools.get_babel_commandclasses(pot_file=pot_file, output_dir=translation_dir, pack_name_prefix="OctoPrint-i18n-", pack_path_prefix="", bundled_dir=bundled_dir))
|
||||
|
||||
cmdclass["build_py"] = data_copy_build_py_factory({
|
||||
"octoprint/templates/_data": [
|
||||
"AUTHORS.md",
|
||||
"CHANGELOG.md",
|
||||
"SUPPORTERS.md",
|
||||
"THIRDPARTYLICENSES.md",
|
||||
]
|
||||
}, cmdclass["build_py"] if "build_py" in cmdclass else _build_py)
|
||||
|
||||
return cmdclass
|
||||
|
||||
VERSION = open("VERSION").read().strip()
|
||||
|
||||
def params():
|
||||
name = "OctoPrint"
|
||||
version = VERSION
|
||||
description = "A responsive web interface for 3D printers"
|
||||
version = versioneer.get_version()
|
||||
cmdclass = get_cmdclass()
|
||||
|
||||
description = "A snappy web interface for 3D printers"
|
||||
long_description = open("README.md").read()
|
||||
|
||||
install_requires = INSTALL_REQUIRES
|
||||
extras_require = EXTRA_REQUIRES
|
||||
dependency_links = DEPENDENCY_LINKS
|
||||
setup_requires = SETUP_REQUIRES
|
||||
|
||||
try:
|
||||
import pypandoc
|
||||
setup_requires += ["setuptools-markdown"]
|
||||
long_description_markdown_filename = "README.md"
|
||||
del pypandoc
|
||||
except:
|
||||
pass
|
||||
|
||||
classifiers = [
|
||||
"Development Status :: 4 - Beta",
|
||||
"Environment :: Web Environment",
|
||||
@@ -35,11 +168,21 @@ def params():
|
||||
license = "AGPLv3"
|
||||
|
||||
packages = find_packages(where="src")
|
||||
package_dir = {"octoprint": "src/octoprint"}
|
||||
package_dir = {
|
||||
"": "src",
|
||||
}
|
||||
package_data = {
|
||||
"octoprint": octoprint_setuptools.package_data_dirs('src/octoprint', ['static', 'templates', 'plugins', 'translations'])
|
||||
}
|
||||
|
||||
include_package_data = True
|
||||
zip_safe = False
|
||||
install_requires = open("requirements.txt").read().split("\n")
|
||||
|
||||
if os.environ.get('READTHEDOCS', None) == 'True':
|
||||
# we can't tell read the docs to please perform a pip install -e .[develop], so we help
|
||||
# it a bit here by explicitly adding the development dependencies, which include our
|
||||
# documentation dependencies
|
||||
install_requires = install_requires + extras_require['develop']
|
||||
|
||||
entry_points = {
|
||||
"console_scripts": [
|
||||
@@ -47,10 +190,6 @@ def params():
|
||||
]
|
||||
}
|
||||
|
||||
#scripts = {
|
||||
# "scripts/octoprint.init": "/etc/init.d/octoprint"
|
||||
#}
|
||||
|
||||
return locals()
|
||||
|
||||
setup(**params())
|
||||
@@ -1,10 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import absolute_import
|
||||
|
||||
import sys
|
||||
from octoprint.daemon import Daemon
|
||||
from octoprint.server import Server
|
||||
|
||||
#~~ version
|
||||
|
||||
from ._version import get_versions
|
||||
__version__ = get_versions()['version']
|
||||
del get_versions
|
||||
|
||||
#~~ main class
|
||||
|
||||
class Main(Daemon):
|
||||
def __init__(self, pidfile, configfile, basedir, host, port, debug):
|
||||
def __init__(self, pidfile, configfile, basedir, host, port, debug, allowRoot, logConf):
|
||||
Daemon.__init__(self, pidfile)
|
||||
|
||||
self._configfile = configfile
|
||||
@@ -12,9 +22,18 @@ class Main(Daemon):
|
||||
self._host = host
|
||||
self._port = port
|
||||
self._debug = debug
|
||||
self._allowRoot = allowRoot
|
||||
self._logConf = logConf
|
||||
|
||||
def run(self):
|
||||
octoprint = Server(self._configfile, self._basedir, self._host, self._port, self._debug)
|
||||
octoprint = Server(configfile=self._configfile,
|
||||
basedir=self._basedir,
|
||||
host=self._host,
|
||||
port=self._port,
|
||||
debug=self._debug,
|
||||
allowRoot=self._allowRoot,
|
||||
logConf=self._logConf,
|
||||
octoprint_daemon=self)
|
||||
octoprint.run()
|
||||
|
||||
def main():
|
||||
@@ -22,6 +41,9 @@ def main():
|
||||
|
||||
parser = argparse.ArgumentParser(prog="run")
|
||||
|
||||
parser.add_argument("-v", "--version", action="store_true", dest="version",
|
||||
help="Output OctoPrint's version and exit")
|
||||
|
||||
parser.add_argument("-d", "--debug", action="store_true", dest="debug",
|
||||
help="Enable debug mode")
|
||||
|
||||
@@ -34,6 +56,8 @@ def main():
|
||||
help="Specify the config file to use. OctoPrint needs to have write access for the settings dialog to work. Defaults to ~/.octoprint/config.yaml")
|
||||
parser.add_argument("-b", "--basedir", action="store", dest="basedir",
|
||||
help="Specify the basedir to use for uploads, timelapses etc. OctoPrint needs to have write access. Defaults to ~/.octoprint")
|
||||
parser.add_argument("--logging", action="store", dest="logConf",
|
||||
help="Specify the config file to use for configuring logging. Defaults to ~/.octoprint/logging.yaml")
|
||||
|
||||
parser.add_argument("--daemon", action="store", type=str, choices=["start", "stop", "restart"],
|
||||
help="Daemonize/control daemonized OctoPrint instance (only supported under Linux right now)")
|
||||
@@ -45,12 +69,16 @@ def main():
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.version:
|
||||
print "OctoPrint version %s" % __version__
|
||||
sys.exit(0)
|
||||
|
||||
if args.daemon:
|
||||
if sys.platform == "darwin" or sys.platform == "win32":
|
||||
print >> sys.stderr, "Sorry, daemon mode is only supported under Linux right now"
|
||||
sys.exit(2)
|
||||
|
||||
daemon = Main(args.pidfile, args.config, args.basedir, args.host, args.port, args.debug)
|
||||
daemon = Main(args.pidfile, args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot, args.logConf)
|
||||
if "start" == args.daemon:
|
||||
daemon.start()
|
||||
elif "stop" == args.daemon:
|
||||
@@ -58,9 +86,14 @@ def main():
|
||||
elif "restart" == args.daemon:
|
||||
daemon.restart()
|
||||
else:
|
||||
octoprint = Server(args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot)
|
||||
octoprint = Server(configfile=args.config,
|
||||
basedir=args.basedir,
|
||||
host=args.host,
|
||||
port=args.port,
|
||||
debug=args.debug,
|
||||
allowRoot=args.allowRoot,
|
||||
logConf=args.logConf)
|
||||
octoprint.run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,660 @@
|
||||
|
||||
# This file helps to compute a version number in source trees obtained from
|
||||
# git-archive tarball (such as those provided by githubs download-from-tag
|
||||
# feature). Distribution tarballs (built by setup.py sdist) and build
|
||||
# directories (produced by setup.py build) will contain a much shorter file
|
||||
# that just contains the computed version number.
|
||||
|
||||
# This file is released into the public domain. Generated by
|
||||
# versioneer-0.15+dev (https://github.com/warner/python-versioneer)
|
||||
|
||||
"""Git implementation of _version.py."""
|
||||
|
||||
import errno
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def get_keywords():
|
||||
"""Get the keywords needed to look up the version information."""
|
||||
# these strings will be replaced by git during git-archive.
|
||||
# setup.py/versioneer.py will grep for the variable names, so they must
|
||||
# each be defined on a line of their own. _version.py will just call
|
||||
# get_keywords().
|
||||
git_refnames = "$Format:%d$"
|
||||
git_full = "$Format:%H$"
|
||||
keywords = {"refnames": git_refnames, "full": git_full}
|
||||
return keywords
|
||||
|
||||
|
||||
class VersioneerConfig:
|
||||
|
||||
"""Container for Versioneer configuration parameters."""
|
||||
|
||||
|
||||
def get_config():
|
||||
"""Create, populate and return the VersioneerConfig() object."""
|
||||
# these strings are filled in when 'setup.py versioneer' creates
|
||||
# _version.py
|
||||
cfg = VersioneerConfig()
|
||||
cfg.VCS = "git"
|
||||
cfg.style = "pep440"
|
||||
cfg.tag_prefix = ""
|
||||
cfg.parentdir_prefix = ""
|
||||
cfg.versionfile_source = "src/octoprint/_version.py"
|
||||
cfg.lookupfile = None
|
||||
cfg.verbose = False
|
||||
return cfg
|
||||
|
||||
|
||||
class NotThisMethod(Exception):
|
||||
|
||||
"""Exception raised if a method is not valid for the current scenario."""
|
||||
|
||||
|
||||
LONG_VERSION_PY = {}
|
||||
HANDLERS = {}
|
||||
|
||||
|
||||
def register_vcs_handler(vcs, method): # decorator
|
||||
"""Decorator to mark a method as the handler for a particular VCS."""
|
||||
def decorate(f):
|
||||
"""Store f in HANDLERS[vcs][method]."""
|
||||
if vcs not in HANDLERS:
|
||||
HANDLERS[vcs] = {}
|
||||
HANDLERS[vcs][method] = f
|
||||
return f
|
||||
return decorate
|
||||
|
||||
|
||||
def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
|
||||
"""Call the given command(s)."""
|
||||
assert isinstance(commands, list)
|
||||
p = None
|
||||
for c in commands:
|
||||
try:
|
||||
dispcmd = str([c] + args)
|
||||
# remember shell=False, so use git.cmd on windows, not just git
|
||||
p = subprocess.Popen([c] + args, cwd=cwd, stdout=subprocess.PIPE,
|
||||
stderr=(subprocess.PIPE if hide_stderr
|
||||
else None))
|
||||
break
|
||||
except EnvironmentError:
|
||||
e = sys.exc_info()[1]
|
||||
if e.errno == errno.ENOENT:
|
||||
continue
|
||||
if verbose:
|
||||
print("unable to run %s" % dispcmd)
|
||||
print(e)
|
||||
return None
|
||||
else:
|
||||
if verbose:
|
||||
print("unable to find command, tried %s" % (commands,))
|
||||
return None
|
||||
stdout = p.communicate()[0].strip()
|
||||
if sys.version_info[0] >= 3:
|
||||
stdout = stdout.decode()
|
||||
if p.returncode != 0:
|
||||
if verbose:
|
||||
print("unable to run %s (error)" % dispcmd)
|
||||
return None
|
||||
return stdout
|
||||
|
||||
|
||||
def versions_from_parentdir(parentdir_prefix, root, verbose):
|
||||
"""Try to determine the version from the parent directory name.
|
||||
|
||||
Source tarballs conventionally unpack into a directory that includes
|
||||
both the project name and a version string.
|
||||
"""
|
||||
dirname = os.path.basename(root)
|
||||
if not dirname.startswith(parentdir_prefix):
|
||||
if verbose:
|
||||
print("guessing rootdir is '%s', but '%s' doesn't start with "
|
||||
"prefix '%s'" % (root, dirname, parentdir_prefix))
|
||||
raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
|
||||
return {"version": dirname[len(parentdir_prefix):],
|
||||
"full-revisionid": None,
|
||||
"dirty": False, "error": None}
|
||||
|
||||
|
||||
@register_vcs_handler("git", "get_keywords")
|
||||
def git_get_keywords(versionfile_abs):
|
||||
"""Extract version information from the given file."""
|
||||
# the code embedded in _version.py can just fetch the value of these
|
||||
# keywords. When used from setup.py, we don't want to import _version.py,
|
||||
# so we do it with a regexp instead. This function is not used from
|
||||
# _version.py.
|
||||
keywords = {}
|
||||
try:
|
||||
f = open(versionfile_abs, "r")
|
||||
for line in f.readlines():
|
||||
if line.strip().startswith("git_refnames ="):
|
||||
mo = re.search(r'=\s*"(.*)"', line)
|
||||
if mo:
|
||||
keywords["refnames"] = mo.group(1)
|
||||
if line.strip().startswith("git_full ="):
|
||||
mo = re.search(r'=\s*"(.*)"', line)
|
||||
if mo:
|
||||
keywords["full"] = mo.group(1)
|
||||
f.close()
|
||||
except EnvironmentError:
|
||||
pass
|
||||
return keywords
|
||||
|
||||
|
||||
@register_vcs_handler("git", "keywords")
|
||||
def git_versions_from_keywords(keywords, tag_prefix, verbose):
|
||||
"""Get version information from git keywords."""
|
||||
if not keywords:
|
||||
raise NotThisMethod("no keywords at all, weird")
|
||||
refnames = keywords["refnames"].strip()
|
||||
if refnames.startswith("$Format"):
|
||||
if verbose:
|
||||
print("keywords are unexpanded, not using")
|
||||
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
|
||||
refs = set([r.strip() for r in refnames.strip("()").split(",")])
|
||||
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
|
||||
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
|
||||
TAG = "tag: "
|
||||
tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])
|
||||
if not tags:
|
||||
# Either we're using git < 1.8.3, or there really are no tags. We use
|
||||
# a heuristic: assume all version tags have a digit. The old git %d
|
||||
# expansion behaves like git log --decorate=short and strips out the
|
||||
# refs/heads/ and refs/tags/ prefixes that would let us distinguish
|
||||
# between branches and tags. By ignoring refnames without digits, we
|
||||
# filter out many common branch names like "release" and
|
||||
# "stabilization", as well as "HEAD" and "master".
|
||||
tags = set([r for r in refs if re.search(r'\d', r)])
|
||||
if verbose:
|
||||
print("discarding '%s', no digits" % ",".join(refs-tags))
|
||||
|
||||
branches = [r for r in refs if not r.startswith(TAG)
|
||||
and r != "HEAD" and not r.startswith("refs/")]
|
||||
if verbose:
|
||||
print("likely branches: %s" % ",".join(sorted(branches)))
|
||||
branch = None
|
||||
if branches:
|
||||
branch = branches[0]
|
||||
|
||||
if verbose:
|
||||
print("likely tags: %s" % ",".join(sorted(tags)))
|
||||
for ref in sorted(tags):
|
||||
# sorting will prefer e.g. "2.0" over "2.0rc1"
|
||||
if ref.startswith(tag_prefix):
|
||||
r = ref[len(tag_prefix):]
|
||||
if verbose:
|
||||
print("picking %s" % r)
|
||||
|
||||
result = {"version": r,
|
||||
"full-revisionid": keywords["full"].strip(),
|
||||
"dirty": False, "error": None}
|
||||
if branch is not None:
|
||||
result["branch"] = branch
|
||||
return result
|
||||
# no suitable tags, so version is "0+unknown", but full hex is still there
|
||||
if verbose:
|
||||
print("no suitable tags, using unknown + full revision id")
|
||||
return {"version": "0+unknown",
|
||||
"full-revisionid": keywords["full"].strip(),
|
||||
"dirty": False, "error": "no suitable tags"}
|
||||
|
||||
|
||||
@register_vcs_handler("git", "pieces_from_vcs")
|
||||
def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
|
||||
"""Get version from 'git describe' in the root of the source tree.
|
||||
|
||||
This only gets called if the git-archive 'subst' keywords were *not*
|
||||
expanded, and _version.py hasn't already been rewritten with a short
|
||||
version string, meaning we're inside a checked out source tree.
|
||||
"""
|
||||
if not os.path.exists(os.path.join(root, ".git")):
|
||||
if verbose:
|
||||
print("no .git in %s" % root)
|
||||
raise NotThisMethod("no .git directory")
|
||||
|
||||
GITS = ["git"]
|
||||
if sys.platform == "win32":
|
||||
GITS = ["git.cmd", "git.exe"]
|
||||
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
|
||||
# if there isn't one, this yields HEX[-dirty] (no NUM)
|
||||
describe_out = run_command(GITS, ["describe", "--tags", "--dirty",
|
||||
"--always", "--long",
|
||||
"--match", "%s*" % tag_prefix],
|
||||
cwd=root)
|
||||
# --long was added in git-1.5.5
|
||||
if describe_out is None:
|
||||
raise NotThisMethod("'git describe' failed")
|
||||
describe_out = describe_out.strip()
|
||||
full_out = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
|
||||
if full_out is None:
|
||||
raise NotThisMethod("'git rev-parse' failed")
|
||||
full_out = full_out.strip()
|
||||
|
||||
pieces = {}
|
||||
pieces["long"] = full_out
|
||||
pieces["short"] = full_out[:7] # maybe improved later
|
||||
pieces["error"] = None
|
||||
|
||||
# parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]
|
||||
# TAG might have hyphens.
|
||||
git_describe = describe_out
|
||||
|
||||
# look for -dirty suffix
|
||||
dirty = git_describe.endswith("-dirty")
|
||||
pieces["dirty"] = dirty
|
||||
if dirty:
|
||||
git_describe = git_describe[:git_describe.rindex("-dirty")]
|
||||
|
||||
# figure out our branch
|
||||
abbrev_ref_out = run_command(GITS,
|
||||
["rev-parse", "--abbrev-ref", "HEAD"],
|
||||
cwd=root)
|
||||
if abbrev_ref_out is not None:
|
||||
pieces["branch"] = abbrev_ref_out.strip()
|
||||
|
||||
# now we have TAG-NUM-gHEX or HEX
|
||||
|
||||
if "-" in git_describe:
|
||||
# TAG-NUM-gHEX
|
||||
mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
|
||||
if not mo:
|
||||
# unparseable. Maybe git-describe is misbehaving?
|
||||
pieces["error"] = ("unable to parse git-describe output: '%s'"
|
||||
% describe_out)
|
||||
return pieces
|
||||
|
||||
# tag
|
||||
full_tag = mo.group(1)
|
||||
if not full_tag.startswith(tag_prefix):
|
||||
if verbose:
|
||||
fmt = "tag '%s' doesn't start with prefix '%s'"
|
||||
print(fmt % (full_tag, tag_prefix))
|
||||
pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
|
||||
% (full_tag, tag_prefix))
|
||||
return pieces
|
||||
pieces["closest-tag"] = full_tag[len(tag_prefix):]
|
||||
|
||||
# distance: number of commits since tag
|
||||
pieces["distance"] = int(mo.group(2))
|
||||
|
||||
# commit: short hex revision ID
|
||||
pieces["short"] = mo.group(3)
|
||||
|
||||
else:
|
||||
# HEX: no tags
|
||||
pieces["closest-tag"] = None
|
||||
count_out = run_command(GITS, ["rev-list", "HEAD", "--count"],
|
||||
cwd=root)
|
||||
pieces["distance"] = int(count_out) # total number of commits
|
||||
|
||||
return pieces
|
||||
|
||||
|
||||
@register_vcs_handler("git", "parse_lookup_file")
|
||||
def git_parse_lookup_file(path):
|
||||
"""Parse a versioneer lookup file.
|
||||
|
||||
This file allows definition of branch specific data like virtual tags or
|
||||
custom styles to use for version rendering.
|
||||
"""
|
||||
if not os.path.exists(path):
|
||||
return []
|
||||
|
||||
import re
|
||||
lookup = []
|
||||
with open(path, "r") as f:
|
||||
for line in f:
|
||||
if '#' in line:
|
||||
line = line[:line.rindex("#")]
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
|
||||
try:
|
||||
split_line = map(lambda x: x.strip(), line.split())
|
||||
if not len(split_line):
|
||||
continue
|
||||
|
||||
matcher = re.compile(split_line[0])
|
||||
|
||||
if len(split_line) == 1:
|
||||
entry = [matcher, None, None, None]
|
||||
elif len(split_line) == 2:
|
||||
render = split_line[1]
|
||||
entry = [matcher, render, None, None]
|
||||
elif len(split_line) == 3:
|
||||
tag, ref_commit = split_line[1:]
|
||||
entry = [matcher, None, tag, ref_commit]
|
||||
elif len(split_line) == 4:
|
||||
tag, ref_commit, render = split_line[1:]
|
||||
entry = [matcher, render, tag, ref_commit]
|
||||
else:
|
||||
continue
|
||||
|
||||
lookup.append(entry)
|
||||
except:
|
||||
break
|
||||
return lookup
|
||||
|
||||
|
||||
@register_vcs_handler("git", "pieces_from_lookup")
|
||||
def git_pieces_from_lookup(lookup, root, verbose, run_command=run_command):
|
||||
"""Extract version information based on provided lookup data."""
|
||||
GITS = ["git"]
|
||||
if sys.platform == "win32":
|
||||
GITS = ["git.cmd", "git.exe"]
|
||||
|
||||
stdout = run_command(GITS, ["rev-parse", "--abbrev-ref", "HEAD"],
|
||||
cwd=root)
|
||||
if stdout is None:
|
||||
raise NotThisMethod("git rev-parse --abbrev-ref HEAD failed")
|
||||
|
||||
current_branch = stdout.strip()
|
||||
for matcher, render, tag, ref_commit in lookup:
|
||||
if matcher.match(current_branch):
|
||||
if tag is None or ref_commit is None:
|
||||
raise NotThisMethod("tag or ref_commit is unset for "
|
||||
"this branch")
|
||||
|
||||
stdout = run_command(GITS,
|
||||
["rev-list", "%s..HEAD" % ref_commit,
|
||||
"--count"],
|
||||
cwd=root)
|
||||
if stdout is None:
|
||||
raise NotThisMethod("git rev-list %s..HEAD "
|
||||
"--count failed" % ref_commit)
|
||||
try:
|
||||
num_commits = int(stdout.strip())
|
||||
except ValueError:
|
||||
raise NotThisMethod("git rev-list %s..HEAD --count didn't "
|
||||
"return a valid number" % ref_commit)
|
||||
|
||||
stdout = run_command(GITS,
|
||||
["rev-parse", "--short", "HEAD"],
|
||||
cwd=root)
|
||||
if stdout is None:
|
||||
raise NotThisMethod("git describe rev-parse "
|
||||
"--short HEAD failed")
|
||||
short_hash = stdout.strip()
|
||||
|
||||
stdout = run_command(GITS,
|
||||
["describe", "--tags",
|
||||
"--dirty", "--always"],
|
||||
cwd=root)
|
||||
if stdout is None:
|
||||
raise NotThisMethod("git describe --tags --dirty "
|
||||
"--always failed")
|
||||
dirty = stdout.strip().endswith("-dirty")
|
||||
|
||||
stdout = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
|
||||
if stdout is None:
|
||||
raise NotThisMethod("git rev-parse HEAD failed")
|
||||
full = stdout.strip()
|
||||
|
||||
return {
|
||||
"long": full,
|
||||
"short": short_hash,
|
||||
"dirty": dirty,
|
||||
"branch": current_branch,
|
||||
"closest-tag": tag,
|
||||
"distance": num_commits,
|
||||
"error": None,
|
||||
"render": render
|
||||
}
|
||||
|
||||
raise NotThisMethod("no matching lookup definition found")
|
||||
|
||||
|
||||
def plus_or_dot(pieces):
|
||||
"""Return a + if we don't already have one, else return a ."""
|
||||
if "+" in pieces.get("closest-tag", ""):
|
||||
return "."
|
||||
return "+"
|
||||
|
||||
|
||||
def render_pep440(pieces):
|
||||
"""Build up version string, with post-release "local version identifier".
|
||||
|
||||
Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
|
||||
get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
|
||||
|
||||
Exceptions:
|
||||
1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
|
||||
"""
|
||||
if pieces["closest-tag"]:
|
||||
rendered = pieces["closest-tag"]
|
||||
if pieces["distance"] or pieces["dirty"]:
|
||||
rendered += plus_or_dot(pieces)
|
||||
rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
|
||||
if pieces["dirty"]:
|
||||
rendered += ".dirty"
|
||||
else:
|
||||
# exception #1
|
||||
rendered = "0+untagged.%d.g%s" % (pieces["distance"],
|
||||
pieces["short"])
|
||||
if pieces["dirty"]:
|
||||
rendered += ".dirty"
|
||||
return rendered
|
||||
|
||||
|
||||
def render_pep440_pre(pieces):
|
||||
"""TAG[.post.devDISTANCE] -- No -dirty.
|
||||
|
||||
Exceptions:
|
||||
1: no tags. 0.post.devDISTANCE
|
||||
"""
|
||||
if pieces["closest-tag"]:
|
||||
rendered = pieces["closest-tag"]
|
||||
if pieces["distance"]:
|
||||
rendered += ".post.dev%d" % pieces["distance"]
|
||||
else:
|
||||
# exception #1
|
||||
rendered = "0.post.dev%d" % pieces["distance"]
|
||||
return rendered
|
||||
|
||||
|
||||
def render_pep440_post(pieces):
|
||||
"""TAG[.postDISTANCE[.dev0]+gHEX] .
|
||||
|
||||
The ".dev0" means dirty. Note that .dev0 sorts backwards
|
||||
(a dirty tree will appear "older" than the corresponding clean one),
|
||||
but you shouldn't be releasing software with -dirty anyways.
|
||||
|
||||
Exceptions:
|
||||
1: no tags. 0.postDISTANCE[.dev0]
|
||||
"""
|
||||
if pieces["closest-tag"]:
|
||||
rendered = pieces["closest-tag"]
|
||||
if pieces["distance"] or pieces["dirty"]:
|
||||
rendered += ".post%d" % pieces["distance"]
|
||||
if pieces["dirty"]:
|
||||
rendered += ".dev0"
|
||||
rendered += plus_or_dot(pieces)
|
||||
rendered += "g%s" % pieces["short"]
|
||||
else:
|
||||
# exception #1
|
||||
rendered = "0.post%d" % pieces["distance"]
|
||||
if pieces["dirty"]:
|
||||
rendered += ".dev0"
|
||||
rendered += "+g%s" % pieces["short"]
|
||||
return rendered
|
||||
|
||||
|
||||
def render_pep440_dev(pieces):
|
||||
"""TAG[.devDISTANCE]+gHEX[.dirty] .
|
||||
|
||||
Exceptions:
|
||||
1: no tags. 0.devDISTANCE+gHEX[.dirty]
|
||||
"""
|
||||
if pieces["closest-tag"]:
|
||||
rendered = pieces["closest-tag"]
|
||||
if pieces["distance"]:
|
||||
rendered += ".dev%d" % pieces["distance"]
|
||||
rendered += plus_or_dot(pieces)
|
||||
else:
|
||||
# exception #1
|
||||
rendered = "0.dev%d" % pieces["distance"]
|
||||
rendered += "+"
|
||||
rendered += "g%s" % pieces["short"]
|
||||
if pieces["dirty"]:
|
||||
rendered += ".dirty"
|
||||
return rendered
|
||||
|
||||
|
||||
def render_pep440_old(pieces):
|
||||
"""TAG[.postDISTANCE[.dev0]] .
|
||||
|
||||
The ".dev0" means dirty.
|
||||
|
||||
Eexceptions:
|
||||
1: no tags. 0.postDISTANCE[.dev0]
|
||||
"""
|
||||
if pieces["closest-tag"]:
|
||||
rendered = pieces["closest-tag"]
|
||||
if pieces["distance"] or pieces["dirty"]:
|
||||
rendered += ".post%d" % pieces["distance"]
|
||||
if pieces["dirty"]:
|
||||
rendered += ".dev0"
|
||||
else:
|
||||
# exception #1
|
||||
rendered = "0.post%d" % pieces["distance"]
|
||||
if pieces["dirty"]:
|
||||
rendered += ".dev0"
|
||||
return rendered
|
||||
|
||||
|
||||
def render_git_describe(pieces):
|
||||
"""TAG[-DISTANCE-gHEX][-dirty].
|
||||
|
||||
Like 'git describe --tags --dirty --always'.
|
||||
|
||||
Exceptions:
|
||||
1: no tags. HEX[-dirty] (note: no 'g' prefix)
|
||||
"""
|
||||
if pieces["closest-tag"]:
|
||||
rendered = pieces["closest-tag"]
|
||||
if pieces["distance"]:
|
||||
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
|
||||
else:
|
||||
# exception #1
|
||||
rendered = pieces["short"]
|
||||
if pieces["dirty"]:
|
||||
rendered += "-dirty"
|
||||
return rendered
|
||||
|
||||
|
||||
def render_git_describe_long(pieces):
|
||||
"""TAG-DISTANCE-gHEX[-dirty].
|
||||
|
||||
Like 'git describe --tags --dirty --always -long'.
|
||||
The distance/hash is unconditional.
|
||||
|
||||
Exceptions:
|
||||
1: no tags. HEX[-dirty] (note: no 'g' prefix)
|
||||
"""
|
||||
if pieces["closest-tag"]:
|
||||
rendered = pieces["closest-tag"]
|
||||
rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
|
||||
else:
|
||||
# exception #1
|
||||
rendered = pieces["short"]
|
||||
if pieces["dirty"]:
|
||||
rendered += "-dirty"
|
||||
return rendered
|
||||
|
||||
|
||||
def render(pieces, style):
|
||||
"""Render the given version pieces into the requested style."""
|
||||
if pieces["error"]:
|
||||
return {"version": "unknown",
|
||||
"full-revisionid": pieces.get("long"),
|
||||
"dirty": None,
|
||||
"error": pieces["error"]}
|
||||
|
||||
if "render" in pieces and pieces["render"] is not None:
|
||||
style = pieces["render"]
|
||||
|
||||
if not style or style == "default":
|
||||
style = "pep440" # the default
|
||||
|
||||
if style == "pep440":
|
||||
rendered = render_pep440(pieces)
|
||||
elif style == "pep440-pre":
|
||||
rendered = render_pep440_pre(pieces)
|
||||
elif style == "pep440-post":
|
||||
rendered = render_pep440_post(pieces)
|
||||
elif style == "pep440-old":
|
||||
rendered = render_pep440_old(pieces)
|
||||
elif style == "pep440-dev":
|
||||
rendered = render_pep440_dev(pieces)
|
||||
elif style == "git-describe":
|
||||
rendered = render_git_describe(pieces)
|
||||
elif style == "git-describe-long":
|
||||
rendered = render_git_describe_long(pieces)
|
||||
else:
|
||||
raise ValueError("unknown style '%s'" % style)
|
||||
|
||||
result = {"version": rendered, "full-revisionid": pieces["long"],
|
||||
"dirty": pieces["dirty"], "error": None}
|
||||
if "branch" in pieces and pieces["branch"] is not None:
|
||||
result["branch"] = pieces["branch"]
|
||||
return result
|
||||
|
||||
|
||||
def get_versions():
|
||||
"""Get version information or return default if unable to do so."""
|
||||
# I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
|
||||
# __file__, we can work backwards from there to the root. Some
|
||||
# py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
|
||||
# case we can only use expanded keywords.
|
||||
|
||||
cfg = get_config()
|
||||
verbose = cfg.verbose
|
||||
|
||||
try:
|
||||
return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,
|
||||
verbose)
|
||||
except NotThisMethod:
|
||||
pass
|
||||
|
||||
try:
|
||||
root = os.path.realpath(__file__)
|
||||
# versionfile_source is the relative path from the top of the source
|
||||
# tree (where the .git directory might live) to this file. Invert
|
||||
# this to find the root from __file__.
|
||||
for i in cfg.versionfile_source.split('/'):
|
||||
root = os.path.dirname(root)
|
||||
except NameError:
|
||||
return {"version": "0+unknown", "full-revisionid": None,
|
||||
"dirty": None,
|
||||
"error": "unable to find root of source tree"}
|
||||
|
||||
lookupfile = cfg.lookupfile if cfg.lookupfile is not None else ".versioneer-lookup"
|
||||
lookuppath = os.path.join(root, lookupfile)
|
||||
if os.path.exists(lookuppath):
|
||||
try:
|
||||
lookup_data = git_parse_lookup_file(lookuppath)
|
||||
pieces = git_pieces_from_lookup(lookup_data, root, verbose)
|
||||
return render(pieces, cfg.style)
|
||||
except NotThisMethod:
|
||||
pass
|
||||
|
||||
try:
|
||||
pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
|
||||
return render(pieces, cfg.style)
|
||||
except NotThisMethod:
|
||||
pass
|
||||
|
||||
try:
|
||||
if cfg.parentdir_prefix:
|
||||
return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
|
||||
except NotThisMethod:
|
||||
pass
|
||||
|
||||
return {"version": "0+unknown", "full-revisionid": None,
|
||||
"dirty": None,
|
||||
"error": "unable to compute version"}
|
||||
@@ -4,7 +4,7 @@ Generic linux daemon base class for python 3.x
|
||||
Originally from http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/#c35
|
||||
"""
|
||||
|
||||
import sys, os, time, atexit, signal
|
||||
import sys, os, time, signal
|
||||
|
||||
class Daemon:
|
||||
"""A generic daemon class.
|
||||
@@ -12,35 +12,35 @@ class Daemon:
|
||||
Usage: subclass the daemon class and override the run() method."""
|
||||
|
||||
def __init__(self, pidfile): self.pidfile = pidfile
|
||||
|
||||
|
||||
def daemonize(self):
|
||||
"""Deamonize class. UNIX double fork mechanism."""
|
||||
|
||||
try:
|
||||
pid = os.fork()
|
||||
try:
|
||||
pid = os.fork()
|
||||
if pid > 0:
|
||||
# exit first parent
|
||||
sys.exit(0)
|
||||
except OSError as err:
|
||||
sys.exit(0)
|
||||
except OSError as err:
|
||||
sys.stderr.write('fork #1 failed: {0}\n'.format(err))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# decouple from parent environment
|
||||
os.chdir('/')
|
||||
os.setsid()
|
||||
os.chdir('/')
|
||||
os.setsid()
|
||||
os.umask(002)
|
||||
|
||||
|
||||
# do second fork
|
||||
try:
|
||||
pid = os.fork()
|
||||
try:
|
||||
pid = os.fork()
|
||||
if pid > 0:
|
||||
|
||||
# exit from second parent
|
||||
sys.exit(0)
|
||||
except OSError as err:
|
||||
sys.exit(0)
|
||||
except OSError as err:
|
||||
sys.stderr.write('fork #2 failed: {0}\n'.format(err))
|
||||
sys.exit(1)
|
||||
|
||||
sys.exit(1)
|
||||
|
||||
# redirect standard file descriptors
|
||||
sys.stdout.flush()
|
||||
sys.stderr.flush()
|
||||
@@ -51,16 +51,14 @@ class Daemon:
|
||||
os.dup2(si.fileno(), sys.stdin.fileno())
|
||||
os.dup2(so.fileno(), sys.stdout.fileno())
|
||||
os.dup2(se.fileno(), sys.stderr.fileno())
|
||||
|
||||
# write pidfile
|
||||
atexit.register(self.delpid)
|
||||
|
||||
# write pidfile
|
||||
pid = str(os.getpid())
|
||||
with open(self.pidfile,'w+') as f:
|
||||
f.write(pid + '\n')
|
||||
|
||||
def delpid(self):
|
||||
os.remove(self.pidfile)
|
||||
|
||||
def terminated(self):
|
||||
self.remove_pidfile()
|
||||
|
||||
def start(self):
|
||||
"""Start the daemon."""
|
||||
@@ -72,13 +70,13 @@ class Daemon:
|
||||
pid = int(pf.read().strip())
|
||||
except IOError:
|
||||
pid = None
|
||||
|
||||
|
||||
if pid:
|
||||
message = "pidfile {0} already exist. " + \
|
||||
"Daemon already running?\n"
|
||||
sys.stderr.write(message.format(self.pidfile))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
# Start the daemon
|
||||
self.daemonize()
|
||||
self.run()
|
||||
@@ -92,14 +90,14 @@ class Daemon:
|
||||
pid = int(pf.read().strip())
|
||||
except IOError:
|
||||
pid = None
|
||||
|
||||
|
||||
if not pid:
|
||||
message = "pidfile {0} does not exist. " + \
|
||||
"Daemon not running?\n"
|
||||
sys.stderr.write(message.format(self.pidfile))
|
||||
return # not an error in a restart
|
||||
|
||||
# Try killing the daemon process
|
||||
# Try killing the daemon process
|
||||
try:
|
||||
while 1:
|
||||
os.kill(pid, signal.SIGTERM)
|
||||
@@ -120,7 +118,11 @@ class Daemon:
|
||||
|
||||
def run(self):
|
||||
"""You should override this method when you subclass Daemon.
|
||||
|
||||
It will be called after the process has been daemonized by
|
||||
|
||||
It will be called after the process has been daemonized by
|
||||
start() or restart()."""
|
||||
|
||||
def remove_pidfile(self):
|
||||
"""Removes the pidfile."""
|
||||
if os.path.isfile(self.pidfile):
|
||||
os.remove(self.pidfile)
|
||||
@@ -1,55 +1,145 @@
|
||||
# coding=utf-8
|
||||
from __future__ import (print_function, absolute_import)
|
||||
|
||||
__author__ = "Lars Norpchen"
|
||||
__author__ = "Gina Häußge <osd@foosel.net>"
|
||||
__author__ = "Gina Häußge <osd@foosel.net>, Lars Norpchen"
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import subprocess
|
||||
import Queue
|
||||
import threading
|
||||
import collections
|
||||
|
||||
from octoprint.settings import settings
|
||||
import octoprint.plugin
|
||||
|
||||
# singleton
|
||||
_instance = None
|
||||
|
||||
|
||||
def all_events():
|
||||
return [getattr(Events, name) for name in Events.__dict__ if not name.startswith("__")]
|
||||
|
||||
|
||||
class Events(object):
|
||||
# application startup
|
||||
STARTUP = "Startup"
|
||||
|
||||
# connect/disconnect to printer
|
||||
CONNECTED = "Connected"
|
||||
DISCONNECTED = "Disconnected"
|
||||
|
||||
# connect/disconnect by client
|
||||
CLIENT_OPENED = "ClientOpened"
|
||||
CLIENT_CLOSED = "ClientClosed"
|
||||
|
||||
# File management
|
||||
UPLOAD = "Upload"
|
||||
FILE_SELECTED = "FileSelected"
|
||||
FILE_DESELECTED = "FileDeselected"
|
||||
UPDATED_FILES = "UpdatedFiles"
|
||||
METADATA_ANALYSIS_STARTED = "MetadataAnalysisStarted"
|
||||
METADATA_ANALYSIS_FINISHED = "MetadataAnalysisFinished"
|
||||
METADATA_STATISTICS_UPDATED = "MetadataStatisticsUpdated"
|
||||
|
||||
# SD Upload
|
||||
TRANSFER_STARTED = "TransferStarted"
|
||||
TRANSFER_DONE = "TransferDone"
|
||||
|
||||
# print job
|
||||
PRINT_STARTED = "PrintStarted"
|
||||
PRINT_DONE = "PrintDone"
|
||||
PRINT_FAILED = "PrintFailed"
|
||||
PRINT_CANCELLED = "PrintCancelled"
|
||||
PRINT_PAUSED = "PrintPaused"
|
||||
PRINT_RESUMED = "PrintResumed"
|
||||
ERROR = "Error"
|
||||
|
||||
# print/gcode events
|
||||
POWER_ON = "PowerOn"
|
||||
POWER_OFF = "PowerOff"
|
||||
HOME = "Home"
|
||||
Z_CHANGE = "ZChange"
|
||||
WAITING = "Waiting"
|
||||
DWELL = "Dwelling"
|
||||
COOLING = "Cooling"
|
||||
ALERT = "Alert"
|
||||
CONVEYOR = "Conveyor"
|
||||
EJECT = "Eject"
|
||||
E_STOP = "EStop"
|
||||
REGISTERED_MESSAGE_RECEIVED = "RegisteredMessageReceived"
|
||||
|
||||
# Timelapse
|
||||
CAPTURE_START = "CaptureStart"
|
||||
CAPTURE_DONE = "CaptureDone"
|
||||
CAPTURE_FAILED = "CaptureFailed"
|
||||
POSTROLL_START = "PostRollStart"
|
||||
POSTROLL_END = "PostRollEnd"
|
||||
MOVIE_RENDERING = "MovieRendering"
|
||||
MOVIE_DONE = "MovieDone"
|
||||
MOVIE_FAILED = "MovieFailed"
|
||||
|
||||
# Slicing
|
||||
SLICING_STARTED = "SlicingStarted"
|
||||
SLICING_DONE = "SlicingDone"
|
||||
SLICING_FAILED = "SlicingFailed"
|
||||
SLICING_CANCELLED = "SlicingCancelled"
|
||||
SLICING_PROFILE_ADDED = "SlicingProfileAdded"
|
||||
SLICING_PROFILE_MODIFIED = "SlicingProfileModified"
|
||||
SLICING_PROFILE_DELETED = "SlicingProfileDeleted"
|
||||
|
||||
# Printer Profiles
|
||||
PRINTER_PROFILE_ADDED = "PrinterProfileAdded"
|
||||
PRINTER_PROFILE_MODIFIED = "PrinterProfileModified"
|
||||
PRINTER_PROFILE_DELETED = "PrinterProfileDeleted"
|
||||
|
||||
# Settings
|
||||
SETTINGS_UPDATED = "SettingsUpdated"
|
||||
|
||||
|
||||
def eventManager():
|
||||
global _instance
|
||||
if _instance is None:
|
||||
_instance = EventManager()
|
||||
return _instance
|
||||
|
||||
|
||||
class EventManager(object):
|
||||
"""
|
||||
Handles receiving events and dispatching them to subscribers
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self._registeredListeners = {}
|
||||
self._registeredListeners = collections.defaultdict(list)
|
||||
self._logger = logging.getLogger(__name__)
|
||||
|
||||
self._queue = Queue.PriorityQueue()
|
||||
self._queue = Queue.Queue()
|
||||
self._worker = threading.Thread(target=self._work)
|
||||
self._worker.daemon = True
|
||||
self._worker.start()
|
||||
|
||||
def _work(self):
|
||||
while True:
|
||||
(event, payload) = self._queue.get(True)
|
||||
try:
|
||||
while True:
|
||||
event, payload = self._queue.get(True)
|
||||
|
||||
eventListeners = self._registeredListeners.get(event, None)
|
||||
if eventListeners is None:
|
||||
return
|
||||
self._logger.debug("Firing event: %s (Payload: %r)" % (event, payload))
|
||||
eventListeners = self._registeredListeners[event]
|
||||
self._logger.debug("Firing event: %s (Payload: %r)" % (event, payload))
|
||||
|
||||
for listener in eventListeners:
|
||||
self._logger.debug("Sending action to %r" % listener)
|
||||
try:
|
||||
listener(event, payload)
|
||||
except:
|
||||
self._logger.exception("Got an exception while sending event %s (Payload: %r) to %s" % (event, payload, listener))
|
||||
for listener in eventListeners:
|
||||
self._logger.debug("Sending action to %r" % listener)
|
||||
try:
|
||||
listener(event, payload)
|
||||
except:
|
||||
self._logger.exception("Got an exception while sending event %s (Payload: %r) to %s" % (event, payload, listener))
|
||||
|
||||
octoprint.plugin.call_plugin(octoprint.plugin.types.EventHandlerPlugin,
|
||||
"on_event",
|
||||
args=[event, payload])
|
||||
except:
|
||||
self._logger.exception("Ooops, the event bus worker loop crashed")
|
||||
|
||||
def fire(self, event, payload=None):
|
||||
"""
|
||||
@@ -62,18 +152,21 @@ class EventManager(object):
|
||||
payload being a payload object specific to the event.
|
||||
"""
|
||||
|
||||
if not event in self._registeredListeners.keys():
|
||||
return
|
||||
self._queue.put((event, payload), 0)
|
||||
self._queue.put((event, payload))
|
||||
|
||||
if event == Events.UPDATED_FILES and "type" in payload and payload["type"] == "printables":
|
||||
# when sending UpdatedFiles with type "printables", also send another event with deprecated type "gcode"
|
||||
# TODO v1.3.0 Remove again
|
||||
import copy
|
||||
legacy_payload = copy.deepcopy(payload)
|
||||
legacy_payload["type"] = "gcode"
|
||||
self._queue.put((event, legacy_payload))
|
||||
|
||||
def subscribe(self, event, callback):
|
||||
"""
|
||||
Subscribe a listener to an event -- pass in the event name (as a string) and the callback object
|
||||
"""
|
||||
|
||||
if not event in self._registeredListeners.keys():
|
||||
self._registeredListeners[event] = []
|
||||
|
||||
if callback in self._registeredListeners[event]:
|
||||
# callback is already subscribed to the event
|
||||
return
|
||||
@@ -86,10 +179,6 @@ class EventManager(object):
|
||||
Unsubscribe a listener from an event -- pass in the event name (as string) and the callback object
|
||||
"""
|
||||
|
||||
if not event in self._registeredListeners:
|
||||
# no callback registered for callback, just return
|
||||
return
|
||||
|
||||
if not callback in self._registeredListeners[event]:
|
||||
# callback not subscribed to event, just return
|
||||
return
|
||||
@@ -97,6 +186,7 @@ class EventManager(object):
|
||||
self._registeredListeners[event].remove(callback)
|
||||
self._logger.debug("Unsubscribed listener %r for event %s" % (callback, event))
|
||||
|
||||
|
||||
class GenericEventListener(object):
|
||||
"""
|
||||
The GenericEventListener can be subclassed to easily create custom event listeners.
|
||||
@@ -128,51 +218,57 @@ class GenericEventListener(object):
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class DebugEventListener(GenericEventListener):
|
||||
def __init__(self):
|
||||
GenericEventListener.__init__(self)
|
||||
|
||||
events = ["Startup", "Connected", "Disconnected", "ClientOpen", "ClientClosed", "PowerOn", "PowerOff", "Upload",
|
||||
"FileSelected", "TransferStarted", "TransferDone", "PrintStarted", "PrintDone", "PrintFailed",
|
||||
"Cancelled", "Home", "ZChange", "Paused", "Waiting", "Cooling", "Alert", "Conveyor", "Eject",
|
||||
"CaptureStart", "CaptureDone", "MovieDone", "EStop", "Error"]
|
||||
events = filter(lambda x: not x.startswith("__"), dir(Events))
|
||||
self.subscribe(events)
|
||||
|
||||
def eventCallback(self, event, payload):
|
||||
GenericEventListener.eventCallback(self, event, payload)
|
||||
self._logger.debug("Received event: %s (Payload: %r)" % (event, payload))
|
||||
|
||||
|
||||
class CommandTrigger(GenericEventListener):
|
||||
def __init__(self, triggerType, printer):
|
||||
def __init__(self, printer):
|
||||
GenericEventListener.__init__(self)
|
||||
self._printer = printer
|
||||
self._subscriptions = {}
|
||||
|
||||
self._initSubscriptions(triggerType)
|
||||
self._initSubscriptions()
|
||||
|
||||
def _initSubscriptions(self, triggerType):
|
||||
def _initSubscriptions(self):
|
||||
"""
|
||||
Subscribes all events as defined in "events > $triggerType > subscriptions" in the settings with their
|
||||
respective commands.
|
||||
"""
|
||||
if not settings().get(["events", triggerType]):
|
||||
if not settings().get(["events"]):
|
||||
return
|
||||
|
||||
if not settings().getBoolean(["events", triggerType, "enabled"]):
|
||||
if not settings().getBoolean(["events", "enabled"]):
|
||||
return
|
||||
|
||||
eventsToSubscribe = []
|
||||
for subscription in settings().get(["events", triggerType, "subscriptions"]):
|
||||
if not "event" in subscription.keys() or not "command" in subscription.keys():
|
||||
self._logger.info("Invalid %s, missing either event or command: %r" % (triggerType, subscription))
|
||||
for subscription in settings().get(["events", "subscriptions"]):
|
||||
if not "event" in subscription.keys() or not "command" in subscription.keys() \
|
||||
or not "type" in subscription.keys() or not subscription["type"] in ["system", "gcode"]:
|
||||
self._logger.info("Invalid command trigger, missing either event, type or command or type is invalid: %r" % subscription)
|
||||
continue
|
||||
|
||||
if "enabled" in subscription.keys() and not subscription["enabled"]:
|
||||
self._logger.info("Disabled command trigger: %r" % subscription)
|
||||
continue
|
||||
|
||||
event = subscription["event"]
|
||||
command = subscription["command"]
|
||||
commandType = subscription["type"]
|
||||
debug = subscription["debug"] if "debug" in subscription else False
|
||||
|
||||
if not event in self._subscriptions.keys():
|
||||
self._subscriptions[event] = []
|
||||
self._subscriptions[event].append(command)
|
||||
self._subscriptions[event].append((command, commandType, debug))
|
||||
|
||||
if not event in eventsToSubscribe:
|
||||
eventsToSubscribe.append(event)
|
||||
@@ -190,15 +286,51 @@ class CommandTrigger(GenericEventListener):
|
||||
if not event in self._subscriptions:
|
||||
return
|
||||
|
||||
for command in self._subscriptions[event]:
|
||||
processedCommand = self._processCommand(command, payload)
|
||||
self.executeCommand(processedCommand)
|
||||
for command, commandType, debug in self._subscriptions[event]:
|
||||
try:
|
||||
if isinstance(command, (tuple, list, set)):
|
||||
processedCommand = []
|
||||
for c in command:
|
||||
processedCommand.append(self._processCommand(c, payload))
|
||||
else:
|
||||
processedCommand = self._processCommand(command, payload)
|
||||
self.executeCommand(processedCommand, commandType, debug=debug)
|
||||
except KeyError, e:
|
||||
self._logger.warn("There was an error processing one or more placeholders in the following command: %s" % command)
|
||||
|
||||
def executeCommand(self, command):
|
||||
"""
|
||||
Not implemented, override in child classes
|
||||
"""
|
||||
pass
|
||||
def executeCommand(self, command, commandType, debug=False):
|
||||
if commandType == "system":
|
||||
self._executeSystemCommand(command, debug=debug)
|
||||
elif commandType == "gcode":
|
||||
self._executeGcodeCommand(command, debug=debug)
|
||||
|
||||
def _executeSystemCommand(self, command, debug=False):
|
||||
def commandExecutioner(command):
|
||||
if debug:
|
||||
self._logger.info("Executing system command: %s" % command)
|
||||
# we run this with shell=True since we have to trust whatever
|
||||
# our admin configured as command and since we want to allow
|
||||
# shell-alike handling here...
|
||||
subprocess.Popen(command, shell=True)
|
||||
|
||||
try:
|
||||
if isinstance(command, (list, tuple, set)):
|
||||
for c in command:
|
||||
commandExecutioner(c)
|
||||
else:
|
||||
commandExecutioner(command)
|
||||
except subprocess.CalledProcessError, e:
|
||||
self._logger.warn("Command failed with return code %i: %s" % (e.returncode, str(e)))
|
||||
except:
|
||||
self._logger.exception("Command failed")
|
||||
|
||||
def _executeGcodeCommand(self, command, debug=False):
|
||||
commands = [command]
|
||||
if isinstance(command, (list, tuple, set)):
|
||||
commands = list(command)
|
||||
if debug:
|
||||
self._logger.info("Executing GCode commands: %r" % command)
|
||||
self._printer.commands(commands)
|
||||
|
||||
def _processCommand(self, command, payload):
|
||||
"""
|
||||
@@ -206,59 +338,36 @@ class CommandTrigger(GenericEventListener):
|
||||
|
||||
The following substitutions are currently supported:
|
||||
|
||||
- %(currentZ)s : current Z position of the print head, or -1 if not available
|
||||
- %(filename)s : current selected filename, or "NO FILE" if no file is selected
|
||||
- %(progress)s : current print progress in percent, 0 if no print is in progress
|
||||
- %(data)s : the string representation of the event's payload
|
||||
- %(now)s : ISO 8601 representation of the current date and time
|
||||
- {__currentZ} : current Z position of the print head, or -1 if not available
|
||||
- {__filename} : current selected filename, or "NO FILE" if no file is selected
|
||||
- {__progress} : current print progress in percent, 0 if no print is in progress
|
||||
- {__data} : the string representation of the event's payload
|
||||
- {__now} : ISO 8601 representation of the current date and time
|
||||
|
||||
Additionally, the keys of the event's payload can also be used as placeholder.
|
||||
"""
|
||||
|
||||
params = {
|
||||
"currentZ": "-1",
|
||||
"filename": "NO FILE",
|
||||
"progress": "0",
|
||||
"data": str(payload),
|
||||
"now": datetime.datetime.now().isoformat()
|
||||
"__currentZ": "-1",
|
||||
"__filename": "NO FILE",
|
||||
"__progress": "0",
|
||||
"__data": str(payload),
|
||||
"__now": datetime.datetime.now().isoformat()
|
||||
}
|
||||
|
||||
currentData = self._printer.getCurrentData()
|
||||
currentData = self._printer.get_current_data()
|
||||
|
||||
if "currentZ" in currentData.keys() and currentData["currentZ"] is not None:
|
||||
params["currentZ"] = str(currentData["currentZ"])
|
||||
params["__currentZ"] = str(currentData["currentZ"])
|
||||
|
||||
if "job" in currentData.keys() and currentData["job"] is not None:
|
||||
params["filename"] = currentData["job"]["filename"]
|
||||
params["__filename"] = currentData["job"]["file"]["name"]
|
||||
if "progress" in currentData.keys() and currentData["progress"] is not None \
|
||||
and "progress" in currentData["progress"].keys() and currentData["progress"]["progress"] is not None:
|
||||
params["progress"] = str(round(currentData["progress"]["progress"] * 100))
|
||||
and "completion" in currentData["progress"].keys() and currentData["progress"]["completion"] is not None:
|
||||
params["__progress"] = str(round(currentData["progress"]["completion"] * 100))
|
||||
|
||||
return command % params
|
||||
# now add the payload keys as well
|
||||
if isinstance(payload, dict):
|
||||
params.update(payload)
|
||||
|
||||
class SystemCommandTrigger(CommandTrigger):
|
||||
"""
|
||||
Performs configured system commands for configured events.
|
||||
"""
|
||||
|
||||
def __init__(self, printer):
|
||||
CommandTrigger.__init__(self, "systemCommandTrigger", printer)
|
||||
|
||||
def executeCommand(self, command):
|
||||
try:
|
||||
self._logger.info("Executing system command: %s" % command)
|
||||
subprocess.Popen(command, shell=True)
|
||||
except subprocess.CalledProcessError, e:
|
||||
self._logger.warn("Command failed with return code %i: %s" % (e.returncode, e.message))
|
||||
except Exception, ex:
|
||||
self._logger.exception("Command failed")
|
||||
|
||||
class GcodeCommandTrigger(CommandTrigger):
|
||||
"""
|
||||
Sends configured GCODE commands to the printer for configured events.
|
||||
"""
|
||||
|
||||
def __init__(self, printer):
|
||||
CommandTrigger.__init__(self, "gcodeCommandTrigger", printer)
|
||||
|
||||
def executeCommand(self, command):
|
||||
self._logger.debug("Executing GCode command: %s" % command)
|
||||
self._printer.commands(command.split(","))
|
||||
return command.format(**params)
|
||||
@@ -0,0 +1,498 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
__author__ = "Gina Häußge <osd@foosel.net>"
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||
|
||||
import logging
|
||||
import os
|
||||
|
||||
import octoprint.plugin
|
||||
import octoprint.util
|
||||
|
||||
from octoprint.events import eventManager, Events
|
||||
|
||||
from .destinations import FileDestinations
|
||||
from .analysis import QueueEntry, AnalysisQueue
|
||||
from .storage import LocalFileStorage
|
||||
from .util import AbstractFileWrapper, StreamWrapper, DiskFileWrapper
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
ContentTypeMapping = namedtuple("ContentTypeMapping", "extensions, content_type")
|
||||
ContentTypeDetector = namedtuple("ContentTypeDetector", "extensions, detector")
|
||||
|
||||
extensions = dict(
|
||||
)
|
||||
|
||||
def full_extension_tree():
|
||||
result = dict(
|
||||
# extensions for 3d model files
|
||||
model=dict(
|
||||
stl=ContentTypeMapping(["stl"], "application/sla")
|
||||
),
|
||||
# extensions for printable machine code
|
||||
machinecode=dict(
|
||||
gcode=ContentTypeMapping(["gcode", "gco", "g"], "text/plain")
|
||||
)
|
||||
)
|
||||
|
||||
extension_tree_hooks = octoprint.plugin.plugin_manager().get_hooks("octoprint.filemanager.extension_tree")
|
||||
for name, hook in extension_tree_hooks.items():
|
||||
try:
|
||||
hook_result = hook()
|
||||
if hook_result is None or not isinstance(hook_result, dict):
|
||||
continue
|
||||
result = octoprint.util.dict_merge(result, hook_result)
|
||||
except:
|
||||
logging.getLogger(__name__).exception("Exception while retrieving additional extension tree entries from hook {name}".format(name=name))
|
||||
|
||||
return result
|
||||
|
||||
def get_extensions(type, subtree=None):
|
||||
if not subtree:
|
||||
subtree = full_extension_tree()
|
||||
|
||||
for key, value in subtree.items():
|
||||
if key == type:
|
||||
return get_all_extensions(subtree=value)
|
||||
elif isinstance(value, dict):
|
||||
sub_extensions = get_extensions(type, subtree=value)
|
||||
if sub_extensions:
|
||||
return sub_extensions
|
||||
|
||||
return None
|
||||
|
||||
def get_all_extensions(subtree=None):
|
||||
if not subtree:
|
||||
subtree = full_extension_tree()
|
||||
|
||||
result = []
|
||||
if isinstance(subtree, dict):
|
||||
for key, value in subtree.items():
|
||||
if isinstance(value, dict):
|
||||
result += get_all_extensions(value)
|
||||
elif isinstance(value, (ContentTypeMapping, ContentTypeDetector)):
|
||||
result += value.extensions
|
||||
elif isinstance(value, (list, tuple)):
|
||||
result += value
|
||||
elif isinstance(subtree, (ContentTypeMapping, ContentTypeDetector)):
|
||||
result = subtree.extensions
|
||||
elif isinstance(subtree, (list, tuple)):
|
||||
result = subtree
|
||||
return result
|
||||
|
||||
def get_path_for_extension(extension, subtree=None):
|
||||
if not subtree:
|
||||
subtree = full_extension_tree()
|
||||
|
||||
for key, value in subtree.items():
|
||||
if isinstance(value, (ContentTypeMapping, ContentTypeDetector)) and extension in value.extensions:
|
||||
return [key]
|
||||
elif isinstance(value, (list, tuple)) and extension in value:
|
||||
return [key]
|
||||
elif isinstance(value, dict):
|
||||
path = get_path_for_extension(extension, subtree=value)
|
||||
if path:
|
||||
return [key] + path
|
||||
|
||||
return None
|
||||
|
||||
def get_content_type_mapping_for_extension(extension, subtree=None):
|
||||
if not subtree:
|
||||
subtree = full_extension_tree()
|
||||
|
||||
for key, value in subtree.items():
|
||||
content_extension_matches = isinstance(value, (ContentTypeMapping, ContentTypeDetector)) and extension in value. extensions
|
||||
list_extension_matches = isinstance(value, (list, tuple)) and extension in value
|
||||
|
||||
if content_extension_matches or list_extension_matches:
|
||||
return value
|
||||
elif isinstance(value, dict):
|
||||
result = get_content_type_mapping_for_extension(extension, subtree=value)
|
||||
if result is not None:
|
||||
return result
|
||||
|
||||
return None
|
||||
|
||||
def valid_extension(extension, type=None):
|
||||
if not type:
|
||||
return extension in get_all_extensions()
|
||||
else:
|
||||
extensions = get_extensions(type)
|
||||
if extensions:
|
||||
return extension in extensions
|
||||
|
||||
def valid_file_type(filename, type=None):
|
||||
_, extension = os.path.splitext(filename)
|
||||
extension = extension[1:].lower()
|
||||
return valid_extension(extension, type=type)
|
||||
|
||||
def get_file_type(filename):
|
||||
_, extension = os.path.splitext(filename)
|
||||
extension = extension[1:].lower()
|
||||
return get_path_for_extension(extension)
|
||||
|
||||
def get_mime_type(filename):
|
||||
_, extension = os.path.splitext(filename)
|
||||
extension = extension[1:].lower()
|
||||
mapping = get_content_type_mapping_for_extension(extension)
|
||||
if mapping:
|
||||
if isinstance(mapping, ContentTypeMapping) and mapping.content_type is not None:
|
||||
return mapping.content_type
|
||||
elif isinstance(mapping, ContentTypeDetector) and callable(mapping.detector):
|
||||
result = mapping.detector(filename)
|
||||
if result is not None:
|
||||
return result
|
||||
return "application/octet-stream"
|
||||
|
||||
|
||||
class NoSuchStorage(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class FileManager(object):
|
||||
def __init__(self, analysis_queue, slicing_manager, printer_profile_manager, initial_storage_managers=None):
|
||||
self._logger = logging.getLogger(__name__)
|
||||
self._analysis_queue = analysis_queue
|
||||
self._analysis_queue.register_finish_callback(self._on_analysis_finished)
|
||||
|
||||
self._storage_managers = dict()
|
||||
if initial_storage_managers:
|
||||
self._storage_managers.update(initial_storage_managers)
|
||||
|
||||
self._slicing_manager = slicing_manager
|
||||
self._printer_profile_manager = printer_profile_manager
|
||||
|
||||
import threading
|
||||
self._slicing_jobs = dict()
|
||||
self._slicing_jobs_mutex = threading.Lock()
|
||||
|
||||
self._slicing_progress_callbacks = []
|
||||
self._last_slicing_progress = None
|
||||
|
||||
self._progress_plugins = []
|
||||
self._preprocessor_hooks = dict()
|
||||
|
||||
import octoprint.settings
|
||||
self._recovery_file = os.path.join(octoprint.settings.settings().getBaseFolder("data"), "print_recovery_data.yaml")
|
||||
|
||||
def initialize(self):
|
||||
self.reload_plugins()
|
||||
|
||||
def worker():
|
||||
self._logger.info("Adding backlog items from all storage types to analysis queue...".format(**locals()))
|
||||
for storage_type, storage_manager in self._storage_managers.items():
|
||||
self._determine_analysis_backlog(storage_type, storage_manager)
|
||||
|
||||
import threading
|
||||
thread = threading.Thread(target=worker)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
|
||||
def reload_plugins(self):
|
||||
self._progress_plugins = octoprint.plugin.plugin_manager().get_implementations(octoprint.plugin.ProgressPlugin)
|
||||
self._preprocessor_hooks = octoprint.plugin.plugin_manager().get_hooks("octoprint.filemanager.preprocessor")
|
||||
|
||||
def register_slicingprogress_callback(self, callback):
|
||||
self._slicing_progress_callbacks.append(callback)
|
||||
|
||||
def unregister_slicingprogress_callback(self, callback):
|
||||
try:
|
||||
self._slicing_progress_callbacks.remove(callback)
|
||||
except ValueError:
|
||||
# callback was not registered
|
||||
pass
|
||||
|
||||
def _determine_analysis_backlog(self, storage_type, storage_manager):
|
||||
counter = 0
|
||||
for entry, path, printer_profile in storage_manager.analysis_backlog:
|
||||
file_type = get_file_type(path)[-1]
|
||||
|
||||
# we'll use the default printer profile for the backlog since we don't know better
|
||||
queue_entry = QueueEntry(entry, file_type, storage_type, path, self._printer_profile_manager.get_default())
|
||||
if self._analysis_queue.enqueue(queue_entry, high_priority=False):
|
||||
counter += 1
|
||||
self._logger.info("Added {counter} items from storage type \"{storage_type}\" to analysis queue".format(**locals()))
|
||||
|
||||
def add_storage(self, storage_type, storage_manager):
|
||||
self._storage_managers[storage_type] = storage_manager
|
||||
self._determine_analysis_backlog(storage_type, storage_manager)
|
||||
|
||||
def remove_storage(self, type):
|
||||
if not type in self._storage_managers:
|
||||
return
|
||||
del self._storage_managers[type]
|
||||
|
||||
@property
|
||||
def slicing_enabled(self):
|
||||
return self._slicing_manager.slicing_enabled
|
||||
|
||||
@property
|
||||
def registered_slicers(self):
|
||||
return self._slicing_manager.registered_slicers
|
||||
|
||||
@property
|
||||
def default_slicer(self):
|
||||
return self._slicing_manager.default_slicer
|
||||
|
||||
def slice(self, slicer_name, source_location, source_path, dest_location, dest_path,
|
||||
position=None, profile=None, printer_profile_id=None, overrides=None, callback=None, callback_args=None):
|
||||
absolute_source_path = self.path_on_disk(source_location, source_path)
|
||||
|
||||
def stlProcessed(source_location, source_path, tmp_path, dest_location, dest_path, start_time, printer_profile_id, callback, callback_args, _error=None, _cancelled=False, _analysis=None):
|
||||
try:
|
||||
if _error:
|
||||
eventManager().fire(Events.SLICING_FAILED, {"stl": source_path, "gcode": dest_path, "reason": _error})
|
||||
elif _cancelled:
|
||||
eventManager().fire(Events.SLICING_CANCELLED, {"stl": source_path, "gcode": dest_path})
|
||||
else:
|
||||
source_meta = self.get_metadata(source_location, source_path)
|
||||
hash = source_meta["hash"]
|
||||
|
||||
import io
|
||||
links = [("model", dict(name=source_path))]
|
||||
_, stl_name = self.split_path(source_location, source_path)
|
||||
file_obj = StreamWrapper(os.path.basename(dest_path),
|
||||
io.BytesIO(u";Generated from {stl_name} {hash}\n".format(**locals()).encode("ascii", "replace")),
|
||||
io.FileIO(tmp_path, "rb"))
|
||||
|
||||
printer_profile = self._printer_profile_manager.get(printer_profile_id)
|
||||
self.add_file(dest_location, dest_path, file_obj, links=links, allow_overwrite=True, printer_profile=printer_profile, analysis=_analysis)
|
||||
|
||||
end_time = time.time()
|
||||
eventManager().fire(Events.SLICING_DONE, {"stl": source_path, "gcode": dest_path, "time": end_time - start_time})
|
||||
|
||||
if callback is not None:
|
||||
if callback_args is None:
|
||||
callback_args = ()
|
||||
callback(*callback_args)
|
||||
finally:
|
||||
os.remove(tmp_path)
|
||||
|
||||
source_job_key = (source_location, source_path)
|
||||
dest_job_key = (dest_location, dest_path)
|
||||
|
||||
with self._slicing_jobs_mutex:
|
||||
if source_job_key in self._slicing_jobs:
|
||||
del self._slicing_jobs[source_job_key]
|
||||
if dest_job_key in self._slicing_jobs:
|
||||
del self._slicing_jobs[dest_job_key]
|
||||
|
||||
slicer = self._slicing_manager.get_slicer(slicer_name)
|
||||
|
||||
import time
|
||||
start_time = time.time()
|
||||
eventManager().fire(Events.SLICING_STARTED, {"stl": source_path, "gcode": dest_path, "progressAvailable": slicer.get_slicer_properties().get("progress_report", False) if slicer else False})
|
||||
|
||||
import tempfile
|
||||
f = tempfile.NamedTemporaryFile(suffix=".gco", delete=False)
|
||||
temp_path = f.name
|
||||
f.close()
|
||||
|
||||
with self._slicing_jobs_mutex:
|
||||
source_job_key = (source_location, source_path)
|
||||
dest_job_key = (dest_location, dest_path)
|
||||
if dest_job_key in self._slicing_jobs:
|
||||
job_slicer_name, job_absolute_source_path, job_temp_path = self._slicing_jobs[dest_job_key]
|
||||
|
||||
self._slicing_manager.cancel_slicing(job_slicer_name, job_absolute_source_path, job_temp_path)
|
||||
del self._slicing_jobs[dest_job_key]
|
||||
|
||||
self._slicing_jobs[dest_job_key] = self._slicing_jobs[source_job_key] = (slicer_name, absolute_source_path, temp_path)
|
||||
|
||||
args = (source_location, source_path, temp_path, dest_location, dest_path, start_time, printer_profile_id, callback, callback_args)
|
||||
self._slicing_manager.slice(slicer_name,
|
||||
absolute_source_path,
|
||||
temp_path,
|
||||
profile,
|
||||
stlProcessed,
|
||||
position=position,
|
||||
callback_args=args,
|
||||
overrides=overrides,
|
||||
printer_profile_id=printer_profile_id,
|
||||
on_progress=self.on_slicing_progress,
|
||||
on_progress_args=(slicer_name, source_location, source_path, dest_location, dest_path))
|
||||
|
||||
def on_slicing_progress(self, slicer, source_location, source_path, dest_location, dest_path, _progress=None):
|
||||
if not _progress:
|
||||
return
|
||||
|
||||
progress_int = int(_progress * 100)
|
||||
if self._last_slicing_progress != progress_int:
|
||||
self._last_slicing_progress = progress_int
|
||||
for callback in self._slicing_progress_callbacks:
|
||||
try: callback.sendSlicingProgress(slicer, source_location, source_path, dest_location, dest_path, progress_int)
|
||||
except: self._logger.exception("Exception while pushing slicing progress")
|
||||
|
||||
if progress_int:
|
||||
def call_plugins(slicer, source_location, source_path, dest_location, dest_path, progress):
|
||||
for plugin in self._progress_plugins:
|
||||
try:
|
||||
plugin.on_slicing_progress(slicer, source_location, source_path, dest_location, dest_path, progress)
|
||||
except:
|
||||
self._logger.exception("Exception while sending slicing progress to plugin %s" % plugin._identifier)
|
||||
|
||||
import threading
|
||||
thread = threading.Thread(target=call_plugins, args=(slicer, source_location, source_path, dest_location, dest_path, progress_int))
|
||||
thread.daemon = False
|
||||
thread.start()
|
||||
|
||||
|
||||
def get_busy_files(self):
|
||||
return self._slicing_jobs.keys()
|
||||
|
||||
def file_exists(self, destination, path):
|
||||
return self._storage(destination).file_exists(path)
|
||||
|
||||
def list_files(self, destinations=None, path=None, filter=None, recursive=None):
|
||||
if not destinations:
|
||||
destinations = self._storage_managers.keys()
|
||||
if isinstance(destinations, (str, unicode, basestring)):
|
||||
destinations = [destinations]
|
||||
|
||||
result = dict()
|
||||
for dst in destinations:
|
||||
result[dst] = self._storage_managers[dst].list_files(path=path, filter=filter, recursive=recursive)
|
||||
return result
|
||||
|
||||
def add_file(self, destination, path, file_object, links=None, allow_overwrite=False, printer_profile=None, analysis=None):
|
||||
if printer_profile is None:
|
||||
printer_profile = self._printer_profile_manager.get_current_or_default()
|
||||
|
||||
for hook in self._preprocessor_hooks.values():
|
||||
try:
|
||||
hook_file_object = hook(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite)
|
||||
except:
|
||||
self._logger.exception("Error when calling preprocessor hook {}, ignoring".format(hook))
|
||||
continue
|
||||
|
||||
if hook_file_object is not None:
|
||||
file_object = hook_file_object
|
||||
file_path = self._storage(destination).add_file(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite)
|
||||
absolute_path = self._storage(destination).path_on_disk(file_path)
|
||||
|
||||
if analysis is None:
|
||||
file_type = get_file_type(absolute_path)
|
||||
if file_type:
|
||||
queue_entry = QueueEntry(file_path, file_type[-1], destination, absolute_path, printer_profile)
|
||||
self._analysis_queue.enqueue(queue_entry, high_priority=True)
|
||||
else:
|
||||
self._add_analysis_result(destination, path, analysis)
|
||||
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
return file_path
|
||||
|
||||
def remove_file(self, destination, path):
|
||||
self._storage(destination).remove_file(path)
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
|
||||
def add_folder(self, destination, path, ignore_existing=True):
|
||||
folder_path = self._storage(destination).add_folder(path, ignore_existing=ignore_existing)
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
return folder_path
|
||||
|
||||
def remove_folder(self, destination, path, recursive=True):
|
||||
self._storage(destination).remove_folder(path, recursive=recursive)
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
|
||||
def get_metadata(self, destination, path):
|
||||
return self._storage(destination).get_metadata(path)
|
||||
|
||||
def add_link(self, destination, path, rel, data):
|
||||
self._storage(destination).add_link(path, rel, data)
|
||||
|
||||
def remove_link(self, destination, path, rel, data):
|
||||
self._storage(destination).remove_link(path, rel, data)
|
||||
|
||||
def log_print(self, destination, path, timestamp, print_time, success, printer_profile):
|
||||
try:
|
||||
if success:
|
||||
self._storage(destination).add_history(path, dict(timestamp=timestamp, printTime=print_time, success=success, printerProfile=printer_profile))
|
||||
else:
|
||||
self._storage(destination).add_history(path, dict(timestamp=timestamp, success=success, printerProfile=printer_profile))
|
||||
eventManager().fire(Events.METADATA_STATISTICS_UPDATED, dict(storage=destination, path=path))
|
||||
except NoSuchStorage:
|
||||
# if there's no storage configured where to log the print, we'll just not log it
|
||||
pass
|
||||
|
||||
def save_recovery_data(self, origin, path, pos):
|
||||
import time
|
||||
import yaml
|
||||
from octoprint.util import atomic_write
|
||||
|
||||
data = dict(origin=origin,
|
||||
path=self.path_in_storage(origin, path),
|
||||
pos=pos,
|
||||
date=time.time())
|
||||
try:
|
||||
with atomic_write(self._recovery_file, max_permissions=0o666) as f:
|
||||
yaml.safe_dump(data, stream=f, default_flow_style=False, indent=" ", allow_unicode=True)
|
||||
except:
|
||||
self._logger.exception("Could not write recovery data to file {}".format(self._recovery_file))
|
||||
|
||||
def delete_recovery_data(self):
|
||||
if not os.path.isfile(self._recovery_file):
|
||||
return
|
||||
|
||||
try:
|
||||
os.remove(self._recovery_file)
|
||||
except:
|
||||
self._logger.exception("Error deleting recovery data file {}".format(self._recovery_file))
|
||||
|
||||
def get_recovery_data(self):
|
||||
if not os.path.isfile(self._recovery_file):
|
||||
return None
|
||||
|
||||
import yaml
|
||||
try:
|
||||
with open(self._recovery_file) as f:
|
||||
data = yaml.safe_load(f)
|
||||
return data
|
||||
except:
|
||||
self._logger.exception("Could not read recovery data from file {}".format(self._recovery_file))
|
||||
self.delete_recovery_data()
|
||||
|
||||
def set_additional_metadata(self, destination, path, key, data, overwrite=False, merge=False):
|
||||
self._storage(destination).set_additional_metadata(path, key, data, overwrite=overwrite, merge=merge)
|
||||
|
||||
def remove_additional_metadata(self, destination, path, key):
|
||||
self._storage(destination).remove_additional_metadata(path, key)
|
||||
|
||||
def path_on_disk(self, destination, path):
|
||||
return self._storage(destination).path_on_disk(path)
|
||||
|
||||
def sanitize(self, destination, path):
|
||||
return self._storage(destination).sanitize(path)
|
||||
|
||||
def sanitize_name(self, destination, name):
|
||||
return self._storage(destination).sanitize_name(name)
|
||||
|
||||
def sanitize_path(self, destination, path):
|
||||
return self._storage(destination).sanitize_path(path)
|
||||
|
||||
def split_path(self, destination, path):
|
||||
return self._storage(destination).split_path(path)
|
||||
|
||||
def join_path(self, destination, *path):
|
||||
return self._storage(destination).join_path(*path)
|
||||
|
||||
def path_in_storage(self, destination, path):
|
||||
return self._storage(destination).path_in_storage(path)
|
||||
|
||||
def _storage(self, destination):
|
||||
if not destination in self._storage_managers:
|
||||
raise NoSuchStorage("No storage configured for destination {destination}".format(**locals()))
|
||||
return self._storage_managers[destination]
|
||||
|
||||
def _add_analysis_result(self, destination, path, result):
|
||||
if not destination in self._storage_managers:
|
||||
return
|
||||
|
||||
storage_manager = self._storage_managers[destination]
|
||||
storage_manager.set_additional_metadata(path, "analysis", result)
|
||||
|
||||
def _on_analysis_finished(self, entry, result):
|
||||
self._add_analysis_result(entry.location, entry.path, result)
|
||||
|
||||
@@ -0,0 +1,279 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
__author__ = "Gina Häußge <osd@foosel.net>"
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||
|
||||
|
||||
import logging
|
||||
import Queue as queue
|
||||
import os
|
||||
import threading
|
||||
import collections
|
||||
import time
|
||||
|
||||
from octoprint.events import Events, eventManager
|
||||
|
||||
import octoprint.util.gcodeInterpreter as gcodeInterpreter
|
||||
|
||||
|
||||
class QueueEntry(collections.namedtuple("QueueEntry", "path, type, location, absolute_path, printer_profile")):
|
||||
"""
|
||||
A :class:`QueueEntry` for processing through the :class:`AnalysisQueue`. Wraps the entry's properties necessary
|
||||
for processing.
|
||||
|
||||
Arguments:
|
||||
path (str): Storage location specific path to the file to analyze.
|
||||
type (str): Type of file to analyze, necessary to map to the correct :class:`AbstractAnalysisQueue` sub class.
|
||||
At the moment, only ``gcode`` is supported here.
|
||||
location (str): Location the file is located on.
|
||||
absolute_path (str): Absolute path on disk through which to access the file.
|
||||
printer_profile (PrinterProfile): :class:`PrinterProfile` which to use for analysis.
|
||||
"""
|
||||
|
||||
def __str__(self):
|
||||
return "{location}:{path}".format(location=self.location, path=self.path)
|
||||
|
||||
|
||||
class AnalysisQueue(object):
|
||||
"""
|
||||
OctoPrint's :class:`AnalysisQueue` can manage various :class:`AbstractAnalysisQueue` implementations, mapped
|
||||
by their machine code type.
|
||||
|
||||
At the moment, only the analysis of GCODE files for 3D printing is supported, through :class:`GcodeAnalysisQueue`.
|
||||
|
||||
By invoking :meth:`register_finish_callback` it is possible to register oneself as a callback to be invoked each
|
||||
time the analysis of a queue entry finishes. The call parameters will be the finished queue entry as the first
|
||||
and the analysis result as the second parameter. It is also possible to remove the registration again by invoking
|
||||
:meth:`unregister_finish_callback`.
|
||||
|
||||
:meth:`enqueue` allows enqueuing :class:`QueueEntry` instances to analyze. If the :attr:`QueueEntry.type` is unknown
|
||||
(no specific child class of :class:`AbstractAnalysisQueue` is registered for it), nothing will happen. Otherwise the
|
||||
entry will be enqueued with the type specific analysis queue.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self._logger = logging.getLogger(__name__)
|
||||
self._callbacks = []
|
||||
self._queues = dict(
|
||||
gcode=GcodeAnalysisQueue(self._analysis_finished)
|
||||
)
|
||||
|
||||
def register_finish_callback(self, callback):
|
||||
self._callbacks.append(callback)
|
||||
|
||||
def unregister_finish_callback(self, callback):
|
||||
self._callbacks.remove(callback)
|
||||
|
||||
def enqueue(self, entry, high_priority=False):
|
||||
if not entry.type in self._queues:
|
||||
return False
|
||||
|
||||
self._queues[entry.type].enqueue(entry, high_priority=high_priority)
|
||||
return True
|
||||
|
||||
def pause(self):
|
||||
for queue in self._queues.values():
|
||||
queue.pause()
|
||||
|
||||
def resume(self):
|
||||
for queue in self._queues.values():
|
||||
queue.resume()
|
||||
|
||||
def _analysis_finished(self, entry, result):
|
||||
for callback in self._callbacks:
|
||||
callback(entry, result)
|
||||
eventManager().fire(Events.METADATA_ANALYSIS_FINISHED, {"file": entry.path, "result": result})
|
||||
|
||||
class AbstractAnalysisQueue(object):
|
||||
"""
|
||||
The :class:`AbstractAnalysisQueue` is the parent class of all specific analysis queues such as the
|
||||
:class:`GcodeAnalysisQueue`. It offers methods to enqueue new entries to analyze and pausing and resuming analysis
|
||||
processing.
|
||||
|
||||
Arguments:
|
||||
finished_callback (callable): Callback that will be called upon finishing analysis of an entry in the queue.
|
||||
The callback will be called with the analyzed entry as the first argument and the analysis result as
|
||||
returned from the queue implementation as the second parameter.
|
||||
|
||||
.. automethod:: _do_analysis
|
||||
|
||||
.. automethod:: _do_abort
|
||||
"""
|
||||
|
||||
LOW_PRIO = 0
|
||||
HIGH_PRIO = 100
|
||||
|
||||
def __init__(self, finished_callback):
|
||||
self._logger = logging.getLogger(__name__)
|
||||
|
||||
self._finished_callback = finished_callback
|
||||
|
||||
self._active = threading.Event()
|
||||
self._active.set()
|
||||
|
||||
self._currentFile = None
|
||||
self._currentProgress = None
|
||||
|
||||
self._queue = queue.PriorityQueue()
|
||||
self._current = None
|
||||
|
||||
self._worker = threading.Thread(target=self._work)
|
||||
self._worker.daemon = True
|
||||
self._worker.start()
|
||||
|
||||
def enqueue(self, entry, high_priority=False):
|
||||
"""
|
||||
Enqueues an ``entry`` for analysis by the queue.
|
||||
|
||||
If ``high_priority`` is True (defaults to False), the entry will be prioritized and hence processed before
|
||||
other entries in the queue with normal priority.
|
||||
|
||||
Arguments:
|
||||
entry (QueueEntry): The :class:`QueueEntry` to analyze.
|
||||
high_priority (boolean): Whether to process the provided entry with high priority (True) or not
|
||||
(False, default)
|
||||
"""
|
||||
|
||||
if high_priority:
|
||||
self._logger.debug("Adding entry {entry} to analysis queue with high priority".format(entry=entry))
|
||||
prio = self.__class__.HIGH_PRIO
|
||||
else:
|
||||
self._logger.debug("Adding entry {entry} to analysis queue with low priority".format(entry=entry))
|
||||
prio = self.__class__.LOW_PRIO
|
||||
|
||||
self._queue.put((prio, entry))
|
||||
|
||||
def pause(self):
|
||||
"""
|
||||
Pauses processing of the queue, e.g. when a print is active.
|
||||
"""
|
||||
|
||||
self._logger.debug("Pausing analysis")
|
||||
self._active.clear()
|
||||
if self._current is not None:
|
||||
self._logger.debug("Aborting running analysis, will restart when analyzer is resumed")
|
||||
self._do_abort()
|
||||
|
||||
def resume(self):
|
||||
"""
|
||||
Resumes processing of the queue, e.g. when a print has finished.
|
||||
"""
|
||||
|
||||
self._logger.debug("Resuming analyzer")
|
||||
self._active.set()
|
||||
|
||||
def _work(self):
|
||||
aborted = None
|
||||
while True:
|
||||
if aborted is not None:
|
||||
entry = aborted
|
||||
aborted = None
|
||||
self._logger.debug("Got an aborted analysis job for entry {entry}, processing this instead of first item in queue".format(**locals()))
|
||||
else:
|
||||
(priority, entry) = self._queue.get()
|
||||
self._logger.debug("Processing entry {entry} from queue (priority {priority})".format(**locals()))
|
||||
|
||||
self._active.wait()
|
||||
|
||||
try:
|
||||
self._analyze(entry, high_priority=(priority == self.__class__.HIGH_PRIO))
|
||||
self._queue.task_done()
|
||||
except gcodeInterpreter.AnalysisAborted:
|
||||
aborted = entry
|
||||
self._logger.debug("Running analysis of entry {entry} aborted".format(**locals()))
|
||||
else:
|
||||
time.sleep(1.0)
|
||||
|
||||
def _analyze(self, entry, high_priority=False):
|
||||
path = entry.absolute_path
|
||||
if path is None or not os.path.exists(path):
|
||||
return
|
||||
|
||||
self._current = entry
|
||||
self._current_progress = 0
|
||||
|
||||
try:
|
||||
self._logger.info("Starting analysis of {entry}".format(**locals()))
|
||||
eventManager().fire(Events.METADATA_ANALYSIS_STARTED, {"file": entry.path, "type": entry.type})
|
||||
try:
|
||||
result = self._do_analysis(high_priority=high_priority)
|
||||
except TypeError:
|
||||
result = self._do_analysis()
|
||||
self._logger.debug("Analysis of entry {entry} finished, notifying callback".format(**locals()))
|
||||
self._finished_callback(self._current, result)
|
||||
finally:
|
||||
self._current = None
|
||||
self._current_progress = None
|
||||
|
||||
def _do_analysis(self, high_priority=False):
|
||||
"""
|
||||
Performs the actual analysis of the current entry which can be accessed via ``self._current``. Needs to be
|
||||
overridden by sub classes.
|
||||
|
||||
Arguments:
|
||||
high_priority (bool): Whether the current entry has high priority or not.
|
||||
|
||||
Returns:
|
||||
object: The result of the analysis which will be forwarded to the ``finished_callback`` provided during
|
||||
construction.
|
||||
"""
|
||||
return None
|
||||
|
||||
def _do_abort(self):
|
||||
"""
|
||||
Aborts analysis of the current entry. Needs to be overridden by sub classes.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class GcodeAnalysisQueue(AbstractAnalysisQueue):
|
||||
"""
|
||||
A queue to analyze GCODE files. Analysis results are :class:`dict` instances structured as follows:
|
||||
|
||||
.. list-table::
|
||||
:widths: 25 70
|
||||
|
||||
- * **Key**
|
||||
* **Description**
|
||||
- * ``estimatedPrintTime``
|
||||
* Estimated time the file take to print, in minutes
|
||||
- * ``filament``
|
||||
* Substructure describing estimated filament usage. Keys are ``tool0`` for the first extruder, ``tool1`` for
|
||||
the second and so on. For each tool extruded length and volume (based on diameter) are provided.
|
||||
- * ``filament.toolX.length``
|
||||
* The extruded length in mm
|
||||
- * ``filament.toolX.volume``
|
||||
* The extruded volume in cm³
|
||||
"""
|
||||
|
||||
def _do_analysis(self, high_priority=False):
|
||||
try:
|
||||
def throttle():
|
||||
time.sleep(0.01)
|
||||
|
||||
throttle_callback = throttle
|
||||
if high_priority:
|
||||
throttle_callback = None
|
||||
|
||||
self._gcode = gcodeInterpreter.gcode()
|
||||
self._gcode.load(self._current.absolute_path, self._current.printer_profile, throttle=throttle_callback)
|
||||
|
||||
result = dict()
|
||||
if self._gcode.totalMoveTimeMinute:
|
||||
result["estimatedPrintTime"] = self._gcode.totalMoveTimeMinute * 60
|
||||
if self._gcode.extrusionAmount:
|
||||
result["filament"] = dict()
|
||||
for i in range(len(self._gcode.extrusionAmount)):
|
||||
result["filament"]["tool%d" % i] = {
|
||||
"length": self._gcode.extrusionAmount[i],
|
||||
"volume": self._gcode.extrusionVolume[i]
|
||||
}
|
||||
return result
|
||||
finally:
|
||||
self._gcode = None
|
||||
|
||||
def _do_abort(self):
|
||||
if self._gcode:
|
||||
self._gcode.abort()
|
||||
@@ -1,3 +1,6 @@
|
||||
# coding=utf-8
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
|
||||
class FileDestinations(object):
|
||||
|
||||
SDCARD = "sdcard"
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
|
||||
class FileTypes(object):
|
||||
|
||||
STL = "stl"
|
||||
GCODE = "gcode"
|
||||
@@ -0,0 +1,241 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
__author__ = "Gina Häußge <osd@foosel.net>"
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||
|
||||
import io
|
||||
|
||||
from octoprint.util import atomic_write
|
||||
|
||||
class AbstractFileWrapper(object):
|
||||
"""
|
||||
Wrapper for file representations to save to storages.
|
||||
|
||||
Arguments:
|
||||
filename (str): The file's name
|
||||
"""
|
||||
|
||||
def __init__(self, filename):
|
||||
self.filename = filename
|
||||
|
||||
def save(self, path):
|
||||
"""
|
||||
Saves the file's content to the given absolute path.
|
||||
|
||||
Arguments:
|
||||
path (str): The absolute path to where to save the file
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def stream(self):
|
||||
"""
|
||||
Returns a Python stream object (subclass of io.IOBase) representing the file's contents.
|
||||
|
||||
Returns:
|
||||
io.IOBase: The file's contents as a stream.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
class DiskFileWrapper(AbstractFileWrapper):
|
||||
"""
|
||||
An implementation of :class:`.AbstractFileWrapper` that wraps an actual file on disk. The `save` implementations
|
||||
will either copy the file to the new path (preserving file attributes) or -- if `move` is `True` (the default) --
|
||||
move the file.
|
||||
|
||||
Arguments:
|
||||
filename (str): The file's name
|
||||
path (str): The file's absolute path
|
||||
move (boolean): Whether to move the file upon saving (True, default) or copying.
|
||||
"""
|
||||
|
||||
def __init__(self, filename, path, move=True):
|
||||
AbstractFileWrapper.__init__(self, filename)
|
||||
self.path = path
|
||||
self.move = move
|
||||
|
||||
def save(self, path):
|
||||
import shutil
|
||||
|
||||
if self.move:
|
||||
shutil.move(self.path, path)
|
||||
else:
|
||||
shutil.copy2(self.path, path)
|
||||
|
||||
def stream(self):
|
||||
return io.open(self.path, "rb")
|
||||
|
||||
class StreamWrapper(AbstractFileWrapper):
|
||||
"""
|
||||
A wrapper allowing processing of one or more consecutive streams.
|
||||
|
||||
Arguments:
|
||||
*streams (io.IOBase): One or more streams to process one after another to save to storage.
|
||||
"""
|
||||
def __init__(self, filename, *streams):
|
||||
if not len(streams) > 0:
|
||||
raise ValueError("Need at least one stream to wrap")
|
||||
|
||||
AbstractFileWrapper.__init__(self, filename)
|
||||
self.streams = streams
|
||||
|
||||
def save(self, path):
|
||||
"""
|
||||
Will dump the contents of all streams provided during construction into the target file, in the order they were
|
||||
provided.
|
||||
"""
|
||||
import shutil
|
||||
|
||||
with atomic_write(path, "wb") as dest:
|
||||
with self.stream() as source:
|
||||
shutil.copyfileobj(source, dest)
|
||||
|
||||
def stream(self):
|
||||
"""
|
||||
If more than one stream was provided to the constructor, will return a :class:`.MultiStream` wrapping all
|
||||
provided streams in the order they were provided, else the first and only stream is returned directly.
|
||||
"""
|
||||
if len(self.streams) > 1:
|
||||
return MultiStream(*self.streams)
|
||||
else:
|
||||
return self.streams[0]
|
||||
|
||||
class MultiStream(io.RawIOBase):
|
||||
"""
|
||||
A stream implementation which when read reads from multiple streams, one after the other, basically concatenating
|
||||
their contents in the order they are provided to the constructor.
|
||||
|
||||
Arguments:
|
||||
*streams (io.IOBase): One or more streams to concatenate.
|
||||
"""
|
||||
def __init__(self, *streams):
|
||||
io.RawIOBase.__init__(self)
|
||||
self.streams = streams
|
||||
self.current_stream = 0
|
||||
|
||||
def read(self, n=-1):
|
||||
if n == 0:
|
||||
return b''
|
||||
|
||||
if len(self.streams) == 0:
|
||||
return b''
|
||||
|
||||
while self.current_stream < len(self.streams):
|
||||
stream = self.streams[self.current_stream]
|
||||
|
||||
result = stream.read(n)
|
||||
if result is None or len(result) != 0:
|
||||
return result
|
||||
else:
|
||||
self.current_stream += 1
|
||||
|
||||
return b''
|
||||
|
||||
def readinto(self, b):
|
||||
n = len(b)
|
||||
read = self.read(n)
|
||||
b[:len(read)] = read
|
||||
return len(read)
|
||||
|
||||
def close(self):
|
||||
for stream in self.streams:
|
||||
try:
|
||||
stream.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
def readable(self, *args, **kwargs):
|
||||
return True
|
||||
|
||||
def seekable(self, *args, **kwargs):
|
||||
return False
|
||||
|
||||
def writable(self, *args, **kwargs):
|
||||
return False
|
||||
|
||||
class LineProcessorStream(io.RawIOBase):
|
||||
"""
|
||||
While reading from this stream the provided `input_stream` is read line by line, calling the (overridable) method
|
||||
:meth:`.process_line` for each read line.
|
||||
|
||||
Sub classes can thus modify the contents of the `input_stream` in line, while it is being read.
|
||||
|
||||
Arguments:
|
||||
input_stream (io.IOBase): The stream to process on the fly.
|
||||
"""
|
||||
|
||||
def __init__(self, input_stream):
|
||||
io.RawIOBase.__init__(self)
|
||||
self.input_stream = io.BufferedReader(input_stream)
|
||||
self.leftover = None
|
||||
|
||||
def read(self, n=-1):
|
||||
if n == 0:
|
||||
return b''
|
||||
|
||||
result = b''
|
||||
while len(result) < n or n == -1:
|
||||
bytes_left = (n - len(result)) if n != -1 else -1
|
||||
if self.leftover is not None:
|
||||
if bytes_left != -1 and bytes_left < len(self.leftover):
|
||||
result += self.leftover[:bytes_left]
|
||||
self.leftover = self.leftover[bytes_left:]
|
||||
break
|
||||
else:
|
||||
result += self.leftover
|
||||
self.leftover = None
|
||||
|
||||
processed_line = None
|
||||
while processed_line is None:
|
||||
line = self.input_stream.readline()
|
||||
if not line:
|
||||
break
|
||||
processed_line = self.process_line(line)
|
||||
|
||||
if processed_line is None:
|
||||
break
|
||||
|
||||
bytes_left = (n - len(result)) if n != -1 else -1
|
||||
if bytes_left != -1 and bytes_left < len(processed_line):
|
||||
result += processed_line[:bytes_left]
|
||||
self.leftover = processed_line[bytes_left:]
|
||||
break
|
||||
else:
|
||||
result += processed_line
|
||||
|
||||
return result
|
||||
|
||||
def readinto(self, b):
|
||||
n = len(b)
|
||||
read = self.read(n)
|
||||
b[:len(read)] = read
|
||||
return len(read)
|
||||
|
||||
def process_line(self, line):
|
||||
"""
|
||||
Called from the `read` Method of this stream with each line read from `self.input_stream`.
|
||||
|
||||
By returning ``None`` the line will not be returned from the read stream, effectively being stripped from the
|
||||
wrapper `input_stream`.
|
||||
|
||||
Arguments:
|
||||
line (str): The line as read from `self.input_stream`
|
||||
|
||||
Returns:
|
||||
str or None: The processed version of the line (might also be multiple lines), or None if the line is to be
|
||||
stripped from the processed stream.
|
||||
"""
|
||||
return line
|
||||
|
||||
def close(self):
|
||||
self.input_stream.close()
|
||||
|
||||
def readable(self, *args, **kwargs):
|
||||
return True
|
||||
|
||||
def seekable(self, *args, **kwargs):
|
||||
return False
|
||||
|
||||
def writable(self, *args, **kwargs):
|
||||
return False
|
||||
@@ -1,523 +0,0 @@
|
||||
# coding=utf-8
|
||||
__author__ = "Gina Häußge <osd@foosel.net>"
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
|
||||
import os
|
||||
import Queue
|
||||
import threading
|
||||
import datetime
|
||||
import yaml
|
||||
import time
|
||||
import logging
|
||||
import octoprint.util as util
|
||||
import octoprint.util.gcodeInterpreter as gcodeInterpreter
|
||||
|
||||
from octoprint.settings import settings
|
||||
from octoprint.events import eventManager
|
||||
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
GCODE_EXTENSIONS = ["gcode", "gco", "g"]
|
||||
STL_EXTENSIONS = ["stl"]
|
||||
SUPPORTED_EXTENSIONS = GCODE_EXTENSIONS + STL_EXTENSIONS
|
||||
|
||||
def isGcodeFileName(filename):
|
||||
"""Simple helper to determine if a filename has the .gcode extension.
|
||||
|
||||
:param filename: :class: `str`
|
||||
|
||||
:returns boolean:
|
||||
"""
|
||||
return "." in filename and filename.rsplit(".", 1)[1].lower() in GCODE_EXTENSIONS
|
||||
|
||||
|
||||
def isSTLFileName(filename):
|
||||
"""Simple helper to determine if a filename has the .stl extension.
|
||||
|
||||
:param filename: :class: `str`
|
||||
|
||||
:returns boolean:
|
||||
"""
|
||||
return "." in filename and filename.rsplit(".", 1)[1].lower() in STL_EXTENSIONS
|
||||
|
||||
|
||||
def genGcodeFileName(filename):
|
||||
if not filename:
|
||||
return None
|
||||
|
||||
name, ext = filename.rsplit(".", 1)
|
||||
return name + ".gcode"
|
||||
|
||||
|
||||
def genStlFileName(filename):
|
||||
if not filename:
|
||||
return None
|
||||
|
||||
name, ext = filename.rsplit(".", 1)
|
||||
return name + ".stl"
|
||||
|
||||
|
||||
class GcodeManager:
|
||||
def __init__(self):
|
||||
self._logger = logging.getLogger(__name__)
|
||||
|
||||
self._settings = settings()
|
||||
|
||||
self._uploadFolder = self._settings.getBaseFolder("uploads")
|
||||
|
||||
self._callbacks = []
|
||||
|
||||
self._metadata = {}
|
||||
self._metadataDirty = False
|
||||
self._metadataFile = os.path.join(self._uploadFolder, "metadata.yaml")
|
||||
self._metadataTempFile = os.path.join(self._uploadFolder, "metadata.yaml.tmp")
|
||||
self._metadataFileAccessMutex = threading.Lock()
|
||||
|
||||
self._metadataAnalyzer = MetadataAnalyzer(getPathCallback=self.getAbsolutePath, loadedCallback=self._onMetadataAnalysisFinished)
|
||||
|
||||
self._loadMetadata()
|
||||
self._processAnalysisBacklog()
|
||||
|
||||
def _processAnalysisBacklog(self):
|
||||
for osFile in os.listdir(self._uploadFolder):
|
||||
filename = self._getBasicFilename(osFile)
|
||||
if not isGcodeFileName(filename):
|
||||
continue
|
||||
|
||||
absolutePath = self.getAbsolutePath(filename)
|
||||
if absolutePath is None:
|
||||
continue
|
||||
|
||||
fileData = self.getFileData(filename)
|
||||
if fileData is not None and "gcodeAnalysis" in fileData.keys():
|
||||
continue
|
||||
|
||||
self._metadataAnalyzer.addFileToBacklog(filename)
|
||||
|
||||
def _onMetadataAnalysisFinished(self, filename, gcode):
|
||||
if filename is None or gcode is None:
|
||||
return
|
||||
|
||||
basename = os.path.basename(filename)
|
||||
|
||||
absolutePath = self.getAbsolutePath(basename)
|
||||
if absolutePath is None:
|
||||
return
|
||||
|
||||
analysisResult = {}
|
||||
dirty = False
|
||||
if gcode.totalMoveTimeMinute:
|
||||
analysisResult["estimatedPrintTime"] = util.getFormattedTimeDelta(datetime.timedelta(minutes=gcode.totalMoveTimeMinute))
|
||||
dirty = True
|
||||
if gcode.extrusionAmount:
|
||||
analysisResult["filament"] = "%.2fm" % (gcode.extrusionAmount / 1000)
|
||||
if gcode.calculateVolumeCm3():
|
||||
analysisResult["filament"] += " / %.2fcm³" % gcode.calculateVolumeCm3()
|
||||
dirty = True
|
||||
|
||||
if dirty:
|
||||
metadata = self.getFileMetadata(basename)
|
||||
metadata["gcodeAnalysis"] = analysisResult
|
||||
self._metadata[basename] = metadata
|
||||
self._metadataDirty = True
|
||||
self._saveMetadata()
|
||||
|
||||
def _loadMetadata(self):
|
||||
if os.path.exists(self._metadataFile) and os.path.isfile(self._metadataFile):
|
||||
with self._metadataFileAccessMutex:
|
||||
with open(self._metadataFile, "r") as f:
|
||||
self._metadata = yaml.safe_load(f)
|
||||
if self._metadata is None:
|
||||
self._metadata = {}
|
||||
|
||||
def _saveMetadata(self, force=False):
|
||||
if not self._metadataDirty and not force:
|
||||
return
|
||||
|
||||
with self._metadataFileAccessMutex:
|
||||
with open(self._metadataTempFile, "wb") as f:
|
||||
yaml.safe_dump(self._metadata, f, default_flow_style=False, indent=" ", allow_unicode=True)
|
||||
self._metadataDirty = False
|
||||
util.safeRename(self._metadataTempFile, self._metadataFile)
|
||||
|
||||
self._loadMetadata()
|
||||
self._sendUpdateTrigger("gcodeFiles")
|
||||
|
||||
def _getBasicFilename(self, filename):
|
||||
if filename.startswith(self._uploadFolder):
|
||||
return filename[len(self._uploadFolder + os.path.sep):]
|
||||
else:
|
||||
return filename
|
||||
|
||||
#~~ callback handling
|
||||
|
||||
def registerCallback(self, callback):
|
||||
self._callbacks.append(callback)
|
||||
|
||||
def unregisterCallback(self, callback):
|
||||
if callback in self._callbacks:
|
||||
self._callbacks.remove(callback)
|
||||
|
||||
def _sendUpdateTrigger(self, type):
|
||||
for callback in self._callbacks:
|
||||
try: callback.sendUpdateTrigger(type)
|
||||
except: pass
|
||||
|
||||
#~~ file handling
|
||||
|
||||
def addFile(self, file, destination, uploadCallback=None):
|
||||
"""
|
||||
Adds the given file for the given destination to the systems. Takes care of slicing if enabled and
|
||||
necessary.
|
||||
|
||||
If the file's processing won't be finished directly with the return from this method but happen
|
||||
asynchronously in the background (e.g. due to slicing), returns a tuple containing the just added file's
|
||||
filename and False. Otherwise returns a tuple (filename, True).
|
||||
"""
|
||||
if not file or not destination:
|
||||
return None, True
|
||||
|
||||
curaEnabled = self._settings.getBoolean(["cura", "enabled"])
|
||||
filename = file.filename
|
||||
|
||||
absolutePath = self.getAbsolutePath(filename, mustExist=False)
|
||||
gcode = isGcodeFileName(filename)
|
||||
|
||||
if absolutePath is None or (not curaEnabled and not gcode):
|
||||
return None, True
|
||||
|
||||
file.save(absolutePath)
|
||||
|
||||
if gcode:
|
||||
return self.processGcode(absolutePath, destination, uploadCallback), True
|
||||
else:
|
||||
if curaEnabled and isSTLFileName(filename):
|
||||
self.processStl(absolutePath, destination, uploadCallback)
|
||||
return filename, False
|
||||
|
||||
def getFutureFileName(self, file):
|
||||
if not file:
|
||||
return None
|
||||
|
||||
absolutePath = self.getAbsolutePath(file.filename, mustExist=False)
|
||||
if absolutePath is None:
|
||||
return None
|
||||
|
||||
return self._getBasicFilename(absolutePath)
|
||||
|
||||
def processStl(self, absolutePath, destination, uploadCallback=None):
|
||||
from octoprint.slicers.cura import CuraFactory
|
||||
|
||||
cura = CuraFactory.create_slicer()
|
||||
gcodePath = genGcodeFileName(absolutePath)
|
||||
config = self._settings.get(["cura", "config"])
|
||||
|
||||
slicingStart = time.time()
|
||||
|
||||
def stlProcessed(stlPath, gcodePath, error=None):
|
||||
if error:
|
||||
eventManager().fire("SlicingFailed", {"stl": self._getBasicFilename(stlPath), "gcode": self._getBasicFilename(gcodePath), "reason": error})
|
||||
if os.path.exists(stlPath):
|
||||
os.remove(stlPath)
|
||||
else:
|
||||
slicingStop = time.time()
|
||||
eventManager().fire("SlicingDone", {"stl": self._getBasicFilename(stlPath), "gcode": self._getBasicFilename(gcodePath), "time": "%.2f" % (slicingStop - slicingStart)})
|
||||
self.processGcode(gcodePath, destination, uploadCallback)
|
||||
|
||||
eventManager().fire("SlicingStarted", {"stl": self._getBasicFilename(absolutePath), "gcode": self._getBasicFilename(gcodePath)})
|
||||
cura.process_file(config, gcodePath, absolutePath, stlProcessed, [absolutePath, gcodePath])
|
||||
|
||||
def processGcode(self, absolutePath, destination, uploadCallback=None):
|
||||
if absolutePath is None:
|
||||
return None
|
||||
|
||||
filename = self._getBasicFilename(absolutePath)
|
||||
|
||||
if filename in self._metadata.keys():
|
||||
# delete existing metadata entry, since the file is going to get overwritten
|
||||
del self._metadata[filename]
|
||||
self._metadataDirty = True
|
||||
self._saveMetadata()
|
||||
|
||||
self._metadataAnalyzer.addFileToQueue(os.path.basename(absolutePath))
|
||||
|
||||
if uploadCallback is not None:
|
||||
uploadCallback(filename, absolutePath, destination)
|
||||
return filename
|
||||
|
||||
def getFutureFilename(self, file):
|
||||
if not file:
|
||||
return None
|
||||
|
||||
absolutePath = self.getAbsolutePath(file.filename, mustExist=False)
|
||||
if absolutePath is None:
|
||||
return None
|
||||
|
||||
return self._getBasicFilename(absolutePath)
|
||||
|
||||
def removeFile(self, filename):
|
||||
filename = self._getBasicFilename(filename)
|
||||
absolutePath = self.getAbsolutePath(filename)
|
||||
stlPath = genStlFileName(absolutePath)
|
||||
|
||||
if absolutePath is None:
|
||||
return
|
||||
|
||||
os.remove(absolutePath)
|
||||
if os.path.exists(stlPath):
|
||||
os.remove(stlPath)
|
||||
|
||||
if filename in self._metadata.keys():
|
||||
del self._metadata[filename]
|
||||
self._metadataDirty = True
|
||||
self._saveMetadata()
|
||||
|
||||
def getAbsolutePath(self, filename, mustExist=True):
|
||||
"""
|
||||
Returns the absolute path of the given filename in the correct upload folder.
|
||||
|
||||
Ensures that the file
|
||||
<ul>
|
||||
<li>has any of the extensions listed in SUPPORTED_EXTENSIONS</li>
|
||||
<li>exists and is a file (not a directory) if "mustExist" is set to True</li>
|
||||
</ul>
|
||||
|
||||
@param filename the name of the file for which to determine the absolute path
|
||||
@param mustExist if set to true, the method also checks if the file exists and is a file
|
||||
@return the absolute path of the file or None if the file is not valid
|
||||
"""
|
||||
filename = self._getBasicFilename(filename)
|
||||
|
||||
if not util.isAllowedFile(filename.lower(), set(SUPPORTED_EXTENSIONS)):
|
||||
return None
|
||||
|
||||
# TODO: detect which type of file and add in the extra folder portion
|
||||
secure = os.path.join(self._uploadFolder, secure_filename(self._getBasicFilename(filename)))
|
||||
if mustExist and (not os.path.exists(secure) or not os.path.isfile(secure)):
|
||||
return None
|
||||
|
||||
return secure
|
||||
|
||||
def getAllFileData(self):
|
||||
files = []
|
||||
for osFile in os.listdir(self._uploadFolder):
|
||||
fileData = self.getFileData(osFile)
|
||||
if fileData is not None:
|
||||
files.append(fileData)
|
||||
return files
|
||||
|
||||
def getFileData(self, filename):
|
||||
if not filename:
|
||||
return
|
||||
|
||||
filename = self._getBasicFilename(filename)
|
||||
|
||||
# TODO: Make this more robust when STLs will be viewable from the client
|
||||
if isSTLFileName(filename):
|
||||
return
|
||||
|
||||
absolutePath = self.getAbsolutePath(filename)
|
||||
if absolutePath is None:
|
||||
return None
|
||||
|
||||
statResult = os.stat(absolutePath)
|
||||
fileData = {
|
||||
"name": filename,
|
||||
"size": util.getFormattedSize(statResult.st_size),
|
||||
"bytes": statResult.st_size,
|
||||
"date": util.getFormattedDateTime(datetime.datetime.fromtimestamp(statResult.st_ctime))
|
||||
}
|
||||
|
||||
# enrich with additional metadata from analysis if available
|
||||
if filename in self._metadata.keys():
|
||||
for key in self._metadata[filename].keys():
|
||||
if key == "prints":
|
||||
val = self._metadata[filename][key]
|
||||
formattedLast = None
|
||||
if "last" in val and val["last"] is not None:
|
||||
formattedLast = {
|
||||
"date": util.getFormattedDateTime(datetime.datetime.fromtimestamp(val["last"]["date"])),
|
||||
"success": val["last"]["success"]
|
||||
}
|
||||
formattedPrints = {
|
||||
"success": val["success"],
|
||||
"failure": val["failure"],
|
||||
"last": formattedLast
|
||||
}
|
||||
fileData["prints"] = formattedPrints
|
||||
else:
|
||||
fileData[key] = self._metadata[filename][key]
|
||||
|
||||
return fileData
|
||||
|
||||
def getFileMetadata(self, filename):
|
||||
filename = self._getBasicFilename(filename)
|
||||
if filename in self._metadata.keys():
|
||||
return self._metadata[filename]
|
||||
else:
|
||||
return {
|
||||
"prints": {
|
||||
"success": 0,
|
||||
"failure": 0,
|
||||
"last": None
|
||||
}
|
||||
}
|
||||
|
||||
def setFileMetadata(self, filename, metadata):
|
||||
filename = self._getBasicFilename(filename)
|
||||
self._metadata[filename] = metadata
|
||||
self._metadataDirty = True
|
||||
|
||||
#~~ print job data
|
||||
|
||||
def printSucceeded(self, filename):
|
||||
filename = self._getBasicFilename(filename)
|
||||
absolutePath = self.getAbsolutePath(filename)
|
||||
if absolutePath is None:
|
||||
return
|
||||
|
||||
metadata = self.getFileMetadata(filename)
|
||||
metadata["prints"]["success"] += 1
|
||||
metadata["prints"]["last"] = {
|
||||
"date": time.time(),
|
||||
"success": True
|
||||
}
|
||||
self.setFileMetadata(filename, metadata)
|
||||
self._saveMetadata()
|
||||
|
||||
def printFailed(self, filename):
|
||||
filename = self._getBasicFilename(filename)
|
||||
absolutePath = self.getAbsolutePath(filename)
|
||||
if absolutePath is None:
|
||||
return
|
||||
|
||||
metadata = self.getFileMetadata(filename)
|
||||
metadata["prints"]["failure"] += 1
|
||||
metadata["prints"]["last"] = {
|
||||
"date": time.time(),
|
||||
"success": False
|
||||
}
|
||||
self.setFileMetadata(filename, metadata)
|
||||
self._saveMetadata()
|
||||
|
||||
def changeLastPrintSuccess(self, filename, succeeded):
|
||||
filename = self._getBasicFilename(filename)
|
||||
absolutePath = self.getAbsolutePath(filename)
|
||||
if absolutePath is None:
|
||||
return
|
||||
|
||||
metadata = self.getFileMetadata(filename)
|
||||
if metadata is None:
|
||||
return
|
||||
|
||||
if "prints" in metadata.keys():
|
||||
if "last" in metadata.keys() and metadata["prints"]["last"] is not None:
|
||||
currentSucceeded = metadata["prints"]["last"]["success"]
|
||||
if currentSucceeded != succeeded:
|
||||
metadata["prints"]["last"]["success"] = succeeded
|
||||
if currentSucceeded:
|
||||
# last print job was counted as success but actually failed
|
||||
metadata["prints"]["success"] -= 1
|
||||
metadata["prints"]["failure"] += 1
|
||||
else:
|
||||
# last print job was counted as a failure but actually succeeded
|
||||
metadata["prints"]["success"] += 1
|
||||
metadata["prints"]["failure"] -= 1
|
||||
self.setFileMetadata(filename, metadata)
|
||||
self._saveMetadata()
|
||||
|
||||
#~~ analysis control
|
||||
|
||||
def pauseAnalysis(self):
|
||||
self._metadataAnalyzer.pause()
|
||||
|
||||
def resumeAnalysis(self):
|
||||
self._metadataAnalyzer.resume()
|
||||
|
||||
class MetadataAnalyzer:
|
||||
def __init__(self, getPathCallback, loadedCallback):
|
||||
self._logger = logging.getLogger(__name__)
|
||||
|
||||
self._getPathCallback = getPathCallback
|
||||
self._loadedCallback = loadedCallback
|
||||
|
||||
self._active = threading.Event()
|
||||
self._active.set()
|
||||
|
||||
self._currentFile = None
|
||||
self._currentProgress = None
|
||||
|
||||
self._queue = Queue.PriorityQueue()
|
||||
self._gcode = None
|
||||
|
||||
self._worker = threading.Thread(target=self._work)
|
||||
self._worker.daemon = True
|
||||
self._worker.start()
|
||||
|
||||
def addFileToQueue(self, filename):
|
||||
self._logger.debug("Adding file %s to analysis queue (high priority)" % filename)
|
||||
self._queue.put((0, filename))
|
||||
|
||||
def addFileToBacklog(self, filename):
|
||||
self._logger.debug("Adding file %s to analysis backlog (low priority)" % filename)
|
||||
self._queue.put((100, filename))
|
||||
|
||||
def working(self):
|
||||
return self.isActive() and not (self._queue.empty() and self._currentFile is None)
|
||||
|
||||
def isActive(self):
|
||||
return self._active.is_set()
|
||||
|
||||
def pause(self):
|
||||
self._logger.debug("Pausing Gcode analyzer")
|
||||
self._active.clear()
|
||||
if self._gcode is not None:
|
||||
self._logger.debug("Aborting running analysis, will restart when Gcode analyzer is resumed")
|
||||
self._gcode.abort()
|
||||
|
||||
def resume(self):
|
||||
self._logger.debug("Resuming Gcode analyzer")
|
||||
self._active.set()
|
||||
|
||||
def _work(self):
|
||||
aborted = None
|
||||
while True:
|
||||
self._active.wait()
|
||||
|
||||
if aborted is not None:
|
||||
filename = aborted
|
||||
aborted = None
|
||||
self._logger.debug("Got an aborted analysis job for file %s, processing this instead of first item in queue" % filename)
|
||||
else:
|
||||
(priority, filename) = self._queue.get()
|
||||
self._logger.debug("Processing file %s from queue (priority %d)" % (filename, priority))
|
||||
|
||||
try:
|
||||
self._analyzeGcode(filename)
|
||||
self._queue.task_done()
|
||||
except gcodeInterpreter.AnalysisAborted:
|
||||
aborted = filename
|
||||
self._logger.debug("Running analysis of file %s aborted" % filename)
|
||||
|
||||
def _analyzeGcode(self, filename):
|
||||
path = self._getPathCallback(filename)
|
||||
if path is None or not os.path.exists(path):
|
||||
return
|
||||
|
||||
self._currentFile = filename
|
||||
self._currentProgress = 0
|
||||
|
||||
try:
|
||||
self._logger.debug("Starting analysis of file %s" % filename)
|
||||
self._gcode = gcodeInterpreter.gcode()
|
||||
self._gcode.progressCallback = self._onParsingProgress
|
||||
self._gcode.load(path)
|
||||
self._logger.debug("Analysis of file %s finished, notifying callback" % filename)
|
||||
self._loadedCallback(self._currentFile, self._gcode)
|
||||
finally:
|
||||
self._gcode = None
|
||||
self._currentProgress = None
|
||||
self._currentFile = None
|
||||
|
||||
def _onParsingProgress(self, progress):
|
||||
self._currentProgress = progress
|
||||
@@ -0,0 +1,4 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
from . import handlers
|
||||
@@ -0,0 +1,83 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging.handlers
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
|
||||
class CleaningTimedRotatingFileHandler(logging.handlers.TimedRotatingFileHandler):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
logging.handlers.TimedRotatingFileHandler.__init__(self, *args, **kwargs)
|
||||
|
||||
# clean up old files on handler start
|
||||
if self.backupCount > 0:
|
||||
for s in self.getFilesToDelete():
|
||||
os.remove(s)
|
||||
|
||||
|
||||
class SerialLogHandler(logging.handlers.RotatingFileHandler):
|
||||
|
||||
_do_rollover = False
|
||||
_suffix_template = "%Y-%m-%d_%H-%M-%S"
|
||||
_file_pattern = re.compile(r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}$")
|
||||
|
||||
@classmethod
|
||||
def on_open_connection(cls):
|
||||
cls._do_rollover = True
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
logging.handlers.RotatingFileHandler.__init__(self, *args, **kwargs)
|
||||
self.cleanupFiles()
|
||||
|
||||
def emit(self, record):
|
||||
logging.handlers.RotatingFileHandler.emit(self, record)
|
||||
|
||||
def shouldRollover(self, record):
|
||||
return self.__class__._do_rollover
|
||||
|
||||
def getFilesToDelete(self):
|
||||
"""
|
||||
Determine the files to delete when rolling over.
|
||||
"""
|
||||
dirName, baseName = os.path.split(self.baseFilename)
|
||||
fileNames = os.listdir(dirName)
|
||||
result = []
|
||||
prefix = baseName + "."
|
||||
plen = len(prefix)
|
||||
for fileName in fileNames:
|
||||
if fileName[:plen] == prefix:
|
||||
suffix = fileName[plen:]
|
||||
if self.__class__._file_pattern.match(suffix):
|
||||
result.append(os.path.join(dirName, fileName))
|
||||
result.sort()
|
||||
if len(result) < self.backupCount:
|
||||
result = []
|
||||
else:
|
||||
result = result[:len(result) - self.backupCount]
|
||||
return result
|
||||
|
||||
def cleanupFiles(self):
|
||||
if self.backupCount > 0:
|
||||
for path in self.getFilesToDelete():
|
||||
os.remove(path)
|
||||
|
||||
def doRollover(self):
|
||||
self.__class__._do_rollover = False
|
||||
|
||||
if self.stream:
|
||||
self.stream.close()
|
||||
self.stream = None
|
||||
|
||||
if os.path.exists(self.baseFilename):
|
||||
# figure out creation date/time to use for file suffix
|
||||
t = time.localtime(os.stat(self.baseFilename).st_mtime)
|
||||
dfn = self.baseFilename + "." + time.strftime(self.__class__._suffix_template, t)
|
||||
if os.path.exists(dfn):
|
||||
os.remove(dfn)
|
||||
os.rename(self.baseFilename, dfn)
|
||||
|
||||
self.cleanupFiles()
|
||||
if not self.delay:
|
||||
self.stream = self._open()
|
||||