Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d7f8a2a64 | ||
|
|
8869748ecc | ||
|
|
e0b0f2ae18 | ||
|
|
440ccf165e | ||
|
|
e5caa3d0bf | ||
|
|
a821346b07 | ||
|
|
0ac9ea518c | ||
|
|
9f80aefcc9 | ||
|
|
c1fe8f5a35 | ||
|
|
fcecb5c0f0 | ||
|
|
25005b547c | ||
|
|
dbfe7fece1 | ||
|
|
9c5d996ea2 | ||
|
|
b8e7cfb506 | ||
|
|
822f757f9d | ||
|
|
b04aff7d5e | ||
|
|
028425542f | ||
|
|
339d1df5a9 | ||
|
|
2abe67a24c | ||
|
|
47267abcd1 | ||
|
|
23f130da58 | ||
|
|
9af6b42bdd | ||
|
|
7cb910a69a | ||
|
|
c30db16085 | ||
|
|
832a0c88aa | ||
|
|
972c2823a0 | ||
|
|
f10bfa67ca | ||
|
|
fb834f81ee | ||
|
|
957ba43320 | ||
|
|
133850f61c | ||
|
|
f782cfe83f | ||
|
|
70254e910c | ||
|
|
f981cca47e | ||
|
|
0224037478 | ||
|
|
e4914b8bd3 | ||
|
|
da2c9632ea | ||
|
|
8a3a87efac | ||
|
|
8cdae335a2 | ||
|
|
75ad9aeeb6 | ||
|
|
709f7a76f1 | ||
|
|
c04fade9a7 | ||
|
|
2ecbd9f8c8 | ||
|
|
3e24b68b45 | ||
|
|
46a0c3057f | ||
|
|
902407ed92 | ||
|
|
ccbe9311d7 | ||
|
|
82dffa50f7 | ||
|
|
0d51e5bb1c | ||
|
|
fd7fbcc113 | ||
|
|
5791562c6a | ||
|
|
6582740a1e | ||
|
|
73ce6f43ab | ||
|
|
bc746a49e9 | ||
|
|
e8d5449a8f | ||
|
|
01f5a58709 | ||
|
|
61769262f6 | ||
|
|
faa8174846 | ||
|
|
0eb441058e | ||
|
|
32a31a7d4a | ||
|
|
01bae0c95c | ||
|
|
ada873be1d | ||
|
|
a95407c815 | ||
|
|
e0722e6c28 | ||
|
|
e32aa3f2c8 | ||
|
|
8e764e34ee | ||
|
|
cfb0eb84e2 | ||
|
|
effefffe74 | ||
|
|
8148fd7679 | ||
|
|
f8079c3f50 | ||
|
|
4c3e44d50e | ||
|
|
a2ccf414e6 | ||
|
|
02c42ecdc0 | ||
|
|
c6dfdf8d4b | ||
|
|
10af43285b | ||
|
|
25dc4528af | ||
|
|
bb61bbb2b4 | ||
|
|
e6ec48b8a1 | ||
|
|
98c7ad0c20 | ||
|
|
52bb94e272 | ||
|
|
e0f8ae8986 | ||
|
|
291fa88a82 | ||
|
|
88b622e282 | ||
|
|
3fcd5adfbd | ||
|
|
1f9c9bed42 | ||
|
|
f1401d3f1e | ||
|
|
5216729834 | ||
|
|
bab4782b8c | ||
|
|
eada72a4d9 | ||
|
|
088b4a8059 | ||
|
|
90aa5ed3d4 | ||
|
|
3c8d2f2df5 | ||
|
|
283c44e35e | ||
|
|
125673b846 | ||
|
|
fb6ff04013 | ||
|
|
6a3f1d28fb | ||
|
|
2abff3b589 | ||
|
|
c84f49e852 | ||
|
|
de0660f678 | ||
|
|
ee36e2abd3 | ||
|
|
11eb731b3d | ||
|
|
01d37fc9ee | ||
|
|
59cbfaf8ff | ||
|
|
b8e4ac21d0 | ||
|
|
2db2532c2f | ||
|
|
d42c74d34a | ||
|
|
551d6aab68 | ||
|
|
2c87133f3d | ||
|
|
296af89b02 | ||
|
|
18ad764ef5 | ||
|
|
ec86b3328e | ||
|
|
820ad59539 | ||
|
|
b3fff6e95f | ||
|
|
763888e83a | ||
|
|
c6bb825f7e | ||
|
|
c3ba9c8453 | ||
|
|
a3ba266a6b | ||
|
|
9a8b8d86d5 | ||
|
|
b108fc939c | ||
|
|
40082456c1 | ||
|
|
541844ce3c | ||
|
|
33147b0305 | ||
|
|
55f5c472a0 | ||
|
|
d166bafa8d | ||
|
|
00e6a3856f | ||
|
|
1587ee6402 | ||
|
|
eadb4a5bb6 | ||
|
|
5c63e618b1 | ||
|
|
be3907c7d1 | ||
|
|
8732ec9756 | ||
|
|
7d3d3408eb | ||
|
|
6afb291440 | ||
|
|
522ee49b5b | ||
|
|
de9fdf79c4 | ||
|
|
26dbf59251 | ||
|
|
8ad0aadb52 | ||
|
|
87921061d9 | ||
|
|
6812001639 | ||
|
|
00616a3d73 | ||
|
|
a7a78c11d4 | ||
|
|
60c7974aa4 | ||
|
|
441db2dbbc | ||
|
|
066d3d7422 | ||
|
|
98b71a5870 | ||
|
|
77989d2a76 | ||
|
|
f35fe32a92 | ||
|
|
b79f669351 | ||
|
|
528bd90d02 | ||
|
|
b8d23c8bc1 | ||
|
|
bb822fb9dd | ||
|
|
77aeb6146e | ||
|
|
de253e5086 | ||
|
|
986591aed4 | ||
|
|
48f87b2979 | ||
|
|
ec12bd7cd4 | ||
|
|
b3b19dc136 | ||
|
|
9f1abee023 | ||
|
|
fca7005bfa | ||
|
|
fcf7358855 | ||
|
|
c050bd15ac | ||
|
|
3e236dc57d | ||
|
|
aa0ea299ea | ||
|
|
57a58b3bd7 | ||
|
|
67005577b7 | ||
|
|
b1f9e070a4 | ||
|
|
b5aae0b8fa | ||
|
|
1b5b243760 | ||
|
|
6545f9a816 | ||
|
|
c11288ff65 | ||
|
|
ed70944f69 | ||
|
|
88cb28cec9 | ||
|
|
15c390b199 | ||
|
|
8b09b11faa | ||
|
|
bad3612ed2 | ||
|
|
b079978384 | ||
|
|
13558c01f9 | ||
|
|
777c02135e | ||
|
|
793bb714eb | ||
|
|
8229842334 | ||
|
|
ef6b39757b | ||
|
|
2cae028d47 | ||
|
|
38a711ac56 | ||
|
|
a8747f7e36 | ||
|
|
17e6f5d508 | ||
|
|
133a4658ee | ||
|
|
0a2e2ed297 | ||
|
|
86934c8863 | ||
|
|
13eb5ec7ed | ||
|
|
6ce6160f3d | ||
|
|
9bdbb930ad | ||
|
|
6b41dbc12b | ||
|
|
3f4a70cf92 | ||
|
|
41eb9481b3 | ||
|
|
743d590d52 | ||
|
|
900e8a2aaf | ||
|
|
06816fb8dc | ||
|
|
cc0a17f2ac | ||
|
|
9b1b4420a3 | ||
|
|
263925625b | ||
|
|
f72dfb48e1 | ||
|
|
e064400900 | ||
|
|
03d24ff3b9 | ||
|
|
107954021b | ||
|
|
99e1c3ac00 | ||
|
|
2ea8981a48 | ||
|
|
d1f54b5a22 | ||
|
|
1c55a12207 | ||
|
|
58dba3a79a | ||
|
|
e9d17f0f0f | ||
|
|
4ea76f84c5 | ||
|
|
ac345daba2 | ||
|
|
3cf694a333 | ||
|
|
26c8c5f03f | ||
|
|
f2bd5d605e | ||
|
|
0560e9da02 | ||
|
|
cec8d15b46 | ||
|
|
38c9840e30 | ||
|
|
f77e49be7f | ||
|
|
00cb71898a | ||
|
|
328c08b775 | ||
|
|
ca7aa322c3 | ||
|
|
5c20e264e2 | ||
|
|
aa65671ac7 | ||
|
|
14bd0632c0 | ||
|
|
d174d7ab80 | ||
|
|
a2d38016ec | ||
|
|
cf25291dee | ||
|
|
6d4f8266cd | ||
|
|
991dab58d5 | ||
|
|
0de0e4ea9b | ||
|
|
9b3c1947d9 | ||
|
|
364d692db2 | ||
|
|
b002e41a00 | ||
|
|
f3080daa47 | ||
|
|
06ab173b21 | ||
|
|
26789a2bb7 | ||
|
|
4a5308b4ab | ||
|
|
f4eb60dc6a | ||
|
|
a0a8d641c3 | ||
|
|
e32f469de4 | ||
|
|
8bc99f928c | ||
|
|
6221175649 | ||
|
|
b252da477c | ||
|
|
8a977e8777 | ||
|
|
65753a0539 | ||
|
|
f1518e6fe6 | ||
|
|
c7e248b142 | ||
|
|
59ca2188d9 | ||
|
|
c479c5455c | ||
|
|
ebfc6f2f26 | ||
|
|
0b1db60d8b | ||
|
|
f9c738541f | ||
|
|
6c21911eb0 | ||
|
|
fd7fdec565 | ||
|
|
b892b43ee1 | ||
|
|
14c1dfe9a3 | ||
|
|
1180e4e27b | ||
|
|
b2d70de144 | ||
|
|
0bb343e1d3 | ||
|
|
92b048c789 | ||
|
|
a6eac3911b | ||
|
|
80bc82df55 | ||
|
|
651a8f315b | ||
|
|
69f9c523f9 | ||
|
|
2364474ea6 | ||
|
|
00067768da | ||
|
|
3ef97bf4d7 | ||
|
|
5aad696c5c | ||
|
|
9837f67140 | ||
|
|
dc53942015 | ||
|
|
79581c390a | ||
|
|
c30e54d75c | ||
|
|
55adb7ca33 | ||
|
|
980b72607e | ||
|
|
ce16f861b3 | ||
|
|
51406b7c42 | ||
|
|
2fcbf49348 | ||
|
|
5f34d5df27 | ||
|
|
a0df4e78b5 | ||
|
|
772ee76e76 | ||
|
|
532ac0264d | ||
|
|
caaaa2e4e9 | ||
|
|
02aad445aa | ||
|
|
bf7d4173cd | ||
|
|
0ff0da4a7b | ||
|
|
b2552795dc | ||
|
|
4b5eff5ec6 | ||
|
|
bedcbb80be | ||
|
|
09509ca61d | ||
|
|
8bf3f4ff50 | ||
|
|
2d925a2665 | ||
|
|
490ef61e19 | ||
|
|
a1548e1c1d | ||
|
|
77e48335da | ||
|
|
14b8fd7fa5 | ||
|
|
0afa854763 | ||
|
|
3d1f3be4fc | ||
|
|
38c410f80f | ||
|
|
46bd2ce7e9 | ||
|
|
10fc631700 | ||
|
|
8f78784be3 | ||
|
|
4479dd0222 | ||
|
|
9466e5d001 | ||
|
|
4b3d883639 | ||
|
|
4439f5aad0 | ||
|
|
cb50646134 | ||
|
|
c8e5820c7d | ||
|
|
8e03dbfa14 | ||
|
|
8372b1f433 | ||
|
|
b6cf895c56 | ||
|
|
25e05418d8 | ||
|
|
2e134ba8b0 | ||
|
|
76f4ffc0a1 | ||
|
|
21cc58ad14 | ||
|
|
b65a3bb903 | ||
|
|
e49adcac85 | ||
|
|
813c2be35a | ||
|
|
3ad4b7b0a5 | ||
|
|
e7b455f880 | ||
|
|
a9819cc2f9 | ||
|
|
0b95894da1 | ||
|
|
9c3d7bbbc3 | ||
|
|
01b3b8a0e0 | ||
|
|
50983c8524 | ||
|
|
e99f762974 | ||
|
|
468155c9c8 | ||
|
|
7df78defb1 | ||
|
|
d0aa81c977 | ||
|
|
13de4b4b1d | ||
|
|
4fba88d197 | ||
|
|
77753ca026 | ||
|
|
fd53f47f86 | ||
|
|
af4f97f2df | ||
|
|
44f5916cd4 | ||
|
|
4e80d69e51 | ||
|
|
020180a4a7 | ||
|
|
a21934abba | ||
|
|
42ac133436 | ||
|
|
42018ae29a | ||
|
|
054bbd8a9b | ||
|
|
4093995ba0 | ||
|
|
d1fdbd5080 | ||
|
|
abfcc6e5aa | ||
|
|
b89b6970c6 | ||
|
|
40eb3c1072 | ||
|
|
178131945e | ||
|
|
452ee8e156 | ||
|
|
807b44a35e | ||
|
|
f4e7ab424b | ||
|
|
e88e6ba292 | ||
|
|
25c56a5402 | ||
|
|
c5e7212fa2 | ||
|
|
0f8f4579d6 | ||
|
|
12126621c5 | ||
|
|
a093dbc36f | ||
|
|
0f325b95c1 | ||
|
|
7fc0f48659 | ||
|
|
dfe345007e | ||
|
|
4fe6e0545a | ||
|
|
c84e199e87 | ||
|
|
791f0457fb | ||
|
|
56ad1841d4 | ||
|
|
b161a1f093 | ||
|
|
79f7a5a1e7 | ||
|
|
679674df22 | ||
|
|
5989d243d3 | ||
|
|
97cb0088f6 | ||
|
|
2ed36ed383 | ||
|
|
12b8a54081 | ||
|
|
a35e145649 | ||
|
|
f77be701a2 | ||
|
|
e9401b7090 | ||
|
|
b138c2bccf | ||
|
|
76c2113ad4 | ||
|
|
bfe5bc179c | ||
|
|
d7298cee06 | ||
|
|
fbcbb3f5f7 | ||
|
|
0c2169dd9c | ||
|
|
7828258fdb | ||
|
|
edb4d0fe04 | ||
|
|
69dec6e83f | ||
|
|
4d27de032d | ||
|
|
7073c12444 | ||
|
|
60be6349f5 | ||
|
|
ec55890c55 | ||
|
|
e508898564 | ||
|
|
c33e9e4c85 | ||
|
|
1f9fe8c868 | ||
|
|
8f2e4ad978 | ||
|
|
b82d955ec7 | ||
|
|
832d2f4155 | ||
|
|
c336452f6c | ||
|
|
a9b6edde2b | ||
|
|
d59ef5c711 | ||
|
|
375480c707 | ||
|
|
60cacb9447 | ||
|
|
a21f5c4497 | ||
|
|
c159ab7fe2 | ||
|
|
251ed7a2a2 | ||
|
|
e949e0198f | ||
|
|
1a6dbb3f4a | ||
|
|
10e834f623 | ||
|
|
5ce34f774e | ||
|
|
0456896d71 | ||
|
|
e06c09e206 | ||
|
|
a6d3299b91 | ||
|
|
0a7f2a209b | ||
|
|
67f7580506 | ||
|
|
aab3a7bd63 | ||
|
|
d0f5592421 | ||
|
|
bb6ea4d81b | ||
|
|
7e32e5be8f | ||
|
|
266cae3509 | ||
|
|
0dcbffb9d2 | ||
|
|
fb8c56be57 | ||
|
|
2bc0c4a77f | ||
|
|
187c09e7da | ||
|
|
5c62b33967 | ||
|
|
5db9acb359 | ||
|
|
962d6ab27f | ||
|
|
21699699b6 | ||
|
|
8fec0859d9 | ||
|
|
1b9ff1b0e2 | ||
|
|
ee2d644239 | ||
|
|
a50db4b08e | ||
|
|
6f5707a0fc | ||
|
|
cf053ddbed | ||
|
|
b1101f5150 | ||
|
|
3a9d581423 | ||
|
|
142a1b0dcb | ||
|
|
a33f44ea25 | ||
|
|
23e58d2fc1 | ||
|
|
2e897f19ac | ||
|
|
16e96743c5 | ||
|
|
4c6c764c5c | ||
|
|
e86ba9a395 | ||
|
|
c1c09d417d | ||
|
|
f8d225a768 | ||
|
|
4c3f4c2a8b | ||
|
|
cc3d34635e | ||
|
|
c81c93896b | ||
|
|
3cdc59d7f1 | ||
|
|
5156cdbe68 | ||
|
|
0915c45f72 | ||
|
|
b2c1bb4b53 | ||
|
|
3bb06a1a33 | ||
|
|
8ad165c625 | ||
|
|
841b86a017 | ||
|
|
c0c249ece9 | ||
|
|
5fc194accd | ||
|
|
ed6c01c12a | ||
|
|
e309646504 | ||
|
|
96ee80afd2 | ||
|
|
8aec836d22 | ||
|
|
697df4f3ce | ||
|
|
ac3f4d598c | ||
|
|
836fbef6d8 | ||
|
|
ce4cf38547 | ||
|
|
38a5da1c35 | ||
|
|
b205e84d4b | ||
|
|
7ab4d12548 | ||
|
|
f6c3e5991d | ||
|
|
188b59a319 | ||
|
|
b3594e367e | ||
|
|
12d40122d1 | ||
|
|
2e11a7b860 | ||
|
|
f20185db3a | ||
|
|
0db323d0c5 | ||
|
|
639d8d4c5f | ||
|
|
5e0b53b651 | ||
|
|
1ebfa4b1dd | ||
|
|
35c45df86c | ||
|
|
a50e8bbbb5 | ||
|
|
4665070601 | ||
|
|
b34fc8e05e | ||
|
|
a3ece229f2 | ||
|
|
fc53febb87 | ||
|
|
dad956b5c9 | ||
|
|
981110d4b2 | ||
|
|
cbd94a9020 | ||
|
|
77db00a2ea | ||
|
|
665078e1a4 | ||
|
|
cfae406a4c | ||
|
|
00c14e6936 | ||
|
|
6a1b162e7b | ||
|
|
a2fd39b3c4 | ||
|
|
bda2fd94e3 | ||
|
|
9e207ca8a1 | ||
|
|
5d321926bb | ||
|
|
3d3e0212c6 | ||
|
|
e3d44d7d06 | ||
|
|
d39c124f35 | ||
|
|
8603ea4b6f | ||
|
|
a681048df6 | ||
|
|
d689496802 | ||
|
|
5a23b46c11 | ||
|
|
2b96e57923 | ||
|
|
885e88a5e0 | ||
|
|
fe481e12b3 | ||
|
|
cbdf85c27a | ||
|
|
674637f6b2 | ||
|
|
9056f5d610 | ||
|
|
b55c4ef5ca | ||
|
|
b9747d0f0e | ||
|
|
0feae3ba18 | ||
|
|
1cc3ddb03c | ||
|
|
33cafbbd8a | ||
|
|
d274a9c73d | ||
|
|
c3619a3795 | ||
|
|
dffb33727d | ||
|
|
78724163b1 | ||
|
|
b6a09abb83 | ||
|
|
77b6d83e0b | ||
|
|
7c6b85a0ad | ||
|
|
df038e6a4d | ||
|
|
ce1541e956 | ||
|
|
bd1d0e6073 | ||
|
|
ff89cdf6d0 | ||
|
|
76f58e05ec | ||
|
|
2a600d7d00 | ||
|
|
4a84fa95e4 | ||
|
|
557c761e80 | ||
|
|
10cb60acca | ||
|
|
5e55d637af | ||
|
|
8942d7d50d | ||
|
|
0ad09e422d | ||
|
|
0657160389 | ||
|
|
cfde6342a8 | ||
|
|
832c27ed18 | ||
|
|
59d78ba893 | ||
|
|
7770ee3d08 | ||
|
|
2d9ad41e49 | ||
|
|
821156c9d6 | ||
|
|
9e5982be29 | ||
|
|
39c87d19b7 | ||
|
|
d029abc8f3 | ||
|
|
7b5848b9c3 | ||
|
|
53bfbf5acf | ||
|
|
917c9e54ba | ||
|
|
d8d9c7fe64 | ||
|
|
6c0f2de780 | ||
|
|
700975d670 | ||
|
|
9fac314d71 | ||
|
|
9dfee34f01 | ||
|
|
dc8473bc4d | ||
|
|
c1c75f032d | ||
|
|
9ad180c02a | ||
|
|
7795320fc8 | ||
|
|
a54c8fbeb7 | ||
|
|
337957198b | ||
|
|
2bae87b85a | ||
|
|
51959319eb | ||
|
|
6d73e6557b | ||
|
|
4c65313c7f | ||
|
|
41cf85d9db | ||
|
|
3fbd477d15 | ||
|
|
2c73dd36c5 | ||
|
|
c91fe0c4fc | ||
|
|
3bfc4725d2 | ||
|
|
b6fbe6fafd | ||
|
|
263c297bed | ||
|
|
dba95ee94f | ||
|
|
f0b63a8e7f | ||
|
|
e166765f7f | ||
|
|
15e8bbe147 | ||
|
|
853bb2fc16 | ||
|
|
ccc3c4ef32 | ||
|
|
72898360f3 | ||
|
|
2caa10f15e | ||
|
|
399ec5a909 | ||
|
|
c844217f82 | ||
|
|
f32d7c434d | ||
|
|
844494a9d5 | ||
|
|
f1254622c5 | ||
|
|
060aa1274a | ||
|
|
fe0aa0301f | ||
|
|
cda48f3b71 | ||
|
|
c69ef1598a | ||
|
|
0161d915d6 | ||
|
|
f5fad5186e | ||
|
|
2817979c3d | ||
|
|
cc44c1a981 | ||
|
|
dda3a303d2 | ||
|
|
b79606da70 | ||
|
|
fb9131f67a | ||
|
|
358a252736 | ||
|
|
fd7c81c7fb | ||
|
|
a09b54d374 | ||
|
|
2a7cebfe55 | ||
|
|
0f6edabea3 | ||
|
|
45231ea7f8 | ||
|
|
c00b46ef5c | ||
|
|
251a1ea4b5 | ||
|
|
bba9d6cc18 | ||
|
|
9bcce4e56a | ||
|
|
6465175e09 | ||
|
|
fe585e7115 | ||
|
|
b84432c8a5 | ||
|
|
c6623c8883 | ||
|
|
ef01560199 | ||
|
|
1666a1f607 | ||
|
|
4109b2f6c2 | ||
|
|
9f32e91e05 | ||
|
|
7c8f148fa8 | ||
|
|
d1c6381792 | ||
|
|
a477268beb | ||
|
|
346f818707 | ||
|
|
956d9581c5 | ||
|
|
7828ab0bf9 | ||
|
|
41e9d96815 | ||
|
|
09d1025dfc | ||
|
|
163fd83bf5 | ||
|
|
e109bf0ca6 | ||
|
|
4d324c5239 | ||
|
|
8cbf5a74b3 | ||
|
|
b24851ca05 | ||
|
|
1219939189 | ||
|
|
d72c7c144e | ||
|
|
5c0a564592 | ||
|
|
d27dd26a61 | ||
|
|
52633d0433 | ||
|
|
ea3b7ab1da | ||
|
|
a01b9fe8d4 | ||
|
|
f1cf482919 | ||
|
|
18e14aa412 | ||
|
|
c3ad1d3691 | ||
|
|
35d9775e51 | ||
|
|
fda67f48ff | ||
|
|
e97c9f954d | ||
|
|
01ad9b8b14 | ||
|
|
2d105517c9 | ||
|
|
41d8b3476c | ||
|
|
97b2a02926 | ||
|
|
517fd6f3ab | ||
|
|
fb2f9ba593 | ||
|
|
3ec2d7bd14 | ||
|
|
675a54aa05 | ||
|
|
880b99faaf | ||
|
|
5535a9aeb0 | ||
|
|
3bc77ffe3d | ||
|
|
896aad3ab0 | ||
|
|
01e970553f | ||
|
|
6613d580f2 | ||
|
|
ac6900ffb6 | ||
|
|
6465b58384 | ||
|
|
fa73fd3c14 | ||
|
|
0a69dbeddb | ||
|
|
13714dc8d9 | ||
|
|
5a6edefec1 | ||
|
|
87be930a68 | ||
|
|
627d11fa51 | ||
|
|
315a80a7a7 | ||
|
|
1b91790f5f | ||
|
|
3e5923b21e | ||
|
|
c1fdbaa1e7 | ||
|
|
1c132c39ad | ||
|
|
7114462024 | ||
|
|
11b96005a9 | ||
|
|
fea6b5096c | ||
|
|
40e2fa6bf4 | ||
|
|
3006bde972 | ||
|
|
c7ae580c54 | ||
|
|
55762ee71a | ||
|
|
ebae1b475b | ||
|
|
61fbde4e51 | ||
|
|
6e793c2ba3 | ||
|
|
b38884db63 | ||
|
|
a49772fcf3 | ||
|
|
052796d5d2 | ||
|
|
559238ca3c | ||
|
|
fa16037e9a | ||
|
|
d298c3c672 | ||
|
|
d7b29a8725 | ||
|
|
136736d307 | ||
|
|
5d1a0eaa16 | ||
|
|
2d9c16e859 | ||
|
|
8a4934e6f8 | ||
|
|
a0e5f79483 | ||
|
|
ef6159cc96 | ||
|
|
ab42cc2a7f | ||
|
|
01cffafe77 | ||
|
|
d8f2630fd4 | ||
|
|
811c91955c | ||
|
|
01ebf8fba7 | ||
|
|
2dcd6e02b1 | ||
|
|
d845257cf4 | ||
|
|
c765e6e228 | ||
|
|
20e1219d9e | ||
|
|
14120f732b | ||
|
|
b7e2b0f794 | ||
|
|
f02fac20ed | ||
|
|
755bcaa311 | ||
|
|
aab98a7c9f | ||
|
|
3a984d41ff | ||
|
|
28d01e2fa6 | ||
|
|
2198add8e6 | ||
|
|
1de307e15d | ||
|
|
aab7b7f797 | ||
|
|
162e8c50d3 | ||
|
|
636d8e0faa | ||
|
|
62890ef73a | ||
|
|
79af90dd6a | ||
|
|
d15262e7cc | ||
|
|
41f0ed0124 | ||
|
|
ff595a7e31 | ||
|
|
444312d7d9 | ||
|
|
c3740dd59d | ||
|
|
c203d79434 | ||
|
|
6dce2bc250 | ||
|
|
cad66fcea7 | ||
|
|
ed46d9967a | ||
|
|
6aae0017c4 | ||
|
|
ebe93f9a6d | ||
|
|
a16680b453 | ||
|
|
9f963696c8 | ||
|
|
7f0eb8d895 | ||
|
|
e1eaf4eb8e | ||
|
|
b8cbe02b7a | ||
|
|
4cc410133b | ||
|
|
216f05d553 | ||
|
|
7beabf953c | ||
|
|
b7c078f429 | ||
|
|
7331bc2bf5 | ||
|
|
59f49f392e | ||
|
|
997e0b510b | ||
|
|
1f9b8f40cd | ||
|
|
8630ec5beb | ||
|
|
e8349d6593 | ||
|
|
9b457cce9e | ||
|
|
b2229ae24a | ||
|
|
189c842881 | ||
|
|
6963e5e495 | ||
|
|
7b6642f7c2 | ||
|
|
5d97dc4b40 | ||
|
|
b453897ea3 | ||
|
|
54a9a7b906 | ||
|
|
a3f24c59e9 | ||
|
|
42f4fad257 | ||
|
|
eaadf8743b | ||
|
|
b0cd742bf4 | ||
|
|
7ab3eabe0f | ||
|
|
8f3b6dca79 | ||
|
|
29a2c6abec | ||
|
|
9a464e01d8 | ||
|
|
37966644aa | ||
|
|
6393de8c7d | ||
|
|
9250cd0c3b | ||
|
|
6b2f28240e | ||
|
|
c8dfe363bc | ||
|
|
e20fcd9ce5 | ||
|
|
adbd6b7fa1 | ||
|
|
3da3cfd8a0 | ||
|
|
88a8bdf7b3 | ||
|
|
a948050c54 | ||
|
|
0d76df2cd5 | ||
|
|
3b5c2fe519 | ||
|
|
6f5ee4d291 | ||
|
|
507ddde9dd | ||
|
|
a646fff5ff | ||
|
|
6268e27dd7 | ||
|
|
caa84d7918 | ||
|
|
6d1e28ae9c | ||
|
|
1e482369b8 | ||
|
|
a6c4f8ba3b | ||
|
|
6bd788a83f | ||
|
|
4c971a92db | ||
|
|
5b3a7bed93 | ||
|
|
1f0e67f85e | ||
|
|
74597483dc | ||
|
|
cb89509bb2 | ||
|
|
c194fdbb28 | ||
|
|
b1057a4cc8 | ||
|
|
20cd13904d | ||
|
|
95e4ad82b4 | ||
|
|
9e3d2bed65 | ||
|
|
7f3d4a8380 | ||
|
|
e6dd37e26e | ||
|
|
d69c166f10 | ||
|
|
f6875c0df4 | ||
|
|
3ef7b37dc9 | ||
|
|
03085ab39b | ||
|
|
de0ee08e05 | ||
|
|
881d3bb212 | ||
|
|
fb5d5682e6 | ||
|
|
071c32fff1 | ||
|
|
7c74594f06 | ||
|
|
d83440d32d | ||
|
|
c0dff1359b | ||
|
|
2ab7fa4d3a | ||
|
|
f20e985d0d | ||
|
|
58f934e2c1 | ||
|
|
06eae381e4 | ||
|
|
50965d69ce | ||
|
|
6e474d9096 | ||
|
|
63c588fce9 | ||
|
|
f3f60674fc | ||
|
|
dc3182c872 | ||
|
|
6c9cac0eca | ||
|
|
101471235c | ||
|
|
6cc84a1473 | ||
|
|
ce1344eb0c | ||
|
|
84e8f8e1ca | ||
|
|
2669e79778 | ||
|
|
42e3922053 | ||
|
|
e121569e40 | ||
|
|
a735bcc18d | ||
|
|
726787e4db | ||
|
|
ce4e04cabf | ||
|
|
fcb0e382b5 | ||
|
|
0560009204 | ||
|
|
cb9fba73a2 | ||
|
|
cbbfb4af20 | ||
|
|
50e55ed30d | ||
|
|
d0ff9cb65e | ||
|
|
e458e3dd18 | ||
|
|
6773ae221d | ||
|
|
ccbf71a96a | ||
|
|
102727b122 | ||
|
|
d1f7d39ca9 | ||
|
|
81d426e5dd | ||
|
|
0e1f074634 | ||
|
|
3b2b262420 | ||
|
|
3caac586fc | ||
|
|
6d158cb0d0 | ||
|
|
e52fbf061d | ||
|
|
4683fa3d25 |
No files matched your search
+82
-33
@@ -1,79 +1,128 @@
|
||||
<!--
|
||||
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.
|
||||
If not already done, please read the the Contribution Guidelines that
|
||||
are linked to the right under "Helpful resources" > "Contributing".
|
||||
|
||||
Also read the FAQ: https://faq.octoprint.org
|
||||
|
||||
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.
|
||||
Do not seek support here ("I need help with ...", "I have a
|
||||
question ..."), that belongs on the community forum at
|
||||
discourse.octoprint.org, 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 :)
|
||||
Mark requests with a "[Request]" prefix in the title please. For bug
|
||||
reports fully fill out the bug reporting template (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).
|
||||
|
||||
When reporting a bug do NOT delete ANY lines from the template.
|
||||
|
||||
Make sure any bug you want to report is still present with the CURRENT
|
||||
OctoPrint version and that it does not vanish when you start OctoPrint
|
||||
in safe mode - how to do that is also explained in the Contribution
|
||||
Guidelines linked up there in the big yellow box.
|
||||
|
||||
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
|
||||
<!--
|
||||
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.
|
||||
|
||||
Ideally provide exact steps to follow in order to reproduce your problem:
|
||||
-->
|
||||
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
|
||||
<!--
|
||||
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.]
|
||||
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
|
||||
#### Did the same happen when running OctoPrint in safe mode?
|
||||
|
||||
[Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.]
|
||||
<!--
|
||||
Test if you can reproduce your problem in safe mode. You can find information
|
||||
on how to enable safe mode in the Contribution Guidelines.
|
||||
|
||||
If you can't reproduce in safe mode, this is a bug with one of your
|
||||
installed third party plugins. Don't open a ticket here!
|
||||
|
||||
If you can't test this in safe mode, state why.
|
||||
-->
|
||||
|
||||
#### Version of OctoPrint
|
||||
|
||||
<!--
|
||||
Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.
|
||||
-->
|
||||
|
||||
#### Operating System running OctoPrint
|
||||
|
||||
<!--
|
||||
OctoPi, Linux, Windows, MacOS, something else? With version please.
|
||||
OctoPi's version can be found in /etc/octopi_version or in the lower left
|
||||
corner of the web interface.
|
||||
-->
|
||||
|
||||
#### Printer model & used firmware incl. version
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
<!--
|
||||
If applicable, always include if unsure.
|
||||
-->
|
||||
|
||||
#### Browser and Version of Browser, Operating System running Browser
|
||||
#### Browser and version of browser, operating system running browser
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
<!--
|
||||
If applicable, always include if unsure.
|
||||
-->
|
||||
|
||||
#### Link to octoprint.log
|
||||
|
||||
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.]
|
||||
<!--
|
||||
On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.
|
||||
|
||||
The Contribution Guidelines tell you where to find that.
|
||||
-->
|
||||
|
||||
#### Link to contents of terminal tab or serial.log
|
||||
|
||||
[On gist.github.com or pastebin.com. If applicable, always include if unsure or
|
||||
<!--
|
||||
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.]
|
||||
a serial.log (which the Contribution Guidelines tell you where to find).
|
||||
-->
|
||||
|
||||
#### 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.]
|
||||
<!--
|
||||
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:
|
||||
The Contribution Guidelines tell you where to find that.
|
||||
-->
|
||||
|
||||
[If applicable. Always include if unsure or reporting UI issues.]
|
||||
#### Screenshot(s)/video(s) showing the problem:
|
||||
|
||||
<!--
|
||||
If applicable. Always include if unsure or reporting UI issues.
|
||||
-->
|
||||
|
||||
I have read the FAQ.
|
||||
@@ -1,3 +1,4 @@
|
||||
<!--
|
||||
Thank you for your interest into contributing to OctoPrint, it's
|
||||
highly appreciated!
|
||||
|
||||
@@ -7,6 +8,7 @@ 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)
|
||||
@@ -14,14 +16,16 @@ checklist:
|
||||
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 targets OctoPrint's devel branch, or maintenance if it's
|
||||
a bug fix for an issue present in the current stable version (no PRs
|
||||
against master or anything else please)
|
||||
* [ ] 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
|
||||
e.g. dev/my_new_feature or fix/my_bugfix
|
||||
* [ ] 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
|
||||
no dead code, ideally only one commit - rebase and squash your PR
|
||||
if necessary!
|
||||
* [ ] Your changes follow the existing coding style
|
||||
* [ ] If your changes include style sheets: You have modified the
|
||||
.less source files, not the .css files (those are generated with
|
||||
lessc)
|
||||
@@ -31,11 +35,10 @@ checklist:
|
||||
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!
|
||||
|
||||
----
|
||||
<!--
|
||||
Describe your PR further using the template provided below. The more
|
||||
details the better!
|
||||
-->
|
||||
|
||||
#### What does this PR do and why is it necessary?
|
||||
|
||||
|
||||
+13
-7
@@ -7,8 +7,9 @@
|
||||
# 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, meta, rc and prerelease shall not use the lookup table, only tags
|
||||
master
|
||||
meta/.*
|
||||
rc/.*
|
||||
prerelease
|
||||
|
||||
@@ -16,11 +17,16 @@ prerelease
|
||||
HEAD
|
||||
\(detached.*
|
||||
|
||||
# maintenance is currently the branch for preparation of maintenance release 1.2.17
|
||||
# maintenance is currently the branch for preparation of maintenance release 1.3.7
|
||||
# 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
|
||||
maintenance 1.3.7 99e1c3ac007a0eee9d6f908e598c6b029f3ae40c pep440-dev
|
||||
fix/.* 1.3.7 99e1c3ac007a0eee9d6f908e598c6b029f3ae40c pep440-dev
|
||||
improve/.* 1.3.7 99e1c3ac007a0eee9d6f908e598c6b029f3ae40c 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
|
||||
# staging/maintenance is currently the branch for preparation of 1.3.7rc4
|
||||
# so is regressionfix/...
|
||||
staging/maintenance 1.3.7rc4 9c5d996ea2b66a085392981a5e6e0ee341013674 pep440-dev
|
||||
regressionfix/.* 1.3.7rc4 9c5d996ea2b66a085392981a5e6e0ee341013674 pep440-dev
|
||||
|
||||
# every other branch is a development branch and thus gets resolved to 1.4.0-dev for now
|
||||
.* 1.4.0 7f5d03d0549bcbd26f40e7e4a3297ea5204fb1cc pep440-dev
|
||||
+16
-3
@@ -1,6 +1,6 @@
|
||||
# Authors
|
||||
|
||||
The following people have contributed to OctoPrint's code base (ordered by
|
||||
The following people have contributed to OctoPrint's code base (ordered roughly by
|
||||
date of first contribution):
|
||||
|
||||
* [Gina Häußge](https://github.com/foosel)
|
||||
@@ -61,10 +61,11 @@ date of first contribution):
|
||||
* [Siim Raud](https://github.com/2ndalpha)
|
||||
* ["geoporalis"](https://github.com/geoporalis)
|
||||
* [Andrew Malota](https://github.com/2bitoperations)
|
||||
* [Alexander Leisentritt](https://github.com/Alex9779)
|
||||
* [therealbstern](https://github.com/therealbstern)
|
||||
* [Ishwar Agarwal](https://github.com/agarwali)
|
||||
* [Kye Hoover](https://github.com/eykrevooh)
|
||||
* [Joseph Carrick](https://github.com/carricktel)
|
||||
* [Alexander Leisentritt](https://github.com/Alex9779)
|
||||
* [therealbstern](https://github.com/therealbstern)
|
||||
* [Philipp Baum](https://github.com/philphilphil)
|
||||
* [Kyle Evans](https://github.com/kevans91)
|
||||
* [Javier Martínez Arrieta](https://github.com/Javierma)
|
||||
@@ -74,6 +75,18 @@ date of first contribution):
|
||||
* [Mathias Rangel Wulff](https://github.com/mathiasrw)
|
||||
* [Clemens Niemeyer](https://github.com/clemniem)
|
||||
* ["I-am-me"](https://github.com/I-am-me)
|
||||
* [Noah Martin](https://github.com/noahsmartin)
|
||||
* [Eyal Soha](https://github.com/eyal0)
|
||||
* [Greg Hulands](https://github.com/ghulands)
|
||||
* [Andreas Werner](https://github.com/gallore)
|
||||
* [Shawn Bruce](https://github.com/kantlivelong)
|
||||
* [Claudiu Ceia](https://github.com/ClaudiuCeia)
|
||||
* [Goswin von Brederlow](https://github.com/mrvn)
|
||||
* [Luke McKechnie](https://github.com/galamdring)
|
||||
* [Peter Backx](https://github.com/pbackx)
|
||||
* [Josh Major](https://github.com/astateofblank)
|
||||
* ["alex-gh"](https://github.com/alex-gh)
|
||||
* [Bernd Zeimetz](https://github.com/bzed)
|
||||
|
||||
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
|
||||
|
||||
+580
@@ -1,5 +1,585 @@
|
||||
# OctoPrint Changelog
|
||||
|
||||
## 1.3.7 (2018-04-09)
|
||||
|
||||
### Improvements
|
||||
|
||||
* [#324](https://github.com/foosel/OctoPrint/issues/324) & [#2414](https://github.com/foosel/OctoPrint/issues/2414) - Native support for the following [@ commands](http://docs.octoprint.org/en/maintenance/features/atcommands.html): `@pause` (pauses the print), `@resume` (resumes the print), `@cancel` or `@abort` (cancels the print). More commands can be added through the plugin hooks [`octoprint.comm.protocol.atcommand.*`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-atcommand-phase).
|
||||
* [#1951](http://github.com/foosel/OctoPrint/issues/1951) - Fixed plugins being able to modify internal state data (e.g. progress, job), causing concurrent modification and resulting run time errors in the printer state processing.
|
||||
* [#2208](https://github.com/foosel/OctoPrint/issues/2208) - New plugin hook [`octoprint.comm.protocol.gcode.error`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-gcode-error) to allow plugins to override OctoPrint's handling of `Error:`/`!!` messages reported by the firmware. Can be used to "downgrade" errors that aren't actually fatal errors that make the printer halt.
|
||||
* [#2213](https://github.com/foosel/OctoPrint/issues/2213) - Made sure to prevent accidental configuration of a temperature cutoff value less than 1min for the temperature graph.
|
||||
* [#2250](https://github.com/foosel/OctoPrint/pull/2250) - Added [`octoprint.util.ResettableTimer`](http://docs.octoprint.org/en/maintenance/modules/util.html#octoprint.util.ResettableTimer) helper class.
|
||||
* [#2287](https://github.com/foosel/OctoPrint/issues/2287) - Added confirmation for attempting to disconnect during an ongoing print. See also [#2466](https://github.com/foosel/OctoPrint/pull/2466).
|
||||
* [#2302](https://github.com/foosel/OctoPrint/issues/2302) - Detect invalid tools as reported by firmware and blacklist them for `T` commands.
|
||||
* [#2317](https://github.com/foosel/OctoPrint/issues/2317) - Removed capturing of post roll images for time based timelapses, was causing too much confusion and surprise.
|
||||
* [#2335](https://github.com/foosel/OctoPrint/issues/2335) - First throw at detecting if a print from the printer's SD was started outside of OctoPrint via the printer's control panel. Requires some specific requirements to be fulfilled by the printer's firmware to function properly:
|
||||
* Firmware must send a "File opened: ..." message on start of the print
|
||||
* Firmware must respond to an immediately sent `M27` with `SD printing byte <current>/<total>`
|
||||
* Firmware must stay responsive during ongoing print to allow for regular M27 polls (or push those automatically) or M25 to pause/cancel the print through OctoPrint.
|
||||
* Firmware must send `Done printing file` or respond to `M27` with `Not SD printing` when SD printing finishes (either due to being done or to having been cancelled by the user).
|
||||
* [#2362](https://github.com/foosel/OctoPrint/issues/2362) - Added option to configure timelapse snapshot timeout.
|
||||
* [#2367](https://github.com/foosel/OctoPrint/issues/2367) - Added support for `//action:cancel` action command.
|
||||
* [#2378](https://github.com/foosel/OctoPrint/issues/2378) - Made GCODE viewer gracefully handle GCODE subcodes.
|
||||
* [#2385](https://github.com/foosel/OctoPrint/pull/2385) - Made valid boolean trues check case insensitive.
|
||||
* [#2304](https://github.com/foosel/OctoPrint/pull/2304) & [#2405](https://github.com/foosel/OctoPrint/pull/2405) - Added support to trust Basic Authentication headers for user login. Currently requires [manual configuration through `config.yaml`](http://docs.octoprint.org/en/maintenance/configuration/config_yaml.html#access-control), see the `accessControl.trustBasicAuthentication` and `accessControl.checkBasicAuthenticationPassword` settings.
|
||||
* [#2338](https://github.com/foosel/OctoPrint/pull/2338) - Allowed plugins to define GCODE script variables using the `octoprint.comm.protocol.scripts` hook.
|
||||
* [#2406](https://github.com/foosel/OctoPrint/pull/2406) - Extracted log management into its own bundled plugin and allow fine tuning of log levels.
|
||||
* [#2409](https://github.com/foosel/OctoPrint/pull/2409) - Added `m4v` and `mkv` to the list of accepted timelapse extensions.
|
||||
* [#2444](https://github.com/foosel/OctoPrint/pull/2444) - Support additional CSS classes on custom control buttons.
|
||||
* [#2448](https://github.com/foosel/OctoPrint/issues/2448) - Also detect plugins in `~/.octoprint/plugins` that are provided as bytecode `pyc` instead of source `py` files.
|
||||
* [#2455](https://github.com/foosel/OctoPrint/issues/2455) - Added option to configure SSL validation for snapshot URL.
|
||||
* Support `M114` response format of RepRapFirmware (uses `X:... Y:... Z:... E0:... E1:...` instead of
|
||||
`X:... Y:... Z:... E:...`)
|
||||
* Added refresh button to connection panel for easy refresh of the available ports to connect to without having to reload the whole page.
|
||||
* Increased upper bound of PySerial dependency from 2.7 to 3.4. See also [#2333](https://github.com/foosel/OctoPrint/issues/2333).
|
||||
* Switch to lower communication timeouts if support of the `busy` protocol by the firmware is detected.
|
||||
* Refactored serial settings dialog, now has sub tabs and more explanations.
|
||||
* Allow to disable support for certain firmware capabilities, even if reported as supported by the firmware: `busy` protocol, temperature auto reporting, SD status auto reporting
|
||||
* Attached tags to GCODE commands moving through the comm layer and allowed plugins to access and extend these tags through the GCODE hooks. Makes it possible for plugins to detect the origin of a command (streamed file vs. GCODE script vs. user input vs. plugin), the point where it entered the system and so on. Also added a new logger `octoprint.util.comm.command_phases` that if set to `DEBUG` will log the lifecycle of commands through the comm layer including tags to `octoprint.log`. See also [the docs here](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-gcode-phase).
|
||||
* Added new [`job_on_hold`](http://docs.octoprint.org/en/maintenance/modules/printer.html#octoprint.printer.PrinterInterface.job_on_hold) and [`set_job_on_hold`](http://docs.octoprint.org/en/maintenance/modules/printer.html#octoprint.printer.PrinterInterface.set_job_on_hold) methods on the printer instance, allowing plugins to quickly stall the streaming of a queue. This should be used sparingly - abuse will have significant negative effects on the print job. Read the docs if you plan to utilize this.
|
||||
* Support extraction of plugin metadata even from disabled and blacklisted plugins through the AST of the module.
|
||||
* Better logging of printer callback errors and utilization of `frozendict` for internal printer state propagation in an attempt to narrow down on [#1951](https://github.com/foosel/OctoPrint/issues/1951). Should `frozendict` cause issues it can be disabled through the settings in `config.yaml`, just set `devel.useFrozenDictForPrinterState` to `false`
|
||||
* Log comm state changes to `octoprint.log`.
|
||||
* Added a regular server heartbeat to the log (every 15min).
|
||||
* Support SD status auto report by the firmware.
|
||||
* Added `Not SD printing` to default "SD status" terminal filters.
|
||||
* Added custom `readline` implementation for the serial port. Instead of relying on PySerial's `readline` that depending on the installed version might only read from the port one byte at the time, we now wait for one byte and then read everything available into a persistent buffer which then is used to fetch lines from.
|
||||
* Ensure that `callViewModelIf` doesn't try to call null or uncallable `method`s.
|
||||
* Added links to the new [Community Forum](https://discourse.octoprint.org) and the new location of the [FAQ](https://faq.octoprint.org).
|
||||
* Improved pip utility logging, `LocalPipHelper` wasn't producing output, making it hard to debug such non writable install directories.
|
||||
* Added a new bundled plugin "Printer Safety Check" that will try to identify printer/printer firmware with known safety issues such as missing thermal runaway protection.
|
||||
* Plugin Manager: Reduce notification spam. See also [#2260](https://github.com/foosel/OctoPrint/issues/2260).
|
||||
* Software Update Plugin: Better detection if an update is already running.
|
||||
* Software Update Plugin: Refer to `plugin_softwareupdate_console.log` on update errors in log and notification.
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* [#2294](https://github.com/foosel/OctoPrint/issues/2294) - Improved resilience against errors during gathering the file list (e.g. permission errors)
|
||||
* [#2296](https://github.com/foosel/OctoPrint/issues/2296) - Fixed `X-Forwarded-For` handling in Flask Login through monkey patched backport.
|
||||
* [#2297](https://github.com/foosel/OctoPrint/issues/2297) - Return `403` instead of `401` on missing/insufficient credentials.
|
||||
* [#2311](https://github.com/foosel/OctoPrint/issues/2311) - Fixed server not auto connecting on startup if port is set to `AUTO` (see also [#2311](https://github.com/foosel/OctoPrint/pull/2337)).
|
||||
* [#2316](https://github.com/foosel/OctoPrint/issues/2316) - Check for valid queue entry in file analysis queue before trying to dequeue, fix for a HTTP `500` on upload of a file not supported for analysis.
|
||||
* [#2321](https://github.com/foosel/OctoPrint/issues/2321) & [#2449](https://github.com/foosel/OctoPrint/issues/2449) - Fixed wrong queuing order of cancel script & first line from printed file on quick start-cancel-start scenarios by introducing a two new states "Cancelling" and "Pausing".
|
||||
* [#2324](https://github.com/foosel/OctoPrint/pull/2324) - Fixed 500 error when
|
||||
* [#2333](https://github.com/foosel/OctoPrint/issues/2333) (Part 1/3) - Workaround for an update problem caused by interaction of `pip` with dependencies formerly installed as eggs through `python setup.py install`.
|
||||
* [#2333](https://github.com/foosel/OctoPrint/issues/2333) (Part 2/3) - If supported by the underlying PySerial version, cancel all reads and writes on disconnect if possible for a faster connection release. Part 3 (forcing an upgrade of PySerial to 3.4 so this should work in more cases) will in OctoPrint 1.3.8.
|
||||
* [#2364](https://github.com/foosel/OctoPrint/issues/2364) - Fixed firmware error reporting in case of cancelling a print due to a firmware error.
|
||||
* [#2368](https://github.com/foosel/OctoPrint/issues/2368) - Fixed for incorrect handling of unicode filenames in cura slicer profiles
|
||||
* [#2371](https://github.com/foosel/OctoPrint/issues/2371) - Removed "just now"/"gerade eben" label from temperature graph to work around a graph resize issue caused by that.
|
||||
* [#2392](https://github.com/foosel/OctoPrint/issues/2392) - Fixed "Copy all" on terminal tab only working the first time.
|
||||
* [#2406](https://github.com/foosel/OctoPrint/pull/2406) - Fixed `showTab` JS function of about dialog.
|
||||
* [#2426](https://github.com/foosel/OctoPrint/issues/2426) - Made resend logging to `octoprint.log` unicode safe
|
||||
* [#2442](https://github.com/foosel/OctoPrint/issues/2442) - Don't even import disabled plugins, use a dummy entry for them just like for backlisted plugins. More resilience against misbehaving plugins.
|
||||
* [#2461](https://github.com/foosel/OctoPrint/issues/2461) - Fixed OctoPrint not properly disconnecting in case of a firmware error.
|
||||
* [#2494](https://github.com/foosel/OctoPrint/issues/2494) - Fixed `undefined` values not saving in the settings.
|
||||
* [#2499](https://github.com/foosel/OctoPrint/issues/2499) (regression) - Fixed communication error notification lacking the actual error message.
|
||||
* [#2501](https://github.com/foosel/OctoPrint/issues/2501) (regression) - Fixed a bug causing log downloads to fail with an HTTP 500 error.
|
||||
* [#2506](https://github.com/foosel/OctoPrint/issues/2506) (regression) - Fixed `printer.get_current_data` and `printer.get_current_job` returning `frozendict` instead of `dict` instances, causing issues with plugins relying on being able to modify the returned data (e.g. [dattas/OctoPrint-DetailedProgress#26](https://github.com/dattas/OctoPrint-DetailedProgress/issues/26)).
|
||||
* [#2508](https://github.com/foosel/OctoPrint/issues/2508) (regression) - Fixed HTTP 500 error on `/api/slicing` in case of an unconfigured slicer.
|
||||
* [#2524](https://github.com/foosel/OctoPrint/issues/2524) - Ignore `wait` while job is on hold.
|
||||
* [#2536](https://github.com/foosel/OctoPrint/issues/2536) - Fix a wrong state tracking when starting an SD print through the controller, causing a disconnect due to a timeout.
|
||||
* [#2544](https://github.com/foosel/OctoPrint/issues/2544) (regression) - Fix an exception when connecting to the raw websocket at `/sockjs/websocket` (instead of `/sockjs/<server_id>/<session_id>/websocket`).
|
||||
* [#2546](https://github.com/foosel/OctoPrint/issues/2546) (regression) - Fix the `PRINT_FAILED` event getting triggered twice on print failure due to disconnect
|
||||
* Use `pkg_resources` to determine pip version during environment check instead of `import pip; pip.__version__` since the latter causes issues with pip version 9.0.2. In the same spirit make `pip.main` approach of calling `pip` in the PipCaller the last resort during auto detection, only after trying `pip` or `pip.exe` inside the same folder as the Python executable.
|
||||
* Use `octoprint.util.monotonic_time` instead of `monotonic.monotonic` in comm layer.
|
||||
* Fixed timelapse not stopping on print failure due to firmware error due to missing `PrintFailed` event.
|
||||
* Announcement Plugin: Fixed a missing line break in case of more than three announcements in a notification.
|
||||
* Docs: Documentation for printer profile related bits and pieces
|
||||
* Docs: Various fixes of typos and grammar.
|
||||
* Have `OctoPrintJsonEncoder` fall back to regular flask JSON encoder, otherwise we might not be able to serialize some data types we need to be able to serialize. (regression)
|
||||
|
||||
### Known bugs
|
||||
|
||||
* [#2547](https://github.com/foosel/OctoPrint/issues/2547) - Error during processing of afterPrintJobDone script will trigger PRINT_FAILED event even though PRINT_DONE event was already triggered
|
||||
|
||||
### More Information
|
||||
|
||||
* [Commits](https://github.com/foosel/OctoPrint/compare/1.3.6...1.3.7)
|
||||
* Release Candidates:
|
||||
* [1.3.7rc1](https://github.com/foosel/OctoPrint/releases/tag/1.3.7rc1)
|
||||
* [1.3.7rc2](https://github.com/foosel/OctoPrint/releases/tag/1.3.7rc2)
|
||||
* [1.3.7rc3](https://github.com/foosel/OctoPrint/releases/tag/1.3.7rc3)
|
||||
* [1.3.7rc4](https://github.com/foosel/OctoPrint/releases/tag/1.3.7rc4)
|
||||
* A special **Thank you!** to everyone who reported back on these release candidates this time:
|
||||
[aaronkeck](https://github.com/aaronkeck), [akurz42](https://github.com/akurz42), [andrivet](https://github.com/andrivet), [anthonyst91](https://github.com/anthonyst91), [arhi](https://github.com/arhi), [b-morgan](https://github.com/b-morgan), [BryanSmithDev](https://github.com/BryanSmithDev), [chippypilot](https://github.com/chippypilot), [ChrisHeerschap](https://github.com/ChrisHeerschap), [Crowlord](https://github.com/Crowlord), [dforsi](https://github.com/dforsi), [drdelaney](https://github.com/drdelaney), [FormerLurker](https://github.com/FormerLurker), [goeland86](https://github.com/goeland86), [inspiredbylife](https://github.com/inspiredbylife), [jbjones27](https://github.com/jbjones27), [jesasi](https://github.com/jesasi), [jneilliii](https://github.com/jneilliii), [JohnOCFII](https://github.com/JohnOCFII), [kantlivelong](https://github.com/kantlivelong), [lnx13](https://github.com/lnx13), [makaper](https://github.com/makaper), [markwal](https://github.com/markwal), [MiquelAdell](https://discourse.octoprint.org/u/MiquelAdell), [ml0w](https://github.com/ml0w), [mmotley999](https://github.com/mmotley999), [mrhanman](https://github.com/mrhanman), [SCiunczyk](https://github.com/SCiunczyk), [tdub415](https://github.com/tdub415), [tedder42](https://discourse.octoprint.org/u/tedder42), [thatjoshguy](https://github.com/thatjoshguy), [wescrockett](https://github.com/wescrockett)
|
||||
|
||||
## 1.3.6 (2017-12-12)
|
||||
|
||||
### Note for upgraders and plugin authors: Change in the bundling of JS assets can lead to issues in plugins
|
||||
|
||||
A change to solve issues with plugins bundling JS assets that cause interference with other plugins (e.g. through the declaration of `"use strict"`) and in general to add better isolation and error handling might cause errors for some plugins that go beyond your run-off-the-mill view model and also implicitly declare new globals.
|
||||
|
||||
If you happen to run into any such issues, you can switch back to the old way of bundling JS assets via the newly introduced "Settings > Feature > Enable legacy plugin asset bundling" toggle (check it, save the settings, restart the server). This is provided to allow for a minimally invasive adjustment period until affected plugins have been updated.
|
||||
|
||||
You can find out more about the change, how to know if a plugin is even affected and what do about it [on the OctoBlog](https://octoprint.org/blog/2017/12/01/heads-up-plugin-authors/).
|
||||
|
||||
### Improvements
|
||||
|
||||
* [#203](https://github.com/foosel/OctoPrint/issues/203) - Allow selecting the current tab via URL hashs. Also update URL hash when switching tabs, thus adding this to the browser history and allowing quicker back and forth navigation through the browser's back and forward buttons.
|
||||
* [#1026](https://github.com/foosel/OctoPrint/issues/1026) - Automatically upper case parameters in GCODE commands sent from the Terminal tab. A black list is in place that prevent upper casing of parameters for GCODE commands where it doesn't make sense (default: `M117`). See also [#2177](https://github.com/foosel/OctoPrint/pull/2177).
|
||||
* [#2050](https://github.com/foosel/OctoPrint/issues/2050) - New hook [`octoprint.comm.protocol.temperatures.received`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-comm-protocol-temperatures-received) that allows plugins to further preprocess/sanitize temperature data received from the printer.
|
||||
* [#2055](https://github.com/foosel/OctoPrint/issues/2055) - Increased the size of the API key field in the settings.
|
||||
* [#2056](https://github.com/foosel/OctoPrint/issues/2056) - Added a Copy button to the API key field in the settings and user settings.
|
||||
* [#2094](https://github.com/foosel/OctoPrint/issues/2094) - Allow UTF-8 display names for uploaded files. The files will still get an ASCII only name on disk, but the UTF-8 name used during upload will also be persisted and shown in the file list. This also allows using emojis in your file and folder names now.
|
||||
* [#2104](https://github.com/foosel/OctoPrint/issues/2104) - Allow more URL schemes for installing plugins from. Supported schemes should now mirror what `pip` itself supports: `http`, `https`, `git`, `git+http`, `git+https`, `git+ssh`, `git+git`, `hg+http`, `hg+https`, `hg+static-http`, `hg+ssh`, `svn`, `svn+svn`, `svn+http`, `svn+https`, `svn+ssh`, `bzr+http`, `bzr+https`, `bzr+ssh`, `bzr+sftp`, `bzr+ftp`, `bzr+lp`.
|
||||
* [#2109](https://github.com/foosel/OctoPrint/pull/2109) - New decorator `@firstrun_only_access` for API endpoints that should only be available before first setup has been completed.
|
||||
* [#2111](https://github.com/foosel/OctoPrint/issues/2111) - Made the file list's scroll bar wider.
|
||||
* [#2131](https://github.com/foosel/OctoPrint/issues/2131) - Added warning to restart, shutdown, reboot and update confirmations that that may disrupt ongoing prints, even those run from the printer's internal storage/SD. See also [#2146](https://github.com/foosel/OctoPrint/pull/2146) and [#2152](https://github.com/foosel/OctoPrint/pull/2152).
|
||||
* [#2138](https://github.com/foosel/OctoPrint/issues/2138) - Slightly longer timeout when attempting to read from serial during auto detection via programming mode. Might help with detection of some slower printer controllers under certain circumstances.
|
||||
* [#2200](https://github.com/foosel/OctoPrint/issues/2200) - Wrap all JS assets of plugins into one anonymous function per plugin. That way plugins using `"use strict";` won't cause hard to debug and weird issues with other plugins bundled after them. The down side is that plugins currently relying on implicit declaration of global helper functions or variables (`function convert(value) { ... }`) to be available outside of their own plugin's JS assets will now run into errors. To compensate for that while affected plugins are adjusted to declare globals explicitly (`window.convert = function(value) { ... }`), a temporary feature flag was added as "Settings > Features > Enable legacy plugin asset bundling" that switches back to the old form of bundling until plugins you rely on are updated. This flag will be removed again in a later version (currently planned for 1.3.8). See also the note above and [#2246](https://github.com/foosel/OctoPrint/issues/2246).
|
||||
* [#2229](https://github.com/foosel/OctoPrint/issues/2229) - Added note to printer profile dialog that the nozzle offsets for multi extruder setups are only to be configured if they are not already set in the printer's firmware.
|
||||
* [#2232](https://github.com/foosel/OctoPrint/issues/2232) - Disable movement distance buttons when not connected to the printer or when printing, since they don't have any use then.
|
||||
* [#2239](https://github.com/foosel/OctoPrint/pull/2239) - Improved the check summing speed, thus improving the general achievable throughput on the comm layer.
|
||||
* Allow cancelling of file transfers
|
||||
* Made check of how old an unrendered timelapse is more lenient buy looking at both the creation and last modification date and using the younger one.
|
||||
* Made notifications in general auto-close faster.
|
||||
* Make the first profile saved for a slicer the default profile for that slicer.
|
||||
* New command `server` for testing server connections on the [JS test API](http://docs.octoprint.org/en/maintenance/api/util.html#post--api-util-test).
|
||||
* New hook [`octoprint.accesscontrol.keyvalidator`](http://docs.octoprint.org/en/maintenance/plugins/hooks.html#octoprint-accesscontrol-keyvalidator) that allows plugins to validate their own customized API keys to be used to access OctoPrint.
|
||||
* Updated `cookiecutter`, `requests` and `psutil` dependencies.
|
||||
* Added safety warning to first run wizard.
|
||||
* More error resilience against broken view models.
|
||||
* New sub command `octoprint safemode`. Will set the `server.startOnceInSafeMode` setting in the config so that the next (re)start of the server after issuing this command will happen in safe mode.
|
||||
* New sub command `octoprint config effective`. Will report the effective config.
|
||||
* New centralized plugin blacklist (opt-in). Allows to prevent plugins/certain versions of plugins known to cause crippling issues with the normal operation of OctoPrint to be disabled from loading, if the user has opted to do so in the settings/wizard.
|
||||
* Log how to enable `serial.log` to `serial.log` if it's disabled. That will hopefully put at least a small dent in the amount of "It's empty!" responses in tickets ;)
|
||||
* Force new Pypi index URL in `requirements.txt` as an additional work around against old tooling.
|
||||
* Prefer plain `pip` over `git` for updating OctoPrint.
|
||||
* Added environment detection and logging on startup. That should give us more information about the environment to produce a reported bug in.
|
||||
* Added OctoPi support plugin that provides information about the detected OctoPi version. Will only load if OctoPi is detected.
|
||||
* More dynamic plugin mixin detection. Now using a base class instead of having to list all types manually. Should greatly reduce overhead of adding new mixin types.
|
||||
* Support leaf merging for file extension tree, allowing to add new file extensions to types registered by default.
|
||||
* Allow non GCODE SD file transfers if registered as `machinecode` through e.g. a plugin's file extension hook. Caution: This doesn't make streaming arbitrary files to the printer via serial work magically. It merely allows that, it's up to the firmware to actually be able to handle that. Also, the regular GCODE streaming protocol is used, so if the streamed file contains control characters from that (e.g. `M29` to signal the end of the streaming process), stuff will break!
|
||||
* Added a test button for the online connectivity check.
|
||||
* Announcements plugin: Added UTM Tags.
|
||||
* Cura plugin: Less `not configured yet` logging.
|
||||
* GCODE viewer: Added advanced options that allow configuring display of bounding boxes, sorting by layers and hiding of empty layers.
|
||||
* GCODE viewer: Persist all options to local storage so they will be automatically set again the next time the GCODE viewer is used in the same browser.
|
||||
* Software update: Auto-hide "Everything is up-to-date" notification.
|
||||
* Easier copying of terminal contents thanks to dedicated copy button.
|
||||
* Timelapse: [#2067](https://github.com/foosel/OctoPrint/issues/2067) - Added rate limiting to z-based timelapse capturing to prevent issues when accidentally leaving this mode on with vase mode prints.
|
||||
* Timelapse: Refactored configuration form & added reset button to switch back to currently active settings.
|
||||
* Timelapse: Sort timelapses by modification instead of creation time (creation time can be newer if a backup restore was done).
|
||||
* Virtual printer: Support configurable ambient temperature for testing.
|
||||
* Virtual printer: Support configurable reset lines.
|
||||
* Virtual printer: Added new debug trigger `trigger_missing_lineno`.
|
||||
* Virtual printer: Allow empty/`None` prepared oks, allowing to simulate lost acknowledgements right on start.
|
||||
* Docs: [#2142](https://github.com/foosel/OctoPrint/pull/2142) - Added documentation for the bundled virtual printer plugin.
|
||||
* Docs: [#2234](https://github.com/foosel/OctoPrint/pull/2234) - Added info on how to install under Suse Linux.
|
||||
* Docs: Added example PyCharm run configuration that includes automatic dependency updates on start.
|
||||
* Docs: Added information on how to run the test suite.
|
||||
* Various refactorings
|
||||
* Various documentation updates
|
||||
* Fetch plugin blacklist (and also announcements, plugin notices and plugin repository) via https instead of http.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* [#2044](https://github.com/foosel/OctoPrint/pull/2044) - Fix various typos in strings and comments
|
||||
* [#2048](https://github.com/foosel/OctoPrint/pull/2048) & [#2176](https://github.com/foosel/OctoPrint/pull/2176) - Fixed various warnings during documentation generation.
|
||||
* [#2077](https://github.com/foosel/OctoPrint/issues/2077) - Fix an issue with shared nozzles and the temperature graph, causing temperature to not be reported properly when another tool but the first one is selected. See also [#2077](https://github.com/foosel/OctoPrint/pull/2123)
|
||||
* [#2108](https://github.com/foosel/OctoPrint/issues/2108) - Added no-op default action to login form so that username + password aren't sent as GET parameters if for some reason the user tries to log in before the view models are properly bound and thus the AJAX POST submission method is attached.
|
||||
* [#2111](https://github.com/foosel/OctoPrint/issues/2111) - Prevent file list's scroll bar from fading out.
|
||||
* [#2146](https://github.com/foosel/OctoPrint/issues/2147) - Fix initialization of temperature graph if it's not on the first tab due to tab reordering.
|
||||
* [#2166](https://github.com/foosel/OctoPrint/issues/2166) - Workaround for a Firefox bug that causes the Drag-n-Drop overlay to never go away if the file is dragged outside of the browser window.
|
||||
* [#2167](https://github.com/foosel/OctoPrint/issues/2167) - Fixed grammar of print time estimation tooltip
|
||||
* [#2175](https://github.com/foosel/OctoPrint/issues/2175) - Cancel printing when an external reset of the printer is detected on the serial connection.
|
||||
* [#2181](https://github.com/foosel/OctoPrint/issues/2181) - More resilience against non-standard `M115` responses.
|
||||
* [#2182](https://github.com/foosel/OctoPrint/pull/2182) - Don't start tracking non existing or nonfunctional tools if encountering a temperature command referencing said tool. See also [kantlivelong/OctoPrint-PSUControl#68](https://github.com/kantlivelong/OctoPrint-PSUControl/issues/68).
|
||||
* [#2196](https://github.com/foosel/OctoPrint/issues/2196) - Marked API key fields as `readonly` instead of `disabled` to allow their contents to be copied in Firefox (which wasn't possible before).
|
||||
* [#2203](https://github.com/foosel/OctoPrint/issues/2203) - Reset temperature offsets to 0 when disconnected from the printer.
|
||||
* [#2206](https://github.com/foosel/OctoPrint/issues/2206) - Disable pre-configured timelapse if snapshot URL of ffmpeg path are unset.
|
||||
* [#2214](https://github.com/foosel/OctoPrint/issues/2214) - Fixed temperature fields not selecting in MS Edge on focus.
|
||||
* [#2217](https://github.com/foosel/OctoPrint/pull/2217) - Fix an issue in `octoprint.util` causing a crash when running under PyPy instead of CPython.
|
||||
* [#2226](https://github.com/foosel/OctoPrint/issues/2226) - Handle `No Line Number with checksum, Last Line: ...` errors from the firmware.
|
||||
* [#2233](https://github.com/foosel/OctoPrint/pull/2233) - Respond with `411 Length Required` when content length is missing on file uploads.
|
||||
* [#2242](https://github.com/foosel/OctoPrint/issues/2242) - Fixed an issue where print time left could show "1 days" instead of "1 day".
|
||||
* [#2262](https://github.com/foosel/OctoPrint/issues/2262) (regression) - Fixed a bug causing `Error:checksum mismatch, Last Line: ...` errors from the firmware to be handled incorrectly.
|
||||
* [#2267](https://github.com/foosel/OctoPrint/issues/2267) (regression) - Fixed a bug causing the GCODE viewer to not get properly initialized due to a JS error on load if "Also show next layer" was selected.
|
||||
* [#2268](https://github.com/foosel/OctoPrint/issues/2268) (regression) - Fixed a bug causing a display error with the temperature offsets. If one offset was changed, all others seemed to revert back to 0.
|
||||
* Fixed cleanup of unrendered timelapses with certain names.
|
||||
* Fixed a caching issue with the file list API and the slicing API.
|
||||
* Fixed initial sizing of the temperature graph.
|
||||
* More resilience against corrupt `.metadata.yaml` files.
|
||||
* More resilience against corrupt/invalid entries for system actions.
|
||||
* More resilience against invalid JSON command requests.
|
||||
* More resilience against broken packages in the python environment.
|
||||
* Don't evaluate `onWebcamLoaded` more than once when switching to the webcam tab.
|
||||
* Fixed `octoprint config` sub command.
|
||||
* Fixed deactivated user accounts being able to login (albeit without a persistent session). Show fitting error instead.
|
||||
* Fixed temperature auto report after an external reset.
|
||||
* Don't log full request headers in Tornado on an error.
|
||||
* Fix displayed notification message for synchronous system commands. Was accidentally swapped with the one for asynchronous system commands.
|
||||
* GCODE viewer: Fix error on empty layers.
|
||||
* Virtual printer: Fix resend simuation.
|
||||
* Docs: Fixed CSS of line numbered listings.
|
||||
* Docs: Updated mermaid to fix a deprecation warning.
|
||||
* Fixed ordering of plugin assets, should be alphabetical based on the plugin identifier. (regression)
|
||||
* Fixed an issue causing redundant software update configuration settings to be written to `config.yaml`, in turn causing issues when downgrading to <1.3.5. (regression)
|
||||
* Fixed an issue detecting whether the installed version is a release version or a development version. (regression)
|
||||
|
||||
### More Information
|
||||
|
||||
* [Commits](https://github.com/foosel/OctoPrint/compare/1.3.5...1.3.6)
|
||||
* Release Candidates:
|
||||
* [1.3.6rc1](https://github.com/foosel/OctoPrint/releases/tag/1.3.6rc1)
|
||||
* [1.3.6rc2](https://github.com/foosel/OctoPrint/releases/tag/1.3.6rc2)
|
||||
* [1.3.6rc3](https://github.com/foosel/OctoPrint/releases/tag/1.3.6rc3)
|
||||
* A special **Thank you!** to everyone who reported back on these release candidates this time: [andrivet](https://github.com/andrivet), [b-morgan](https://github.com/b-morgan), [bjarchi](https://github.com/bjarchi), [chippypilot](https://github.com/chippypilot), [ChrisHeerschap](https://github.com/ChrisHeerschap), [cosmith71](https://github.com/cosmith71), [Crowlord](https://github.com/Crowlord), [ctgreybeard](https://github.com/ctgreybeard), [fiveangle](https://github.com/fiveangle), [goeland86](https://github.com/goeland86), [jbjones27](https://github.com/jbjones27), [jneilliii](https://github.com/jneilliii), [JohnOCFII](https://github.com/JohnOCFII), [Kunsi](https://github.com/Kunsi), [Lordxv](https://github.com/Lordxv), [malnvenshorn](https://github.com/malnvenshorn), [mcp5500](https://github.com/mcp5500), [ntoff](https://github.com/ntoff), [ripp2003](https://github.com/ripp2003) and [schorsch3000](https://github.com/schorsch3000)
|
||||
|
||||
## 1.3.5 (2017-10-16)
|
||||
|
||||
### Improvements
|
||||
|
||||
* [#1162](https://github.com/foosel/OctoPrint/pull/1162) - Allow `octoprint.comm.protocol.gcode.queuing` hook to return a list of commands.
|
||||
* [#1572](https://github.com/foosel/OctoPrint/issues/1572) & [#1881](https://github.com/foosel/OctoPrint/issues/1881) - Refactored web interface startup process to minimise risk of race conditions and speed improvements. Also added sequence diagram to the documentation showing the new processing order.
|
||||
* [#1640](https://github.com/foosel/OctoPrint/issues/1640) - Mouse over temperature graph to get exact data for that time.
|
||||
* [#1679](https://github.com/foosel/OctoPrint/issues/1679) - Support temperature autoreporting by the firmware instead of polling if the firmware reports to support it. For this to work with Marlin 1.1.0 to 1.1.3 you'll need to explicitly enable `EXTENDED_CAPABILITIES_REPORT` *and* `AUTO_REPORT_TEMPERATURES` in your firmware configuration, otherwise your firmware won't report that it actually supports this feature.
|
||||
* [#1737](https://github.com/foosel/OctoPrint/issues/1737) - Auto-detect Anet A8 firmware and treat as Repetier Firmware (which it actually appears to be, just renamed - thanks Anet for making this even harder).
|
||||
* [#1842](https://github.com/foosel/OctoPrint/issues/1842) - Update bundled FontAwesome to 4.7 (see also [#1915](https://github.com/foosel/OctoPrint/pull/1915)).
|
||||
* [#1910](https://github.com/foosel/OctoPrint/issues/1910) - Make last/pause/cancel temperature available for GCODE scripts.
|
||||
* [#1925](https://github.com/foosel/OctoPrint/issues/1925) - Include configured webcam stream URL in "Webcam stream not loaded" message for logged in users/admins. Slightly different wording for guests vs users vs admins.
|
||||
* [#1941](https://github.com/foosel/OctoPrint/issues/1941) - Enable "block while dwelling" flag when Malyan firmware is detected since that firmware seems to handle `G4` identically to Repetier Firmware instead of Marlin (like it claims to). See also [#1762](https://github.com/foosel/OctoPrint/issues/1762).
|
||||
* [#1946](https://github.com/foosel/OctoPrint/issues/1946) - Add option to disable position logging on cancel/pause. See "Log position on cancel" and "Log position on pause" under Settings > Serial > Advanced options.
|
||||
* [#1971](https://github.com/foosel/OctoPrint/issues/1971) - Refactored temperature inputs. They now sport some fancy +/- buttons to increment/decrement the current temperature (which also auto submit after a couple of seconds) and easier editing by keyboard. The temperature offset was also slightly redesigned to make room for that.
|
||||
* [#1975](https://github.com/foosel/OctoPrint/issues/1975) - Better error reporting when deleting timelapses.
|
||||
* [#2010](https://github.com/foosel/OctoPrint/pull/2010) - Slight refactoring in the terminal tab: Full width input field, auto focus of input field when just clicking on terminal output.
|
||||
* [#2011](https://github.com/foosel/OctoPrint/issues/2011) - Centralized online connectivity check (with opt-in of course). None of the bundled plugins will attempt to fetch data from the net when the connectivity check indicates that would fail anyhow. This should improve server startup times and various requests when running isolated.
|
||||
* [#2025](https://github.com/foosel/OctoPrint/issues/2025) - More verbose logging of asynchronous system commands (e.g. restart/shutdown).
|
||||
* Allow timelapse configuration through UI even when not connected to the printer (suggested in [#1918](https://github.com/foosel/OctoPrint/issues/1918))
|
||||
* Disable "Upload to SD" UI elements while printing (suggested in [#1914](https://github.com/foosel/OctoPrint/issues/1914))
|
||||
* Update bundled SockJS to 1.1.2 incl. source maps
|
||||
* Set `X-Robots` HTTP header and remove `Server` header from all responses, also set `robots` meta tag in page.
|
||||
* Don't require to enter programmer mode for printer port autodetection when there's only one possible port candidate anyhow.
|
||||
* More sensible sorting of baudrates (additionally configured, then 115200, then 250000, then everything else).
|
||||
* Don't show "Unhandled communication error" on autodetection failure.
|
||||
* Make timeout after which to unload the webcam stream after navigating away from it configurable (as suggested in [#1937](https://github.com/foosel/OctoPrint/issues/1937))
|
||||
* Add `ToolChange` event and tool change GCODE scripts
|
||||
* Support parsing GCODE subcodes.
|
||||
* Add `octoprint.users.factory` hook, allowing plugins to extend/swap out the user manager OctoPrint uses.
|
||||
* Corewizard: Disable view model and client code if it's not actually required.
|
||||
* Corewizard: Disable injection of JS files into UI when it's not actually required.
|
||||
* GCODE analysis: Moved into its own subprocess. That should improve performance on multi core systems.
|
||||
* GCODE viewer: Ignore coordinates outside bed when zooming/centering on model. Those usually are nozzle priming routines.
|
||||
* JS Client Lib: Add centralized browser detection as `OctoPrint.coreui.browser`. Available properties: `chrome`, `firefox`, `safari`, `ie`, `edge`, `opera` as well as `mobile` and `desktop`, all of which are boolean values.
|
||||
* Plugin Manager plugin: Detect if a plugin requires a reconnect to the printer to become fully active/inactive.
|
||||
* Software Update plugin: Force exact version when updating OctoPrint and tracking releases.
|
||||
* Software Update plugin: "Devel RCs" release channel now also tracks maintenance RCs. That way people don't have to toggle between the two any more to get *all* RCs.
|
||||
* Software Update plugin: `bitbucket_commit` check type now supports API credentials (see also [#1993](https://github.com/foosel/OctoPrint/pull/1993)).
|
||||
* Wizard: Allow suppressing the "the settings got updated" dialog through subwizards, in case they need to update settings asynchronously as part of their workflow.
|
||||
* More resilience against expected folders being files.
|
||||
* More resilience against a wrong user manager class being configured.
|
||||
* Some code refactoring & cleanup.
|
||||
* Some HTML & CSS improvements.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* [#1916](https://github.com/foosel/OctoPrint/issues/1916) - Fix webcam not loading if first/initial tab is "Control"
|
||||
* [#1924](https://github.com/foosel/OctoPrint/issues/1924) - Filter out source map links from bundled JS webassets.
|
||||
* [#1943](https://github.com/foosel/OctoPrint/issues/1943) - Fix issue causing unnecessary creation of default printer profile on startup
|
||||
* [#1946](https://github.com/foosel/OctoPrint/issues/1946) - Decouple writing of print log from everything else. Fixes delay in cancel processing.
|
||||
* [#1963](https://github.com/foosel/OctoPrint/issues/1963) & [#1974](https://github.com/foosel/OctoPrint/issues/1974) - Allow empty & custom size in print job events. Also fixes an issue with timelapses when printing from SD on printers that require the GPX plugin to work.
|
||||
* [#1996](https://github.com/foosel/OctoPrint/issues/1996) - Support all line ending variantes in the GCODE viewer. Solves an issue with GCODE generated for Prusa's multi material extruder since that uses only `\r` for some reason.
|
||||
* [#2007](https://github.com/foosel/OctoPrint/issues/2007) - Fix issue parsing temperature lines from the printer that contain negative values.
|
||||
* [#2012](https://github.com/foosel/OctoPrint/issues/2012) - Fix command line interface of Software Update plugin.
|
||||
* [#2017](https://github.com/foosel/OctoPrint/issues/2017) - Fix issue in GCODE viewer with files that contain a visit to the first layer twice (e.g. brim, then nose dive from higher z for actual model), causing all but the last layer segment to not be rendered.
|
||||
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) (regression) - Temperature tab: Fix for legend in graph not updating with current values on mouse over.
|
||||
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) (regression) - Temperature tab: Fix for new temperature inputs not fitting on one line in Firefox.
|
||||
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) (regression) - Temperature tab & GCODE viewer: Fix for available tools (and offsets) not properly updating on change of printer profile.
|
||||
* [#2033](https://github.com/foosel/OctoPrint/issues/2033) (regression) - Wizard: Fix sorting of required wizards not properly handling non-ASCII unicode.
|
||||
* [#2035](https://github.com/foosel/OctoPrint/issues/2035) (regression) - Fix an issue of the server not starting up if there's a file in the analysis backlog. The reason for this is that spawning a new process while the intermediary server is active causes the server port to be blocked (this is due to how subprocessing works by default), in turn leading to an error on startup since the port cannot be bound by the actual server. Since the GCODE analysis takes now place in its own subprocess and hence triggers this problem, it had to be moved until after the actual server has already started up to avoid this problem.
|
||||
* [#2059](https://github.com/foosel/OctoPrint/issues/2059) (regression) - Fix an issue causing the new temperature controls to wrap on touch enabled devices when the temperature dropdown is opened.
|
||||
* [#2090](https://github.com/foosel/OctoPrint/issues/2090) (regression) - Fix an issue causing an aborted server startup under Windows if the timing is just right.
|
||||
* [#2135](https://github.com/foosel/OctoPrint/issues/2135) (regression) - Fix an issue causing import errors inside the GCODE analysis tool in certain environments due to `sys.path` entries causing relative imports.
|
||||
* [#2136](https://github.com/foosel/OctoPrint/issues/2136) (regression) - Fix wrong minimum version for `sockjs-tornado` dependency.
|
||||
* [#2137](https://github.com/foosel/OctoPrint/issues/2137) (regression) - Fix issue with session cookies getting lost when running an OctoPrint instance on a subpath of another (e.g. `octopi.local/` and `octopi.local/octoprint2`).
|
||||
* [#2140](https://github.com/foosel/OctoPrint/issues/2140) (regression) - Fix issue with locale dependent sorting of sub wizards during first time setup causing issues leading to the wizard not being able to complete.
|
||||
* Fix various popup buttons allowing multiple clicks (suggested in [#1914](https://github.com/foosel/OctoPrint/issues/1914))
|
||||
* Software Update Plugin: Perform server restart asynchronously. Should reduce restart times on updates significantly.
|
||||
* Don't hex-escape `\t`, `\r` or `\n` in terminal output
|
||||
* Use client side default printer profile if the default profile could not be found on the server
|
||||
* Use both "to" and "from" coordinates of a given move for min/max model coordinate calculation in GCODE analysis. Otherwise wrong values could be calculated under certain circumstances.
|
||||
* Fix potential race condition in resend request handling.
|
||||
* Fix potential race condition in web socket handling.
|
||||
* Fix handling of tool offsets in GCODE analysis - diverted too far from firmware implementations, causing wrong calculations.
|
||||
* Fix `FileAdded`, `FileRemoved`, `FolderAdded`, `FolderRemoved` events not being fired with the correct event name.
|
||||
* Fix potential division by zero in progress reporting if the timing was just right.
|
||||
* Fix sorting order for multiple tools in the "State" panel.
|
||||
* Fix file position vs. line ending handling in GCODE viewer. Could lead to slightly off file position calculation and hence possibly to the wrong move being plotted when synchronizing with print progress.
|
||||
* Wizard: Fix `onWizardPreventSettingsRefreshDialog` callback invocation. (regression)
|
||||
* Corewizard plugin: Fix `firstrunonly` wizards (e.g. for printer profile configuration) being displayed again if _any_ of the sub wizards (e.g. for the online check opt-in and configuration) is active. (regression)
|
||||
* Fix an issue causing rollover of `serial.log` to fail under Windows. (regression)
|
||||
|
||||
### More Information
|
||||
|
||||
* [Commits](https://github.com/foosel/OctoPrint/compare/1.3.4...1.3.5)
|
||||
* Release Candidates:
|
||||
* [1.3.5rc1](https://github.com/foosel/OctoPrint/releases/tag/1.3.5rc1)
|
||||
* [1.3.5rc2](https://github.com/foosel/OctoPrint/releases/tag/1.3.5rc2)
|
||||
* [1.3.5rc3](https://github.com/foosel/OctoPrint/releases/tag/1.3.5rc3)
|
||||
* [1.3.5rc4](https://github.com/foosel/OctoPrint/releases/tag/1.3.5rc4)
|
||||
* A special **Thank you!** to everyone who reported back on these release candidates this time: [alexxy](https://github.com/alexxy), [andrivet](https://github.com/andrivet), [b-morgan](https://github.com/b-morgan), [BillyBlaze](https://github.com/BillyBlaze), [CapnBry](https://github.com/CapnBry), [chippypilot](https://github.com/chippypilot), [ctgreybeard](https://github.com/ctgreybeard), [cxt666](https://github.com/cxt666), [DaSTIG](https://github.com/DaSTIG), [fhbmax](https://github.com/fhbmax), [fiveangle](https://github.com/fiveangle), [goeland86](https://github.com/goeland86), [JohnOCFII](https://github.com/JohnOCFII), [Kunsi](https://github.com/Kunsi), [mgrl](https://github.com/mgrl), [MoonshineSG](https://github.com/MoonshineSG), [nate-ubiquisoft](https://github.com/nate-ubiquisoft), [Neoolog](https://github.com/Neoolog), [ntoff](https://github.com/ntoff), [oferfrid](https://github.com/oferfrid), [roygilby](https://github.com/roygilby), [SAinc](https://github.com/SAinc), [sbts](https://github.com/sbts), [thess](https://github.com/thess), [tkurbad](https://github.com/tkurbad), [tsillini](https://github.com/tsillini) and [TylonHH](https://github.com/TylonHH).
|
||||
|
||||
## 1.3.4 (2017-06-01)
|
||||
|
||||
### Note for owners of Malyan M200/Monoprice Select Mini
|
||||
|
||||
OctoPrint's firmware autodetection is now able to detect this printer. Currently when this printer is detected, the following firmware specific features will be enabled automatically:
|
||||
|
||||
* Always assume SD card is present (`feature.sdAlwaysAvailable`)
|
||||
* Send a checksum with the command: Always (`feature.alwaysSendChecksum`)
|
||||
|
||||
Since the firmware is a very special kind of beast and its sources are so far unavailable, only tests with a real printer will show if those are sufficient settings for communication with this printer to fully function correctly. Thus, if you run into any issues with enabled firmware autodetection on this printer model, please add a comment in [#1762](https://github.com/foosel/OctoPrint/issues/1762) and explain what kind of communication problem you are seeing. Also make sure to include a [`serial.log`](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#where-can-i-find-those-log-files-you-keep-talking-about)!
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* [#1942](https://github.com/foosel/OctoPrint/issues/1942) - Fixed crash on startup in case of an invalid default printer profile combined with "auto-connect on startup" being selected and the printer available to connect to.
|
||||
|
||||
### More information
|
||||
|
||||
* [Commits](https://github.com/foosel/OctoPrint/compare/1.3.1...1.3.2)
|
||||
* Release Candidates:
|
||||
* None since this constitutes a hotfix release to fix an apparently very rare bug introduced with 1.3.3 that seems to be affecting a small number of users.
|
||||
|
||||
## 1.3.3 (2017-05-31)
|
||||
|
||||
### Note for owners of Malyan M200/Monoprice Select Mini
|
||||
|
||||
OctoPrint's firmware autodetection is now able to detect this printer. Currently when this printer is detected, the following firmware specific features will be enabled automatically:
|
||||
|
||||
* Always assume SD card is present (`feature.sdAlwaysAvailable`)
|
||||
* Send a checksum with the command: Always (`feature.alwaysSendChecksum`)
|
||||
|
||||
Since the firmware is a very special kind of beast and its sources are so far unavailable, only tests with a real printer will show if those are sufficient settings for communication with this printer to fully function correctly. Thus, if you run into any issues with enabled firmware autodetection on this printer model, please add a comment in [#1762](https://github.com/foosel/OctoPrint/issues/1762) and explain what kind of communication problem you are seeing. Also make sure to include a [`serial.log`](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#where-can-i-find-those-log-files-you-keep-talking-about)!
|
||||
|
||||
### Improvements
|
||||
|
||||
* [#478](https://github.com/foosel/OctoPrint/issues/478) - Made webcam stream container fixed height (with selectable aspect ratio) to prevent jumps of the controls beneath it on load.
|
||||
* [#748](https://github.com/foosel/OctoPrint/issues/748) - Added delete confirmation and bulk delete for timelapses. See also the discussion in brainstorming ticket [#1807](https://github.com/foosel/OctoPrint/issues/1807).
|
||||
* [#1092](https://github.com/foosel/OctoPrint/issues/1092) - Added new events to the file manager: `FileAdded`, `FileRemoved`, `FolderAdded`, `FolderRemoved`. Contrary to the `Upload` event, `FileAdded` will always fire when a file was added to storage through the file manager, not only when added through the web interface. Extended documentation accordingly.
|
||||
* [#1521](https://github.com/foosel/OctoPrint/issues/1521) - Software update plugin: Display timestamp of last version cache refresh in "Advanced options" area.
|
||||
* [#1734](https://github.com/foosel/OctoPrint/issues/1734) - Treat default/initial printer profile like all other printer profiles, persisting it to disk instead of `config.yaml` and allowing deletion. OctoPrint will migrate the existing default profile to the new location on first start.
|
||||
* [#1734](https://github.com/foosel/OctoPrint/issues/1734) - Better communication of what actions are available for printer profiles.
|
||||
* [#1739](https://github.com/foosel/OctoPrint/issues/1739) - Software update plugin: Added option to hide update notification from users without admin rights, added "ignore" button and note to get in touch with an admit to update notifications for non admin users.
|
||||
* [#1762](https://github.com/foosel/OctoPrint/issues/1762) - Added Malyan M200/Monoprice Select Mini to firmware autodetection.
|
||||
* [#1811](https://github.com/foosel/OctoPrint/issues/1811) - Slight rewording and rearrangement in timelapse configuration, better feedback if settings have been saved.
|
||||
* [#1818](https://github.com/foosel/OctoPrint/issues/1818) - Support both Marlin/Repetier and Smoothieware interpretations of `G90` after an `M83` in GCODE viewer and analysis. Select "G90/G91 overrides relative extruder mode" in Settings > Features for the Smoothieware interpretation.
|
||||
* [#1858](https://github.com/foosel/OctoPrint/issues/1858) - Announcement plugin: Images from registered feeds now are lazy loading.
|
||||
* [#1862](https://github.com/foosel/OctoPrint/issues/1862) - Automatically re-enable fancy terminal functionality when performance recovers.
|
||||
* [#1875](https://github.com/foosel/OctoPrint/issues/1875) - Marked the command input field in the Terminal tab as not supporting autocomplete to work around an issue in Safari. Note that this is probably only a temporary workaround due to browser vendors [working on deprecating `autocomplete="off"` support](https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164) and a different solution will need to be found in the future.
|
||||
* Added link to [`SerialException` FAQ entry](https://github.com/foosel/OctoPrint/wiki/FAQ#octoprint-randomly-loses-connection-to-the-printer-with-a-serialexception) to terminal output when such an error is encountered, as suggested in [#1876](https://github.com/foosel/OctoPrint/issues/1876).
|
||||
* Force refresh of settings on login/logout.
|
||||
* Made system wide API key management mirror user API key management.
|
||||
* Make sure to always migrate and merge saved printer profiles with default profile to ensure all parameters are set. Should avoid issues with plugins trying to save outdated/incomplete profiles.
|
||||
* Added note on lack of language pack repository & to use the wiki for now.
|
||||
* Earlier validation of file to select for printing.
|
||||
* Limit verbosity of failed system event handlers.
|
||||
* Made bundled python client `octoprint_client` support multiple client instances.
|
||||
* Disable "Reload" button in the "Please reload" overlay once clicked, added spinner.
|
||||
* Updated pnotify to 2.1.0.
|
||||
* Get rid of ridiculous float precision in temperature commands.
|
||||
* Detect invalid settings data to persist (not a dict), send 400 status in such a case.
|
||||
* More logging for preemptive caching, to help narrow down any performance issues that might be related to this.
|
||||
* Further decoupling of some startup tasks from initial server startup thread for better parallelization and improved startup times.
|
||||
* Announcement plugin: Added combined OctoBlog feed, replacing news and spotlight feed, added corresponding config migration.
|
||||
* Announcement plugin: Subscribe to all registered feeds by default to ensure better communication flow (all subscriptions but the "Important" channel can however be unsubscribed easily, added corresponding note to the notifications and also a configuration button to the announcement reader).
|
||||
* Announcement plugin: Auto-hide announcements on logout.
|
||||
* Announcement plugin: Order channels server-side based on new order config setting.
|
||||
* Plugin manager: Show warning when disabling a bundled plugin that is not recommended to be disabled, including a reason why disabling it is not recommended. Applies to the bundled announcement, core wizard, discovery and software update plugins.
|
||||
* Plugin manager: Support for plugin notices for specific plugins from the plugin repository, e.g. to inform users of specific plugins about known issues with the plugin or instruct to update when the software update mechanism of the current plugin version turns out to be misconfigured. Supports matching installed plugin versions and OctoPrint versions to target only affected users.
|
||||
* Plugin manager: Better visualization of plugins disabled on the repository, no longer shown as "incompatible" but "disabled", with link to the plugin repository page that contains more information.
|
||||
* Plugin manager: Detect necessity to reinstall a plugin provided through archive URL or upload and immediately do that instead of reporting an "unknown error" without further information.
|
||||
* Plugin manager: Added `freebsd` for compatibility check.
|
||||
* Plugin manager: More general flexibility for OS compatibility check:
|
||||
* Support for arbitrary values to match against
|
||||
* Allow 1:1 check again `sys.platform` values (with `startswith`).
|
||||
* Support black listing (`!windows`) additionally to white listing. A detected OS must match all provided white list elements (if the white list is empty that is considered to be always the case) and none of the black list elements (if the black list is empty that is also considered to be always the case).
|
||||
* Software update plugin: New check type `bitbucket_commit` (see also [#1898](https://github.com/foosel/OctoPrint/pull/1898))
|
||||
* Docs: Now referring to dedicated Jinja 2.8 documentation as hosted at [jinja.octoprint.org](http://jinja.octoprint.org) for all template needs, to avoid confusion when consulting current Jinja documentation as available on its project page (2.9+, which OctoPrint can't upgrade to due to backwards incompatible changes).
|
||||
* Docs: Better documentation of what kind of input the `FileManager` accepts for `select_file`.
|
||||
* Docs: Specified OctoPrint version required for plugin tutorial.
|
||||
|
||||
### Bug fixes
|
||||
|
||||
* [#202](https://github.com/foosel/OctoPrint/issues/202) - Fixed an issue with the drag-n-drop area flickering if the mouse was moved too slow while dragging (see also [#1867](https://github.com/foosel/OctoPrint/pull/1867)).
|
||||
* [#1671](https://github.com/foosel/OctoPrint/issues/1671) - Removed obsolete entry of no longer available filter for empty folders from file list options.
|
||||
* [#1821](https://github.com/foosel/OctoPrint/issues/1821) - Properly reset "Capture post roll images" setting in timelapse configuration when switching from "off" to "timed" timelapse mode.
|
||||
* [#1822](https://github.com/foosel/OctoPrint/issues/1822) - Properly reset file metadata when a file is overwritten with a new version.
|
||||
* [#1836](https://github.com/foosel/OctoPrint/issues/1836) - Fixed order of `PrintCancelled` and `PrintFailed` events on print cancel.
|
||||
* [#1837](https://github.com/foosel/OctoPrint/issues/1837) - Fixed a race condition causing OctoPrint trying to read data from the current job on job cancel that was no longer there.
|
||||
* [#1838](https://github.com/foosel/OctoPrint/issues/1838) - Fixed a rare race condition causing an error right at the very start of a print.
|
||||
* [#1863](https://github.com/foosel/OctoPrint/issues/1863) - Fixed an issue in the analysis of GCODE files containing coordinate offsets for X, Y or Z via `G92`, leading to a wrong calculation of the model size thanks to accumulating offsets.
|
||||
* [#1882](https://github.com/foosel/OctoPrint/issues/1882) - Fixed a rare race condition occurring at the start of streaming a file to the printer's SD card, leading to endless line number mismatches.
|
||||
* [#1884](https://github.com/foosel/OctoPrint/issues/1884) - CuraEngine plugin: Fixed a potential encoding issue when logging non-ASCII parameters supplied to CuraEngine
|
||||
* [#1891](https://github.com/foosel/OctoPrint/issues/1891) - Fixed error when handling unicode passwords.
|
||||
* [#1893](https://github.com/foosel/OctoPrint/issues/1893) - CuraEngine plugin: Fixed handling of multiple consecutive uploads of slicing profiles (see also [#1894](https://github.com/foosel/OctoPrint/issues/1894))
|
||||
* [#1897](https://github.com/foosel/OctoPrint/issues/1897) - Removed possibility to concurrently try to perform multiple tests of the configured snapshot URL.
|
||||
* [#1906](https://github.com/foosel/OctoPrint/issues/1906) - Fixed interpretation of `G92` in GCODE analysis.
|
||||
* [#1907](https://github.com/foosel/OctoPrint/issues/1907) - Don't send temperature commands with tool parameter when a shared nozzle is defined.
|
||||
* [#1917](https://github.com/foosel/OctoPrint/issues/1917) (regression) - Fix job data resetting on print job completion.
|
||||
* [#1918](https://github.com/foosel/OctoPrint/issues/1918) (regression) - Fix "save as default" checkbox not being disabled when other controls are disabled.
|
||||
* [#1919](https://github.com/foosel/OctoPrint/issues/1919) (regression) - Fix call to no longer existing function in Plugin Manager UI.
|
||||
* [#1934](https://github.com/foosel/OctoPrint/issues/1934) (regression) - Fix consecutive timed timelapse captures without configured post roll.
|
||||
* Fixed API key QR Code being shown (for "n/a" value) when no API key was set.
|
||||
* Fixed timelapse configuration API not returning 400 status code on some bad parameters.
|
||||
* Fixed a typo (see also [#1826](https://github.com/foosel/OctoPrint/pull/1826)).
|
||||
* Fixed `filter` and `force` parameters on `/api/files/<origin>`.
|
||||
* Fixed message catchall `*` not working in the socket client library.
|
||||
* Fixed analysis backlog calculation for sub folders.
|
||||
* Fixed `PrinterInterface.is_ready` to behave as documented.
|
||||
* Use black listing instead of white listing again to detect if the `daemon` sub command is supported or not. Should resolve issues users of FreeBSD and the like where having with `octoprint daemon`.
|
||||
* Use `pip` instead of `python setup.py develop` in `octoprint dev plugin:install` command to avoid issues on Windows.
|
||||
* Docs: Fixed a wrong command in the plugin tutorial (see also [#1860](https://github.com/foosel/OctoPrint/pull/1860)).
|
||||
|
||||
### More information
|
||||
|
||||
- [Commits](https://github.com/foosel/OctoPrint/compare/1.3.2...1.3.3)
|
||||
- Release Candidates:
|
||||
- [1.3.3rc1](https://github.com/foosel/OctoPrint/releases/tag/1.3.3rc1)
|
||||
- [1.3.3rc2](https://github.com/foosel/OctoPrint/releases/tag/1.3.3rc2)
|
||||
- [1.3.3rc3](https://github.com/foosel/OctoPrint/releases/tag/1.3.3rc3)
|
||||
|
||||
## 1.3.2 (2017-03-16)
|
||||
|
||||
### Note for plugin authors
|
||||
|
||||
**If you maintain a plugin that extends OctoPrint's [JavaScript Client Library](http://docs.octoprint.org/en/master/jsclientlib/index.html)** like demonstrated in e.g. the bundled Software Update Plugin you'll need to update the way you register your plugin to depend on `OctoPrintClient` and registering your extension as shown [here](https://github.com/foosel/OctoPrint/blob/6e793c2/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js#L1-L84) instead of directly writing to `OctoPrint.plugins` (like it was still done [here](https://github.com/foosel/OctoPrint/blob/23744cd/src/octoprint/plugins/softwareupdate/static/js/softwareupdate.js#L1-L81)). That way your extensions will be available on all instances of `OctoPrintClient`, not just the global instance `OctoPrint` that gets created on startup of the core web interface.
|
||||
|
||||
If all you plugin does with regards to JavaScript is registering a custom view model and you have no idea what I'm talking about regarding extending the client library, no action is necessary. This heads-up is really only relevant if you extended the JavaScript Client Library.
|
||||
|
||||
### Improvements
|
||||
|
||||
- [#732](https://github.com/foosel/OctoPrint/pull/732) - Have OctoPrint's `python setup.py clean` build on stock
|
||||
`python setup.py clean` for better compatibility with packaging systems
|
||||
- [#1506](https://github.com/foosel/OctoPrint/issues/1506) - Better handle really long "dwell"/`G4` commands on Repetier firmware (as for example apparently recommended to use with Wanhao D6 and similar printers for nozzle cooling) by actively stalling communication from OctoPrint's side as well. That way we no longer run into a communication timeout produced by a 5min dwell immediately happily acknowledged by the printer with an `ok`.
|
||||
- [#1542](https://github.com/foosel/OctoPrint/issues/1542) - Support for multi-extruder setups with a shared single nozzle and heater (e.g. E3D Cyclops, Diamond hotend, etc).
|
||||
- [#1676](https://github.com/foosel/OctoPrint/issues/1676) - Trigger line number reset when connected to printer and seeing `start` message. This should fix issues with printer communication when printer resets but reset goes otherwise undetected.
|
||||
- [#1681](https://github.com/foosel/OctoPrint/issues/1681) - Support for connecting to multiple OctoPrint instances via the [JavaScript Client Library](http://docs.octoprint.org/en/master/jsclientlib/index.html).
|
||||
- [#1712](https://github.com/foosel/OctoPrint/issues/1712) - Display current folder name in file list if in sub folder.
|
||||
- [#1723](https://github.com/foosel/OctoPrint/issues/1723) - Ignore leading `v` or `V` on plugin version numbers for version checks in plugin manager and software updater (see also [#1724](https://github.com/foosel/OctoPrint/pull/1724))
|
||||
- [#1770](https://github.com/foosel/OctoPrint/issues/1770) - Better resilience against null bytes received from the printer for whatever reason.
|
||||
- [#1770](https://github.com/foosel/OctoPrint/issues/1770) - Detect printer as connected even when only receiving a `wait` instead of `ok`. Should solve issues with initial connect where printer sends garbage over the line that eats/covers the `ok` if printer also sends regular `wait` messages when idle.
|
||||
- [#1780](https://github.com/foosel/OctoPrint/issues/1780) - Work around for Safari re-opening one copy of the webcam stream after the other and eating up bandwidth unnecessarily (see also [#1786](https://github.com/foosel/OctoPrint/issues/1786))
|
||||
- [#1790](https://github.com/foosel/OctoPrint/issues/1790) - Removed unused "color" property from printer profile editor.
|
||||
- [#1805](https://github.com/foosel/OctoPrint/issues/1805) - Better error resilience against invalid print history data from plugins that replace the printer communication.
|
||||
- Better error resilience in Plugin Manager against wonky version data in repository file.
|
||||
- Added a "Restart in safe mode" system menu entry that will always be available if the restart command is configured
|
||||
- CLI: Only offer `daemon` sub command on Linux (since that it's the only OS it works on)
|
||||
- Less throttling of analysis of GCODE files from the analysis backlog. Should still leave Pi and friends air to breathe but allow a slightly faster processing of the backlog.
|
||||
- Added an explanation of safe mode to the docs.
|
||||
- Log OctoPrint version & plugin list when detecting log rollover.
|
||||
- Allow `UiPlugin`s to define additional fields for ETag generation.
|
||||
- Allow `UiPlugin`s utilizing OctoPrint's stock templates to filter out what they don't need.
|
||||
- Locales contained in `translations` of plugins will now be registered with the system. That way it's possible to provide translations for the full application through plugins.
|
||||
- Abort file analysis if file is about to be overwritten
|
||||
- Software Update Plugin: Refresh cache on startup, prevent concurrent refresh
|
||||
- More solid parsing of request line number for resend requests. Should improve compatibility with Teacup firmwares. Based on issue reported via PR [#300](https://github.com/foosel/OctoPrint/pull/300)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- [#733](https://github.com/foosel/OctoPrint/issues/733) - Fixed multiple event handler commands running concurrently. Now they run one after the other, as expected.
|
||||
- [#1317](https://github.com/foosel/OctoPrint/issues/1317) - Fixed a color distortion issue when rendering timelapses from higher resolution source snapshots that also need to be rotated by adjusting `ffmpeg` parameters to avoid an unexpected behaviour when a pixel format and a filter chain are required for processing.
|
||||
- [#1560](https://github.com/foosel/OctoPrint/issues/1560) - Make sure we don't try to use an empty `logging.yaml`
|
||||
- [#1631](https://github.com/foosel/OctoPrint/issues/1631) - Disable "Slice" button in slice dialog if a print is ongoing and a slicer is selected that runs on the same device as OctoPrint. The server would already deny such requests (simply due to performance reasons), but the UI didn't properly reflect that yet.
|
||||
- [#1671](https://github.com/foosel/OctoPrint/issues/1671) - Removed "Hide empty folders" option from file list. Didn't really add value and caused usability issues.
|
||||
- [#1771](https://github.com/foosel/OctoPrint/issues/1771) - Fixed `_config_version` in plugin settings not being properly updated.
|
||||
- [#1732](https://github.com/foosel/OctoPrint/issues/1732) - Fixed a bug in the documentation for the printer profile API
|
||||
- [#1760](https://github.com/foosel/OctoPrint/issues/1760) - Fixed missing reselect of selected file when updating via the watched folder, causing wrong progress percentages to be reported.
|
||||
- [#1765](https://github.com/foosel/OctoPrint/issues/1765) - Fixed watched folder not waiting with file move until file stopped growing, causing wrong progress percentages to be reported.
|
||||
- [#1777](https://github.com/foosel/OctoPrint/issues/1777) - Fixed z-change based timelapses with Slic3r generated z-hops not properly triggering snapshots.
|
||||
- [#1792](https://github.com/foosel/OctoPrint/issues/1792) - Don't tell Safari we are "web-app-capable" because that means it will throw away all cookies and the user will have to constantly log in again when using a desktop shortcut for the OctoPrint instance.
|
||||
- [#1812](https://github.com/foosel/OctoPrint/issues/1812) - Don't scroll up navigation in settings when switching between settings screens, very annoying on smaller resolutions (see also [#1814](https://github.com/foosel/OctoPrint/pull/1814))
|
||||
- Fix settings helper not allowing to delete values for keys that are present in the local config but not in the defaults.
|
||||
- Fix wrong replacement value for `__progress` in registered command line or GCODE [event handlers](http://docs.octoprint.org/en/master/events/index.html).
|
||||
- Various fixes in the Software Update Plugin:
|
||||
- Don't remove manual software update configurations on settings migration.
|
||||
- Properly delete old restart/reboot commands that are now defined globally since config version 4. An issue with the settings helper prevented us from properly deleting them during migration to version 4.
|
||||
- Fixed `python_checker` version check method and `python_updater` update method.
|
||||
- Fixed update configs without a restart of any kind causing an issue due to an undefined variable.
|
||||
- Fixed broken doctests.
|
||||
- Upgrade LESS.min.js from 2.7.1 to 2.7.2 to fix the broken contrast function
|
||||
- Always create a new user session for requests with an API key
|
||||
- Fixed an error when reading all user settings via the API
|
||||
- Fixed a bunch of caching issues for the page, was not properly updated on change of snapshot URL presence, system menu entry presence, gcode viewer enabled/disabled, changes in access control availability.
|
||||
- Fixed wrong bundling of core and plugin assets
|
||||
- Software Update Plugin: Fixed wrong ETag calculation
|
||||
- Disable external heatup detection until firmware is detected
|
||||
- Fixed login dropdown not closing on click outside of it
|
||||
- Fixed new user settings getting lost until restart
|
||||
- Don't call `onUserLoggedIn`/`onUserLoggedOut` on user reload
|
||||
|
||||
### More information
|
||||
|
||||
- [Commits](https://github.com/foosel/OctoPrint/compare/1.3.1...1.3.2)
|
||||
- Release Candidates:
|
||||
- [1.3.2rc1](https://github.com/foosel/OctoPrint/releases/tag/1.3.2rc1)
|
||||
|
||||
## 1.3.1 (2017-01-25)
|
||||
|
||||
### Note for upgraders
|
||||
|
||||
#### If you installed OctoPrint manually and used the included init script, you need to update that
|
||||
|
||||
The init script so far shipped with OctoPrint contained a [bug](https://github.com/foosel/OctoPrint/issues/1657) that causes issues with OctoPrint 1.3.0 and higher. Please update your init script to the fixed version OctoPrint now ships under `scripts`:
|
||||
|
||||
```
|
||||
sudo cp /path/to/OctoPrint/scripts/octoprint.init /etc/init.d/octoprint
|
||||
```
|
||||
|
||||
If you are running OctoPi, this does **not** apply to you and you do not need to do anything here!
|
||||
|
||||
#### Change in stock terminal filter configuration
|
||||
|
||||
1.3.1 fixes an issue with the two terminal filters for suppressing temperature and SD status messages and adds a new filter for filtering out firmware `wait` messages. These changes will only be active automatically though for stock terminal filter configurations. If you have customized your terminal filters, you'll need to apply these changes manually under "Settings > Terminal filters":
|
||||
- Changed "Suppress temperature messages" filter, new regex is `(Send: (N\d+\s+)?M105)|(Recv: ok (B|T\d*):)`
|
||||
- Changed "Suppress SD status messages" filter, new regex is `(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)`
|
||||
- New "Suppress wait responses" filter, regex is `Recv: wait`
|
||||
|
||||
### Improvements
|
||||
- [#1607](https://github.com/foosel/OctoPrint/issues/1607) - Way better support for password managers (e.g. browser built-in, 1Password, Lastpass, Dashlane)
|
||||
- [#1638](https://github.com/foosel/OctoPrint/issues/1638) - Make confirmation dialog when cancelling a print optional.
|
||||
- [#1656](https://github.com/foosel/OctoPrint/issues/1656) - Make wording of buttons on print cancel dialog less confusing.
|
||||
- [#1705](https://github.com/foosel/OctoPrint/pull/1705) - Simplified install process on Mac by removing dependency on pyobjc.
|
||||
- [#1706](https://github.com/foosel/OctoPrint/pull/1706) - Added a mask icon for Safari pinned tab and touchbar.
|
||||
- Support extraction of filament diameter for volume calculation from GCODE files sliced through Simplify3D.
|
||||
- Abort low priority jobs in the file analysis queue when a high priority job comes in - should make file analysis and hence time estimates show up faster for newly uploaded files.
|
||||
- Added a terminal filter for firmware `wait` messages to the stock terminal filters. If you did modify your terminal filter configuration, you might want to add this manually:
|
||||
- New "Suppress wait responses" filter: `Recv: wait`
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- [#1344](https://github.com/foosel/OctoPrint/issues/1344) - Fix ProgressBarPlugins to not correctly be triggered for 0% (second try, this time hopefully for good).
|
||||
- [#1637](https://github.com/foosel/OctoPrint/issues/1637) - Fix issue preventing a folder to be deleted that has a name which is a common prefix of the file currently being printed.
|
||||
- [#1641](https://github.com/foosel/OctoPrint/issues/1641) - Fix issue with `octoprint --daemon` not working.
|
||||
- [#1647](https://github.com/foosel/OctoPrint/issues/1647) - Fix issue with `octoprint` command throwing an error if an environment variable `OCTOPRINT_VERSION` was set to its version number.
|
||||
- [#1648](https://github.com/foosel/OctoPrint/issues/1648) - Added missing `websocket-client` dependency of `octoprint client` to install script.
|
||||
- [#1653](https://github.com/foosel/OctoPrint/issues/1653) - Fix for an issue with the included init script on the BBB (see also [#1654](https://github.com/foosel/OctoPrint/issues/1654))
|
||||
- [#1657](https://github.com/foosel/OctoPrint/issues/1657) - Fix init script regarding check for configured `CONFIGFILE` variable.
|
||||
- [#1657](https://github.com/foosel/OctoPrint/issues/1657) - Don't care about ordering of common parameters (like `--basedir`, `--config`) on CLI.
|
||||
- [#1660](https://github.com/foosel/OctoPrint/issues/1660) - Do not show hint regarding keyboard controls beneath webcam stream if keyboard control feature is disabled.
|
||||
- [#1667](https://github.com/foosel/OctoPrint/issues/1667) - Fix for matching folders not getting listed in the results when performing a search in the file list.
|
||||
- [#1675](https://github.com/foosel/OctoPrint/issues/1675) - Fix model size calculation in GCODE analysis, produced wrong values in some cases. Also adjusted calculation to match implementation in GCODE viewer, now both produce identical results.
|
||||
- [#1685](https://github.com/foosel/OctoPrint/issues/1685) - Cura Plugin: Fix filament extraction from CuraEngine slicing output
|
||||
- [#1692](https://github.com/foosel/OctoPrint/issues/1692) - Cura Plugin: Fix solid layer calculation (backport from [Ultimaker/CuraEngine#140](https://github.com/Ultimaker/CuraEngine/issues/140))
|
||||
- [#1693](https://github.com/foosel/OctoPrint/issues/1693) - Cura Plugin: Support `perimeter_before_infill` profile setting. Additionally added support for `solidarea_speed`, `raft_airgap_all`, `raft_surface_thickness`, `raft_surface_linewidth` profile settings and adjusted mapping for engine settings `raftAirGapLayer0`, `raftFanSpeed`, `raftSurfaceThickness`and `raftSurfaceLinewidth` according to current mapping in Cura Legacy and adjusted Mach3 GCODE flavor to substitute `S` with `P` in temperature commands of generated start code, also like in Cura Legacy.
|
||||
- [#1697](https://github.com/foosel/OctoPrint/issues/1697) - Pin Jinja to versions <2.9 for now due to a backwards compatibility issue with templates for versions newer than that. Also pushed as a hotfix to 1.3.0 (as 1.3.0post1).
|
||||
- [#1708](https://github.com/foosel/OctoPrint/issues/1708) - Cura Plugin: Fixed selection of `start.gcode` for sliced file
|
||||
- Allow a retraction z-hop of 0 in timelapse configuration.
|
||||
- Fix files in sub folders to not be processed by the initial analysis backlog check during startup of the server.
|
||||
- Various fixes in the file analysis queue:
|
||||
- High priority items are now really high priority
|
||||
- Abort analysis for items that are to be deleted/moved to get around an issue with file access under Windows systems.
|
||||
- Fix stock terminal filters for suppressing temperature messages and SD status messages to also be able to deal with line number prefixes. If you have added additional terminal filters, you will have to apply this fix manually:
|
||||
- Changed "Suppress temperature messages" filter: `(Send: (N\d+\s+)?M105)|(Recv: ok (B|T\d*):)`
|
||||
- Changed "Suppress SD status messages" filter: `(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)`
|
||||
- Fix issue in german translation.
|
||||
|
||||
### More information
|
||||
|
||||
- [Commits](https://github.com/foosel/OctoPrint/compare/1.3.0...1.3.1)
|
||||
- Release Candidates:
|
||||
- [1.3.1rc1](https://github.com/foosel/OctoPrint/releases/tag/1.3.1rc1)
|
||||
- [1.3.1rc2](https://github.com/foosel/OctoPrint/releases/tag/1.3.1rc2)
|
||||
|
||||
## 1.3.0 (2016-12-08)
|
||||
|
||||
### Features
|
||||
|
||||
+209
-127
@@ -12,6 +12,7 @@ or **[creating pull requests](#pull-requests)**.
|
||||
* [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)
|
||||
* [Setting up a development environment](#setting-up-a-development-environment)
|
||||
* [Pull requests](#pull-requests)
|
||||
* [What do the branches mean?](#what-do-the-branches-mean)
|
||||
* [How OctoPrint is versioned](#how-octoprint-is-versioned)
|
||||
@@ -20,45 +21,41 @@ or **[creating pull requests](#pull-requests)**.
|
||||
|
||||
## Issues, Tickets, however you may call them
|
||||
|
||||
Please read the following short instructions fully and follow them. You can
|
||||
Please read the following 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)**
|
||||
- **[Read the FAQ](https://faq.octoprint.org)**
|
||||
- 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
|
||||
[community forum at discourse.octoprint.org](https://discourse.octoprint.org) 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.
|
||||
Consult the [community forum at discourse.octoprint.org](https://discourse.octoprint.org) 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.
|
||||
|
||||
----
|
||||
> 👉 **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 complete 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
|
||||
|
||||
@@ -71,32 +68,39 @@ following section *completely* and also follow the instructions in the
|
||||
|
||||
### What should I do before submitting a bug report?
|
||||
|
||||
1. **Make sure you are at the right location**. This is the Github repository
|
||||
1. **Make sure you are at the right location**. This is the bug tracker
|
||||
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
|
||||
|
||||
**OctoPrint doesn't manage your network connection or your webcam nor
|
||||
can it fix your printer not getting detected as a serial interface** -
|
||||
if you have any kinds of problems with that, get in touch on the
|
||||
[community forum](https://discourse.octoprint.org).
|
||||
|
||||
**This is not the bug tracker 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.
|
||||
[here](https://github.com/guysoft/OctoPi). If you have any kind of specific
|
||||
issue with how the OctoPi system is setup, go there please.
|
||||
|
||||
**This is also not the Github repository of any OctoPrint Plugins you
|
||||
**This is also not the bug tracker 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
|
||||
Finally, **this is also not the right bug 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.
|
||||
any third-party plugins enabled** to make sure it's not a misbehaving
|
||||
plugin causing the issue at hand. For that please restart OctoPrint in
|
||||
**safe mode**, either by selecting "Restart OctoPrint in safe mode" from
|
||||
the "System" menu, or by starting OctoPrint from the command line with
|
||||
`octoprint serve --safe`. Then try to reproduce your issue. Find out
|
||||
more about safe mode in the [docs](http://docs.octoprint.org/en/master/features/safemode.html).
|
||||
|
||||
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)
|
||||
You might also want to try the current development version of OctoPrint
|
||||
(if you aren't already). Refer to the [FAQ](https://faq.octoprint.org)
|
||||
for information on how to do this.
|
||||
|
||||
3. The problem still exists? Then please **look through the
|
||||
@@ -106,8 +110,8 @@ following section *completely* and also follow the instructions in the
|
||||
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
|
||||
(e.g. do not only search for "timelapse" if you happen to run into an issue
|
||||
with your webcam, also search for "recording" 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
|
||||
@@ -121,120 +125,172 @@ following section *completely* and also follow the instructions in the
|
||||
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!
|
||||
|
||||
|
||||
If in doubt about any of the above - get in touch on the [community forum](https://discourse.octoprint.org)
|
||||
instead of opening a ticket here. If you are actually running into a bug, we'll figure it out together
|
||||
there.
|
||||
|
||||
### 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**:
|
||||
**Always use the following template, even if only adding a "me too" to an
|
||||
existing ticket**:
|
||||
|
||||
#### What were you doing?
|
||||
```
|
||||
<!--
|
||||
READ THE FOLLOWING FIRST:
|
||||
|
||||
[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 not already done, please read the the Contribution Guidelines that
|
||||
are linked to the right under "Helpful resources" > "Contributing".
|
||||
|
||||
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.]
|
||||
Also read the FAQ: https://faq.octoprint.org
|
||||
|
||||
#### What did you expect to happen?
|
||||
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).
|
||||
|
||||
#### What happened instead?
|
||||
Do not seek support here ("I need help with ...", "I have a
|
||||
question ..."), that belongs on the community forum at
|
||||
discourse.octoprint.org, NOT here.
|
||||
|
||||
#### Branch & Commit or Version of OctoPrint
|
||||
Mark requests with a "[Request]" prefix in the title please. For bug
|
||||
reports fully fill out the bug reporting template (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).
|
||||
|
||||
[Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.]
|
||||
When reporting a bug do NOT delete ANY lines from the template.
|
||||
|
||||
#### Printer model & used firmware incl. version
|
||||
Make sure any bug you want to report is still present with the CURRENT
|
||||
OctoPrint version and that it does not vanish when you start OctoPrint
|
||||
in safe mode - how to do that is also explained in the Contribution
|
||||
Guidelines linked up there in the big yellow box.
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
Thank you!
|
||||
-->
|
||||
|
||||
#### Browser and Version of Browser, Operating System running Browser
|
||||
#### What were you doing?
|
||||
|
||||
[If applicable, always include if unsure.]
|
||||
<!--
|
||||
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.
|
||||
|
||||
#### Link to octoprint.log
|
||||
Ideally provide exact steps to follow in order to reproduce your problem:
|
||||
-->
|
||||
|
||||
[On gist.github.com or pastebin.com. ALWAYS INCLUDE and never truncate.]
|
||||
1. ...
|
||||
2. ...
|
||||
3. ...
|
||||
|
||||
#### Link to contents of terminal tab or serial.log
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
[On gist.github.com or pastebin.com. If applicable, always include if unsure or
|
||||
reporting communication issues. Never truncate.
|
||||
#### What did you expect to happen?
|
||||
|
||||
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.]
|
||||
#### What happened instead?
|
||||
|
||||
#### Link to contents of Javascript console in the browser
|
||||
#### Did the same happen when running OctoPrint in safe mode?
|
||||
|
||||
[On gist.github.com or pastebin.com or alternatively a screenshot. If applicable -
|
||||
always include if unsure or reporting UI issues.]
|
||||
<!--
|
||||
Test if you can reproduce your problem in safe mode. You can find information
|
||||
on how to enable safe mode in the Contribution Guidelines.
|
||||
|
||||
#### Screenshot(s) showing the problem:
|
||||
If you can't reproduce in safe mode, this is a bug with one of your
|
||||
installed third party plugins. Don't open a ticket here!
|
||||
|
||||
[If applicable. Always include if unsure or reporting UI issues.]
|
||||
If you can't test this in safe mode, state why.
|
||||
-->
|
||||
|
||||
I have read the FAQ.
|
||||
#### Version of OctoPrint
|
||||
|
||||
Copy-paste this template **completely**. Do not skip any lines or the bot
|
||||
*will* complain!
|
||||
<!--
|
||||
Can be found in the lower left corner of the web interface. ALWAYS INCLUDE.
|
||||
-->
|
||||
|
||||
#### Operating System running OctoPrint
|
||||
|
||||
<!--
|
||||
OctoPi, Linux, Windows, MacOS, something else? With version please.
|
||||
OctoPi's version can be found in /etc/octopi_version or in the lower left
|
||||
corner of the web interface.
|
||||
-->
|
||||
|
||||
#### 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.
|
||||
|
||||
The Contribution Guidelines tell you where to find that.
|
||||
-->
|
||||
|
||||
#### 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 (which the Contribution Guidelines tell you where to find).
|
||||
-->
|
||||
|
||||
#### 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.
|
||||
|
||||
The Contribution Guidelines tell you where to find that.
|
||||
-->
|
||||
|
||||
#### Screenshot(s)/video(s) showing the problem:
|
||||
|
||||
<!--
|
||||
If applicable. Always include if unsure or reporting UI issues.
|
||||
-->
|
||||
|
||||
I have read the FAQ.
|
||||
```
|
||||
|
||||
Copy-paste this template **completely** (or use the version that gets pre-filled
|
||||
into the "new issue" form). Do not skip any lines or the bot *will* complain! Provide
|
||||
all requested information or your ticket will be closed.
|
||||
|
||||
### 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.
|
||||
Please refer to [this FAQ entry](https://discourse.octoprint.org/t/how-can-i-find-out-the-version-of-octoprint-or-octopi-i-am-running/204/1).
|
||||
|
||||
### 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).
|
||||
Please refer to [this FAQ entry](https://discourse.octoprint.org/t/where-can-i-find-octoprints-and-octopis-log-files/299/1).
|
||||
|
||||
### 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)
|
||||
|
||||
## Setting up a development environment
|
||||
|
||||
See [the corresponding chapter in the documentation](http://docs.octoprint.org/en/master/development/index.html#setting-up-a-development-environment).
|
||||
This also includes information on how to run the test suite and how to build
|
||||
the documentation.
|
||||
|
||||
## Pull requests
|
||||
|
||||
1. If you want to add a new feature to OctoPrint, **please always first
|
||||
@@ -253,17 +309,18 @@ See [How to open the Javascript Console in different browsers](https://webmaster
|
||||
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
|
||||
`dev/myNewFeature`)[1].
|
||||
4. Create your pull request **only against the `maintenance` or `devel` branch**:
|
||||
* if it's a bug fix for a bug in the current stable version: `maintenance` branch
|
||||
* otherwise: `devel` branch
|
||||
5. Create **one pull request per feature/bug fix**.
|
||||
6. 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:
|
||||
7. 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
|
||||
* 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
|
||||
@@ -272,22 +329,32 @@ See [How to open the Javascript Console in different browsers](https://webmaster
|
||||
``.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
|
||||
8. Ensure your changes **pass the existing unit tests**. PRs that break
|
||||
those cannot be accepted. You can run the unit tests locally (after
|
||||
[initial development environment setup with "develop" dependencies](http://docs.octoprint.org/en/master/development/index.html#setting-up-a-development-environment))
|
||||
by running
|
||||
|
||||
```
|
||||
nosetests --with-doctest
|
||||
```
|
||||
|
||||
in the OctoPrint checkout folder. A [travis build](https://travis-ci.org/foosel/OctoPrint)
|
||||
is also setup so that if the tests should fail, your PR will be marked
|
||||
accordingly.
|
||||
9. **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 you tested
|
||||
your changes. Ideally **add unit tests** - OctoPrint severely 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** :)
|
||||
10. 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.
|
||||
11. Don't forget to **add yourself to the [AUTHORS](./AUTHORS.md)
|
||||
file** :)
|
||||
|
||||
Template to use for Pull Request descriptions:
|
||||
|
||||
@@ -315,7 +382,7 @@ There are three main branches in OctoPrint:
|
||||
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
|
||||
the next release go here. More or less continuously 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
|
||||
@@ -335,10 +402,16 @@ There are three main branches in OctoPrint:
|
||||
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`).
|
||||
* `staging/maintenance`: Any preparation for potential follow-up RCs takes place here.
|
||||
Version number follows the scheme `<x>.<y>.<z>rc<n+1>.dev<commits since increase of n>` (e.g.
|
||||
`1.2.9rc1.dev3`) for a current Maintenance RC of `<x>.<y>.<z>rc<n>`.
|
||||
* `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>`.
|
||||
* `staging/devel`: Any preparation for potential follow-up Devel RCs takes place
|
||||
here. Version number follows the scheme `<x>.<y>.0rc<n+1>.dev<commits since increase of n>` (e.g.
|
||||
`1.3.0rc1.dev12`) for a current Devel RC of `<x>.<y>.0rc<n>`.
|
||||
|
||||
Additionally, from time to time you might see other branches pop up in the repository.
|
||||
Those usually have one of the following prefixes:
|
||||
@@ -350,7 +423,7 @@ Those usually have one of the following prefixes:
|
||||
* `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
|
||||
There is also the `gh-pages` branch, which holds OctoPrint's web page, and a few
|
||||
older development branches that are slowly being migrated or deleted.
|
||||
|
||||
## How OctoPrint is versioned
|
||||
@@ -391,6 +464,15 @@ the local version identifier to allow for an exact determination of the active c
|
||||
* 2016-09-09: New `rc/*` branches explained.
|
||||
* 2016-09-23: Some more work on "How to file a bug report" based on recent
|
||||
experiences
|
||||
* 2017-01-25: Fixed a typo
|
||||
* 2017-03-09: Allow PRs against `maintenance` branch for bugs in stable.
|
||||
* 2017-03-10: Reproduce bugs in safe mode to make sure they are really caused
|
||||
by OctoPrint itself and not a misbehaving plugin.
|
||||
* 2017-03-27: Added safe mode section to ticket template.
|
||||
* 2017-11-22: Added note on how to run the unit tests
|
||||
* 2018-03-15: Link to new community forum and some clarifications re bug
|
||||
reporting
|
||||
* 2018-03-29: "Where to find version numbers" is now located on the FAQ
|
||||
|
||||
## Footnotes
|
||||
* [1] - If you are wondering why, the problem is that anything that you add
|
||||
|
||||
@@ -1,39 +1,45 @@
|
||||
# OctoPrint
|
||||
|
||||
OctoPrint provides a snappy web interface for controlling a 3D printer (RepRap, Ultimaker, ...). It is Free Software
|
||||
[](https://badge.fury.io/gh/foosel%2FOctoPrint)
|
||||
|
||||
OctoPrint provides a snappy web interface for controlling consumer 3D printers. 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).
|
||||
Its website can be found at [octoprint.org](https://octoprint.org/?utm_source=github&utm_medium=readme).
|
||||
|
||||
The community forum is available at [discourse.octoprint.org](https://discourse.octoprint.org/?utm_source=github&utm_medium=readme).
|
||||
|
||||
The FAQ can be accessed by following [faq.octoprint.org](https://faq.octoprint.org/?utm_source=github&utm_medium=readme).
|
||||
|
||||
The documentation is located at [docs.octoprint.org](http://docs.octoprint.org).
|
||||
|
||||
The official plugin repository can be reached at [plugins.octoprint.org](http://plugins.octoprint.org).
|
||||
The official plugin repository can be reached at [plugins.octoprint.org](https://plugins.octoprint.org/?utm_source=github&utm_medium=readme).
|
||||
|
||||
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!
|
||||
**OctoPrint's development wouldn't be possible without the [financial support by its community](https://octoprint.org/support-octoprint/?utm_source=github&utm_medium=readme).
|
||||
If you enjoy OctoPrint, please consider becoming a regular supporter!**
|
||||
|
||||

|
||||
|
||||
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
|
||||
might be of more interest for you. You might also want to subscribe to join
|
||||
[the community forum at discourse.octoprint.org](https://discourse.octoprint.org) where there are other active users who might be
|
||||
able to help you with any questions you might have.
|
||||
|
||||
## 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/).
|
||||
[official documentation](http://docs.octoprint.org/) or [the public wiki](https://github.com/foosel/OctoPrint/wiki), debugging help
|
||||
in the [bug tracker](https://github.com/foosel/OctoPrint/issues), support of other users on
|
||||
[the community forum at discourse.octoprint.org](https://discourse.octoprint.org)
|
||||
and also [financially](https://octoprint.org/support-octoprint/?utm_source=github&utm_medium=readme).
|
||||
|
||||
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
|
||||
For information about how to go about submitting bug reports or pull requests, please see the project's
|
||||
[Contribution Guidelines](https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md).
|
||||
|
||||
## Installation
|
||||
@@ -41,7 +47,7 @@ For information about how to go about contributions of any kind, please see the
|
||||
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)
|
||||
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.
|
||||
|
||||
The generic steps that should basically be done regardless of operating system
|
||||
@@ -52,70 +58,72 @@ you already have Python 2.7, pip and virtualenv set up on your system:
|
||||
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`
|
||||
4. Install OctoPrint *into that virtual environment*: `./venv/bin/pip install .`
|
||||
|
||||
You may then start the OctoPrint server via `/path/to/OctoPrint/venv/bin/octoprint`, see [Usage](#usage)
|
||||
for details.
|
||||
|
||||
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.
|
||||
access control as necessary.
|
||||
|
||||
## Dependencies
|
||||
|
||||
OctoPrint depends on a couple of python modules to do its job. Those are automatically installed when installing
|
||||
OctoPrint via `setup.py`:
|
||||
OctoPrint depends on a few python modules to do its job. Those are automatically installed when installing
|
||||
OctoPrint via `pip`:
|
||||
|
||||
python setup.py install
|
||||
pip install .
|
||||
|
||||
You should also do this every time after pulling from the repository, since the dependencies might have changed.
|
||||
You should do this every time after pulling from the repository, since the dependencies may have changed.
|
||||
|
||||
OctoPrint currently only supports Python 2.7.
|
||||
|
||||
## Usage
|
||||
|
||||
Running the `setup.py` script via
|
||||
Running the pip install via
|
||||
|
||||
python setup.py install
|
||||
pip 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`.
|
||||
(which, depending on whether you installed OctoPrint globally or into a virtual env, will be in your `PATH` or not). The
|
||||
following usage examples assume that the `octoprint` script is on your `PATH`.
|
||||
|
||||
You can start the server via
|
||||
|
||||
octoprint
|
||||
octoprint serve
|
||||
|
||||
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
|
||||
|
||||
octoprint --host=127.0.0.1 --port=8080
|
||||
octoprint serve --host=127.0.0.1 --port=8080
|
||||
|
||||
Alternatively, the host and port on which to bind can be defined via the configuration.
|
||||
Alternatively, the host and port on which to bind can be defined via the config file.
|
||||
|
||||
If you want to run OctoPrint as a daemon (only supported on Linux), use
|
||||
|
||||
octoprint --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),
|
||||
You can also specify the config file or the base directory (for basing off the `uploads`, `timelapse` and `logs` folders),
|
||||
e.g.:
|
||||
|
||||
octoprint --config /path/to/another/config.yaml --basedir /path/to/my/basedir
|
||||
octoprint serve --config /path/to/another/config.yaml --basedir /path/to/my/basedir
|
||||
|
||||
See `octoprint --help` for further information.
|
||||
To start OctoPrint in safe mode - which disables all third party plugins that do not come bundled with OctoPrint - use
|
||||
the ``--safe`` flag:
|
||||
|
||||
OctoPrint also ships with a `run` script in its source directory. You can also invoke that to start up the server, it
|
||||
octoprint serve --safe
|
||||
|
||||
See `octoprint --help` for more information on the available command line parameters.
|
||||
|
||||
OctoPrint also ships with a `run` script in its source directory. You can invoke it to start 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,
|
||||
If not specified via the command line, the config file `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.
|
||||
|
||||
|
||||
+16
-30
@@ -1,4 +1,4 @@
|
||||
# Supporters
|
||||
# Supporters
|
||||
|
||||
Development of this version of OctoPrint wouldn't have been possible without
|
||||
[financial support by the community](http://octoprint.org/support-octoprint/) -
|
||||
@@ -6,67 +6,53 @@ thanks to everyone who contributed!
|
||||
|
||||
## Patreon Patrons
|
||||
|
||||
* 3D Moniak
|
||||
* Aleph Objects, Inc.
|
||||
* Andrew Moorby
|
||||
* Arnljot Arntsen
|
||||
* Aurelio Bernal
|
||||
* Bart Zudell
|
||||
* Boris Hussein
|
||||
* Brad Jackson
|
||||
* 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
|
||||
* F. Kunsmann
|
||||
* Frank Sander
|
||||
* Gary Deen
|
||||
* Gary N McKinney
|
||||
* George Robles
|
||||
* J. Eckert
|
||||
* Jamie van Dyke
|
||||
* Jason Galarneau
|
||||
* günter weber
|
||||
* James Seigel
|
||||
* Jeff Moe
|
||||
* Jeff Renfer
|
||||
* Jefferson Hunt
|
||||
* Jeremiah Avery
|
||||
* Josh Daniels
|
||||
* Joshua David Gregory
|
||||
* Kaile Riser
|
||||
* Kale Stedman
|
||||
* Kazuhiro Ogura
|
||||
* Lamin Kivelä
|
||||
* Kodama Inc.
|
||||
* LulzBot®
|
||||
* Makespace Madrid
|
||||
* Marcus Ackermann
|
||||
* Mark Qvist
|
||||
* Mark Walker
|
||||
* Masayoshi Mitsui
|
||||
* Martin Beattie
|
||||
* Michael Aumock
|
||||
* Miles Flavel
|
||||
* mitchell hirsch
|
||||
* Mohammed khorakiwala
|
||||
* Noe Ruiz
|
||||
* Patrick McGinnis
|
||||
* Peter Grace
|
||||
* Peter Schmehl
|
||||
* PRINT3Dforum.com
|
||||
* Randy C. Will
|
||||
* Robert Gusek
|
||||
* Roger Strolz
|
||||
* Roy Cortes
|
||||
* Samer Najia
|
||||
* SD3D
|
||||
* SeeMeCNC
|
||||
* Shane Ekerbicer
|
||||
* Simon Hallam
|
||||
* Stefan Krister
|
||||
* Stephane Schittly
|
||||
* Steven Pearson
|
||||
* Sven Mueller
|
||||
* Terrance Shaw
|
||||
* Symbiotic Devices
|
||||
* Thomas Hatley
|
||||
* Trent Shumay
|
||||
|
||||
and 972 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
|
||||
and 1233 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel)!
|
||||
+22
-1
@@ -6,7 +6,7 @@
|
||||
* [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 Knockout Binding](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
|
||||
@@ -32,8 +32,12 @@
|
||||
|
||||
## Server
|
||||
|
||||
* [appdirs](http://github.com/ActiveState/appdirs): MIT
|
||||
* [Awesome-Slugify](https://pypi.python.org/pypi/awesome-slugify): GPLv3
|
||||
* [chainmap](https://bitbucket.org/jeunice/chainmap): Python
|
||||
* [Click](http://click.pocoo.org/): BSD
|
||||
* [dateutil](https://dateutil.readthedocs.io/): BSD
|
||||
* [emoji](https://github.com/carpedm20/emoji/): BSD
|
||||
* [feedparser](https://github.com/kurtmckee/feedparser): BSD
|
||||
* [Flask](http://flask.pocoo.org/): BSD
|
||||
* [Flask-Assets](http://github.com/miracle2k/flask-assets): BSD
|
||||
@@ -41,6 +45,9 @@
|
||||
* [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
|
||||
* [future](https://python-future.org/): MIT
|
||||
* [futures](https://github.com/agronholm/pythonfutures): Python
|
||||
* [monotonic](https://github.com/atdt/monotonic): Apache License 2.0
|
||||
* [netaddr](https://github.com/drkjam/netaddr/): BSD
|
||||
* [netifaces](https://bitbucket.org/al45tair/netifaces): MIT
|
||||
* [pkginfo](http://pypi.python.org/pypi/pkginfo/): Python
|
||||
@@ -51,7 +58,21 @@
|
||||
* [requests](http://python-requests.org/): Apache License 2.0
|
||||
* [rsa](http://stuvel.eu/rsa): Apache License 2.0
|
||||
* [sarge](http://sarge.readthedocs.org/): BSD
|
||||
* [scandir](https://github.com/benhoyt/scandir): 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
|
||||
* [websocket-client](https://github.com/liris/websocket-client): LGPLv3
|
||||
* [wrapt](http://wrapt.readthedocs.org/): BSD
|
||||
|
||||
## Development (testing, documentation generation, etc)
|
||||
|
||||
* [ddt](https://github.com/txels/ddt): MIT
|
||||
* [mock](https://github.com/testing-cabal/mock): BSD
|
||||
* [nose](http://pythonhosted.org/nose/): LGPL
|
||||
* [pypandoc](https://github.com/bebraw/pypandoc): MIT
|
||||
* [Sphinx](http://sphinx-doc.org/): BSD
|
||||
* [sphinxcontrib-httpdomain](https://bitbucket.org/birkenfeld/sphinx-contrib/src/default/httpdomain/): BSD
|
||||
* [sphinxcontrib-mermad](https://github.com/mgaitan/sphinxcontrib-mermaid): BSD
|
||||
* [sphinx_rtd_theme](https://github.com/snide/sphinx_rtd_theme/): BSD
|
||||
Vendored
+6
@@ -37,6 +37,11 @@
|
||||
vertical-align: 10%;
|
||||
}
|
||||
|
||||
.rst-content .highlight>pre,
|
||||
.rst-content .linenodiv>pre {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* make code tags non-red again */
|
||||
code,
|
||||
.rst-content tt {
|
||||
@@ -52,3 +57,4 @@ a:visited code,
|
||||
.rst-content a:visited tt {
|
||||
color: #9B59B6 !important;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ Get connection settings
|
||||
"options": {
|
||||
"ports": ["/dev/ttyACM0", "VIRTUAL"],
|
||||
"baudrates": [250000, 230400, 115200, 57600, 38400, 19200, 9600],
|
||||
"printerProfiles": [{"name": "Default", id: "_default"}],
|
||||
"printerProfiles": [{"name": "Default", "id": "_default"}],
|
||||
"portPreference": "/dev/ttyACM0",
|
||||
"baudratePreference": 250000,
|
||||
"printerProfilePreference": "_default",
|
||||
|
||||
+26
-6
@@ -31,7 +31,7 @@ Printer State
|
||||
* - ``flags``
|
||||
- 1
|
||||
- Printer state flags
|
||||
- A couple of boolean printer state flags
|
||||
- A few boolean printer state flags
|
||||
* - ``flags.operational``
|
||||
- 1
|
||||
- Boolean
|
||||
@@ -44,6 +44,14 @@ Printer State
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is currently printing, ``false`` otherwise
|
||||
* - ``flags.pausing``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is currently printing and in the process of pausing, ``false`` otherwise
|
||||
* - ``flags.cancelling``
|
||||
- 1
|
||||
- Boolean
|
||||
- ``true`` if the printer is currently printing and in the process of pausing, ``false`` otherwise
|
||||
* - ``flags.sdReady``
|
||||
- 1
|
||||
- Boolean
|
||||
@@ -232,12 +240,18 @@ File information
|
||||
* - ``name``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file without path. E.g. "file.gco" for a file "file.gco" located anywhere in the file system.
|
||||
- The name of the file without path. E.g. "file.gco" for a file "file.gco" located anywhere in the file system. Currently
|
||||
this will always fit into ASCII.
|
||||
* - ``display``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file without the path, this time potentially with non-ASCII unicode characters.
|
||||
E.g. "a turtle 🐢.gco" for a file "a_turtle_turtle.gco" located anywhere in the file system.
|
||||
* - ``path``
|
||||
- 1
|
||||
- String
|
||||
- The path to the file within the location. E.g. "folder/subfolder/file.gco" for a file "file.gco" located within
|
||||
"folder" and "subfolder" relative to the root of the location.
|
||||
"folder" and "subfolder" relative to the root of the location. Currently this will always fit into ASCII.
|
||||
* - ``type``
|
||||
- 1
|
||||
- String
|
||||
@@ -286,9 +300,9 @@ Files
|
||||
- Type
|
||||
- Description
|
||||
* - ``hash``
|
||||
- 1
|
||||
- 0..1
|
||||
- String
|
||||
- MD5 hash of the file
|
||||
- MD5 hash of the file. Only available for ``local`` files.
|
||||
* - ``size``
|
||||
- 0..1
|
||||
- Number
|
||||
@@ -329,11 +343,17 @@ Abridged file or folder information
|
||||
- 1
|
||||
- String
|
||||
- The name of the file or folder without path. E.g. "file.gco" for a file "file.gco" located anywhere in the file system.
|
||||
Currently this will always fit into ASCII.
|
||||
* - ``display``
|
||||
- 1
|
||||
- String
|
||||
- The name of the file without the path, this potentially with non-ASCII unicode characters.
|
||||
E.g. "a turtle 🐢.gco" for a file "a_turtle_turtle.gco" located anywhere in the file system.
|
||||
* - ``path``
|
||||
- 1
|
||||
- String
|
||||
- The path to the file or folder within the location. E.g. "folder/subfolder/file.gco" for a file "file.gco" located within
|
||||
"folder" and "subfolder" relative to the root of the location.
|
||||
"folder" and "subfolder" relative to the root of the location. Currently this will always fit into ASCII.
|
||||
* - ``origin``
|
||||
- 1
|
||||
- String, either ``local`` or ``sdcard``
|
||||
|
||||
+150
-2
@@ -16,9 +16,14 @@ Retrieve all files
|
||||
Retrieve information regarding all files currently available and regarding the disk space still available
|
||||
locally in the system.
|
||||
|
||||
By default only returns the files and folders in the root directory. If the query parameter ``recursive``
|
||||
is provided and set to ``true``, returns all files and folders.
|
||||
|
||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example**:
|
||||
**Example 1**:
|
||||
|
||||
Fetch only the files and folders from the root folder.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
@@ -35,6 +40,10 @@ Retrieve all files
|
||||
"files": [
|
||||
{
|
||||
"name": "whistle_v2.gcode",
|
||||
"path": "whistle_v2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 1468987,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
@@ -60,15 +69,141 @@ Retrieve all files
|
||||
},
|
||||
{
|
||||
"name": "whistle_.gco",
|
||||
"path": "whistle_.gco",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"origin": "sdcard",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/sdcard/whistle_.gco"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "folderA",
|
||||
"path": "folderA",
|
||||
"type": "folder",
|
||||
"typePath": ["folder"],
|
||||
"children": [],
|
||||
"size": 1334
|
||||
}
|
||||
],
|
||||
"free": "3.2GB"
|
||||
}
|
||||
|
||||
**Example 2**
|
||||
|
||||
Recursively fetch all files and folders.
|
||||
|
||||
Fetch only the files and folders from the root folder.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /api/files?recursive=true 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",
|
||||
"path": "whistle_v2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"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",
|
||||
"path": "whistle_.gco",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"origin": "sdcard",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/sdcard/whistle_.gco"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "folderA",
|
||||
"path": "folderA",
|
||||
"type": "folder",
|
||||
"typePath": ["folder"],
|
||||
"children": [
|
||||
{
|
||||
"name": "test.gcode",
|
||||
"path": "folderA/test.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 1234,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA/test.gcode",
|
||||
"download": "http://example.com/downloads/files/local/folderA/test.gcode"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "subfolder",
|
||||
"path": "folderA/subfolder",
|
||||
"type": "folder",
|
||||
"typePath": ["folder"],
|
||||
"children": [
|
||||
{
|
||||
"name": "test.gcode",
|
||||
"path": "folderA/subfolder/test2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 100,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA/subfolder/test2.gcode",
|
||||
"download": "http://example.com/downloads/files/local/folderA/subfolder/test2.gcode"
|
||||
}
|
||||
},
|
||||
],
|
||||
"size": 100,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA/subfolder",
|
||||
}
|
||||
}
|
||||
],
|
||||
"size": 1334,
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/folderA",
|
||||
}
|
||||
}
|
||||
],
|
||||
"free": "3.2GB"
|
||||
}
|
||||
|
||||
:param recursive: If set to ``true``, return all files and folders recursively. Otherwise only return items on same level.
|
||||
:statuscode 200: No error
|
||||
|
||||
.. _sec-api-fileops-retrievelocation:
|
||||
@@ -81,6 +216,9 @@ Retrieve files from specific 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.
|
||||
|
||||
By default only returns the files and folders in the root directory. If the query parameter ``recursive``
|
||||
is provided and set to ``true``, returns all files and folders.
|
||||
|
||||
Returns a :ref:`Retrieve response <sec-api-fileops-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example**:
|
||||
@@ -100,6 +238,10 @@ Retrieve files from specific location
|
||||
"files": [
|
||||
{
|
||||
"name": "whistle_v2.gcode",
|
||||
"path": "whistle_v2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"hash": "...",
|
||||
"size": 1468987,
|
||||
"date": 1378847754,
|
||||
"origin": "local",
|
||||
@@ -130,6 +272,7 @@ Retrieve files from specific location
|
||||
: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).
|
||||
:param recursive: If set to ``true``, return all files and folders recursively. Otherwise only return items on same level.
|
||||
:statuscode 200: No error
|
||||
:statuscode 404: If `location` is neither ``local`` nor ``sdcard``
|
||||
|
||||
@@ -196,6 +339,8 @@ Upload file or create folder
|
||||
"local": {
|
||||
"name": "whistle_v2.gcode",
|
||||
"path": "whistle_v2.gcode",
|
||||
"type": "machinecode",
|
||||
"typePath": ["machinecode", "gcode"],
|
||||
"origin": "local",
|
||||
"refs": {
|
||||
"resource": "http://example.com/api/files/local/whistle_v2.gcode",
|
||||
@@ -324,6 +469,9 @@ Retrieve a specific file's or folder's information
|
||||
|
||||
If the file is unknown, a :http:statuscode:`404` is returned.
|
||||
|
||||
If the targeted path is a folder, by default only its direct children will be returned. If ``recursive`` is
|
||||
provided and set to ``true``, all sub folders and their children will be returned too.
|
||||
|
||||
On success, a :http:statuscode:`200` is returned, with a :ref:`file information item <sec-api-datamodel-files-file>`
|
||||
as the response body.
|
||||
|
||||
@@ -368,7 +516,7 @@ Retrieve a specific file's or folder's information
|
||||
|
||||
: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
|
||||
:param children: Whether to include children of folders (true, default) or not (false)
|
||||
:param recursive: If set to ``true``, return all files and folders recursively. Otherwise only return items on same level.
|
||||
: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
|
||||
|
||||
@@ -12,7 +12,7 @@ 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>`.
|
||||
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.
|
||||
@@ -65,7 +65,7 @@ Please be advised that clients should use the header field variant if at all pos
|
||||
Content Type
|
||||
============
|
||||
|
||||
If not otherwise stated OctoPrint's API expects request bodies and issues response bodies as ``Content-Type: application/json``.
|
||||
If not otherwise stated, OctoPrint's API expects request bodies and issues response bodies as ``Content-Type: application/json``.
|
||||
|
||||
.. _sec-api-general-encoding:
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
Job operations
|
||||
**************
|
||||
|
||||
Use these operations to query the currently selected file and start/cancel/restart/pause the
|
||||
actual print job.
|
||||
|
||||
.. contents::
|
||||
|
||||
.. _sec-api-jobs-command:
|
||||
|
||||
@@ -39,9 +39,7 @@ Retrieve installed language packs
|
||||
"_core": {
|
||||
"identifier": "_core",
|
||||
"name": "Core",
|
||||
"languages": [
|
||||
...
|
||||
]
|
||||
"languages": []
|
||||
},
|
||||
"some_plugin": {
|
||||
"identifier": "some_plugin",
|
||||
@@ -61,7 +59,6 @@ Retrieve installed language packs
|
||||
"last_update": 1470859680,
|
||||
"author": "The italian Transifex Team"
|
||||
}
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -124,9 +121,7 @@ Delete a language pack
|
||||
"_core": {
|
||||
"identifier": "_core",
|
||||
"name": "Core",
|
||||
"languages": [
|
||||
...
|
||||
]
|
||||
"languages": []
|
||||
},
|
||||
"some_plugin": {
|
||||
"identifier": "some_plugin",
|
||||
@@ -138,8 +133,7 @@ Delete a language pack
|
||||
"locale_english": "German",
|
||||
"last_update": 1474574597,
|
||||
"author": "Gina Häußge"
|
||||
},
|
||||
...
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+5
-168
@@ -4,172 +4,9 @@
|
||||
Log file management
|
||||
*******************
|
||||
|
||||
.. note::
|
||||
Log file management (and logging configuration) was moved into a bundled plugin in OctoPrint 1.3.7. Refer to
|
||||
:ref:`the Logging's plugins API <sec-bundledplugins-logging-api>` for the API documentation.
|
||||
|
||||
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:
|
||||
|
||||
Data model
|
||||
==========
|
||||
|
||||
.. _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
|
||||
The former endpoints ``/api/logs`` and ``api/logs/<path>`` are marked as deprecated but still work for now. New
|
||||
client implementations should directly use the new endpoints provided by the bundled plugin. Existing implementations
|
||||
should adapt their endpoints as soon as possible.
|
||||
@@ -149,6 +149,8 @@ Retrieve the current printer state
|
||||
"operational": true,
|
||||
"paused": false,
|
||||
"printing": false,
|
||||
"cancelling": false,
|
||||
"pausing": false,
|
||||
"sdReady": true,
|
||||
"error": false,
|
||||
"ready": true,
|
||||
@@ -179,6 +181,8 @@ Retrieve the current printer state
|
||||
"operational": true,
|
||||
"paused": false,
|
||||
"printing": false,
|
||||
"cancelling": false,
|
||||
"pausing": false,
|
||||
"sdReady": true,
|
||||
"error": false,
|
||||
"ready": true,
|
||||
@@ -213,7 +217,7 @@ Issue a print head command
|
||||
* ``z``: Optional. Amount/coordinate to jog print head on z axis, must be a valid number corresponding to the distance to travel in mm.
|
||||
* ``absolute``: Optional. Boolean value specifying whether to move relative to current position (provided
|
||||
axes values are relative amounts) or to absolute position (provided axes values are coordinates)
|
||||
* ``speed``: Optiona. Speed at which to move. If not provided, minimum speed for all selected axes from printer
|
||||
* ``speed``: Optional. Speed at which to move. If not provided, minimum speed for all selected axes from printer
|
||||
profile will be used. If provided but ``false``, no speed parameter will be appended to the command. Otherwise
|
||||
interpreted as an integer signifying the speed in mm/s, to append to the command.
|
||||
|
||||
@@ -223,7 +227,7 @@ Issue a print head command
|
||||
* ``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.
|
||||
Changes the feedrate factor to apply to the movements of the axes.
|
||||
|
||||
* ``factor``: The new factor, percentage as integer or float (percentage divided by 100) between 50 and 200%.
|
||||
|
||||
|
||||
+113
-76
@@ -34,90 +34,92 @@ Retrieve all printer profiles
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
[
|
||||
{
|
||||
"id": "_default",
|
||||
"name": "Default",
|
||||
"color": "default",
|
||||
"model": "Generic RepRap Printer",
|
||||
"default": true,
|
||||
"current": true,
|
||||
"resource": "http://example.com/api/printerprofiles/_default",
|
||||
"volume": {
|
||||
"formFactor": "rectangular",
|
||||
"origin": "lowerleft",
|
||||
"width": 200,
|
||||
"depth": 200,
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
"id": "_default",
|
||||
"name": "Default",
|
||||
"color": "default",
|
||||
"model": "Generic RepRap Printer",
|
||||
"default": true,
|
||||
"current": true,
|
||||
"resource": "http://example.com/api/printerprofiles/_default",
|
||||
"volume": {
|
||||
"formFactor": "rectangular",
|
||||
"origin": "lowerleft",
|
||||
"width": 200,
|
||||
"depth": 200,
|
||||
"height": 200
|
||||
},
|
||||
"y": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
"heatedBed": true,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"y": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"z": {
|
||||
"speed": 200,
|
||||
"inverted": false
|
||||
},
|
||||
"e": {
|
||||
"speed": 300,
|
||||
"inverted": false
|
||||
}
|
||||
},
|
||||
"z": {
|
||||
"speed": 200,
|
||||
"inverted": false
|
||||
},
|
||||
"e": {
|
||||
"speed": 300,
|
||||
"inverted": false
|
||||
"extruder": {
|
||||
"count": 1,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0}
|
||||
]
|
||||
}
|
||||
},
|
||||
"extruder": {
|
||||
"count": 1,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "my_profile",
|
||||
"name": "My Profile",
|
||||
"color": "default",
|
||||
"model": "My Custom Printer",
|
||||
"default": false,
|
||||
"current": false,
|
||||
"resource": "http://example.com/api/printerprofiles/my_profile",
|
||||
"volume": {
|
||||
"formFactor": "rectangular",
|
||||
"origin": "lowerleft",
|
||||
"width": 200,
|
||||
"depth": 200,
|
||||
"height": 200
|
||||
},
|
||||
"heatedBed": true,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
{
|
||||
"id": "my_profile",
|
||||
"name": "My Profile",
|
||||
"color": "default",
|
||||
"model": "My Custom Printer",
|
||||
"default": false,
|
||||
"current": false,
|
||||
"resource": "http://example.com/api/printerprofiles/my_profile",
|
||||
"volume": {
|
||||
"formFactor": "rectangular",
|
||||
"origin": "lowerleft",
|
||||
"width": 200,
|
||||
"depth": 200,
|
||||
"height": 200
|
||||
},
|
||||
"y": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
"heatedBed": true,
|
||||
"axes": {
|
||||
"x": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"y": {
|
||||
"speed": 6000,
|
||||
"inverted": false
|
||||
},
|
||||
"z": {
|
||||
"speed": 200,
|
||||
"inverted": false
|
||||
},
|
||||
"e": {
|
||||
"speed": 300,
|
||||
"inverted": false
|
||||
}
|
||||
},
|
||||
"z": {
|
||||
"speed": 200,
|
||||
"inverted": false
|
||||
},
|
||||
"e": {
|
||||
"speed": 300,
|
||||
"inverted": false
|
||||
"extruder": {
|
||||
"count": 1,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0}
|
||||
]
|
||||
}
|
||||
},
|
||||
"extruder": {
|
||||
"count": 1,
|
||||
"offsets": [
|
||||
{"x": 0.0, "y": 0.0}
|
||||
]
|
||||
}
|
||||
},
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
.. _sec-api-printerprofiles-add:
|
||||
@@ -537,6 +539,41 @@ Profile
|
||||
- 0..1
|
||||
- ``float``
|
||||
- The height of the print volume
|
||||
* - ``volume.custom_box``
|
||||
- 0..1
|
||||
- ``boolean`` or ``object``
|
||||
- If the printer has a custom bounding box where the print head can be safely moved to, exceeding the defined print
|
||||
volume, that bounding box will be defined here. Otherwise (safe area == print volume) this value will be ``false``.
|
||||
* - ``volume.custom_box.min_x``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Minimum X coordinate defining the safe custom bounding box. Smaller value than the minimum X coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.max_x``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Maximum X coordinate defining the safe custom bounding box. Larger value than the maximum X coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.min_y``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Minimum Y coordinate defining the safe custom bounding box. Smaller value than the minimum Y coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.max_y``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Maximum Y coordinate defining the safe custom bounding box. Larger value than the maximum Y coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.min_z``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Minimum Z coordinate defining the safe custom bounding box. Smaller value than the minimum Z coordinate of the
|
||||
print volume.
|
||||
* - ``volume.custom_box.max_z``
|
||||
- 0..1
|
||||
- ``float``
|
||||
- Maximum Z coordinate defining the safe custom bounding box. Larger value than the maximum Z coordinate of the
|
||||
print volume.
|
||||
* - ``heatedBed``
|
||||
- 0..1
|
||||
- ``boolean``
|
||||
|
||||
+30
-3
@@ -62,12 +62,30 @@ Save settings
|
||||
|
||||
{
|
||||
"api": {
|
||||
"enabled": true,
|
||||
// ...
|
||||
"enabled": true
|
||||
},
|
||||
// ...
|
||||
"appearance": {
|
||||
"color": "black"
|
||||
}
|
||||
}
|
||||
|
||||
.. _sec-api-settings-generateapikey:
|
||||
|
||||
Regenerate the system wide API key
|
||||
==================================
|
||||
|
||||
.. http:post:: /api/settings/apikey
|
||||
|
||||
Generates a new system wide API key.
|
||||
|
||||
Does not expect a body. Will return the generated API key as ``apikey``
|
||||
property in the JSON object contained in the response body.
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
:status 200: No error
|
||||
:status 403: No admin rights
|
||||
|
||||
.. _sec-api-settings-datamodel:
|
||||
|
||||
Data model
|
||||
@@ -87,6 +105,9 @@ mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
||||
-
|
||||
* - ``api.key``
|
||||
- Only maps to ``api.key`` in ``config.yaml`` if request is sent with admin rights, set to ``n/a`` otherwise.
|
||||
Starting with OctoPrint 1.3.3 setting this field via :ref:`the API <sec-api-settings-save>` is not possible,
|
||||
only :ref:`regenerting it <sec-api-settings-generateapikey>` is supported. Setting a custom value is only
|
||||
possible through `config.yaml`.
|
||||
* - ``api.allowCrossOrigin``
|
||||
-
|
||||
* - ``appearance.name``
|
||||
@@ -133,6 +154,12 @@ mapped from the same fields in ``config.yaml`` unless otherwise noted:
|
||||
-
|
||||
* - ``feature.modelSizeDetection``
|
||||
-
|
||||
* - ``feature.firmwareDetection``
|
||||
-
|
||||
* - ``feature.printCancelConfirmation``
|
||||
-
|
||||
* - ``feature.blockWhileDwelling``
|
||||
-
|
||||
* - ``folder.uploads``
|
||||
-
|
||||
* - ``folder.timelapse``
|
||||
|
||||
+10
-9
@@ -58,11 +58,9 @@ List All Slicers and Slicing Profiles
|
||||
"displayName": "Medium Quality",
|
||||
"default": true,
|
||||
"resource": "http://example.com/api/slicing/cura/profiles/medium_quality"
|
||||
},
|
||||
...
|
||||
}
|
||||
}
|
||||
},
|
||||
...
|
||||
}
|
||||
}
|
||||
|
||||
:statuscode 200: No error
|
||||
@@ -104,8 +102,7 @@ List Slicing Profiles of a Specific Slicer
|
||||
"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.
|
||||
@@ -147,8 +144,7 @@ Retrieve Specific Profile
|
||||
"brim_line_count": 20,
|
||||
"cool_head_lift": false,
|
||||
"cool_min_feedrate": 10.0,
|
||||
"cool_min_layer_time": 5.0,
|
||||
...
|
||||
"cool_min_layer_time": 5.0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,9 +264,14 @@ Slicer
|
||||
- ``string``
|
||||
- Identifier of the slicer
|
||||
* - ``displayName``
|
||||
- 0..1
|
||||
- 1
|
||||
- ``string``
|
||||
- Display name of the slicer
|
||||
* - ``sameDevice``
|
||||
- 1
|
||||
- ``boolean``
|
||||
- Whether the slicer runs on the same device as OctoPrint (``true``) and hence can't be used while printing,
|
||||
or not (``false``)
|
||||
* - ``default``
|
||||
- 1
|
||||
- ``boolean``
|
||||
|
||||
+8
-8
@@ -39,7 +39,7 @@ List all registered system commands
|
||||
"action": "shutdown",
|
||||
"name": "Shutdown",
|
||||
"command": "sudo shutdown -h now",
|
||||
"confirm": "You are about to shutdown the system.",
|
||||
"confirm": "<strong>You are about to shutdown the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
@@ -49,7 +49,7 @@ List all registered system commands
|
||||
"action": "reboot",
|
||||
"name": "Reboot",
|
||||
"command": "sudo reboot",
|
||||
"confirm": "You are about to reboot the system.",
|
||||
"confirm": "<strong>You are about to reboot the system.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
@@ -59,7 +59,7 @@ List all registered system commands
|
||||
"action": "restart",
|
||||
"name": "Restart OctoPrint",
|
||||
"command": "sudo service octoprint restart",
|
||||
"confirm": "You are about to restart the OctoPrint server.",
|
||||
"confirm": "<strong>You are about to restart the OctoPrint server.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
@@ -100,7 +100,7 @@ List all registered system commands for a source
|
||||
"action": "shutdown",
|
||||
"name": "Shutdown",
|
||||
"command": "sudo shutdown -h now",
|
||||
"confirm": "You are about to shutdown the system.",
|
||||
"confirm": "<b>You are about to shutdown the system.</b></p><p> This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
@@ -110,7 +110,7 @@ List all registered system commands for a source
|
||||
"action": "reboot",
|
||||
"name": "Reboot",
|
||||
"command": "sudo reboot",
|
||||
"confirm": "You are about to reboot the system.",
|
||||
"confirm": "<b>You are about to reboot the system.</b></p><p> This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
@@ -120,7 +120,7 @@ List all registered system commands for a source
|
||||
"action": "restart",
|
||||
"name": "Restart OctoPrint",
|
||||
"command": "sudo service octoprint restart",
|
||||
"confirm": "You are about to restart the OctoPrint server.",
|
||||
"confirm": "<b>You are about to restart the OctoPrint server.</b></p><p> This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage).",
|
||||
"async": true,
|
||||
"ignore": true,
|
||||
"source": "core",
|
||||
@@ -139,7 +139,7 @@ Execute a registered system command
|
||||
|
||||
.. http:post:: /api/system/commands/(string:source)/(string:action)
|
||||
|
||||
Execute the system command ``action`` on defined in ``source``.
|
||||
Execute the system command ``action`` defined in ``source``.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -154,7 +154,7 @@ Execute a registered system command
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
204 No Content
|
||||
HTTP/1.1 204 No Content
|
||||
|
||||
:param source: The source for which to list commands, currently either ``core`` or ``custom``
|
||||
:param action: The identifier of the command, ``action`` from its definition
|
||||
|
||||
@@ -128,7 +128,7 @@ Rendered timelapse
|
||||
* - ``date``
|
||||
- 1
|
||||
- string
|
||||
- Formatted timestamp of the the timelapse creation date
|
||||
- Formatted timestamp of the timelapse creation date
|
||||
* - ``url``
|
||||
- 1
|
||||
- string
|
||||
@@ -162,7 +162,7 @@ Unrendered timelapse
|
||||
* - ``date``
|
||||
- 1
|
||||
- string
|
||||
- Formatted timestamp of the the timelapse job creation date
|
||||
- Formatted timestamp of the timelapse job creation date
|
||||
* - ``recording``
|
||||
- 1
|
||||
- bool
|
||||
|
||||
+88
-3
@@ -38,13 +38,15 @@ Test paths or URLs
|
||||
.. _sec-api-util-test-url:
|
||||
|
||||
url
|
||||
Tests whether a provided url responds. Request method and expected status codes can
|
||||
Tests whether a provided URL responds. Request method and expected status codes can
|
||||
optionally be specified as well. Supported parameters are:
|
||||
|
||||
* ``url``: The url to test. Mandatory.
|
||||
* ``url``: The URL to test. Mandatory.
|
||||
* ``method``: The request method to use for the test. Optional, defaults to ``HEAD``.
|
||||
* ``timeout``: A timeout for the request, in seconds. If no reply from the tested URL has been
|
||||
received within this time frame, the check will be considered a failure. Optional, defaults to 3 seconds.
|
||||
* ``validSsl``: Whether to validate the SSL connection if the ``url`` happens to be an HTTPS URL or not. Optional,
|
||||
defaults to ``True``.
|
||||
* ``status``: The status code(s) or named status range(s) to test for. Can be either a single
|
||||
value or a list of either HTTP status codes or any of the following named status ranges:
|
||||
|
||||
@@ -68,6 +70,21 @@ Test paths or URLs
|
||||
when the test could be performed. The status code of the response does NOT reflect the
|
||||
test result!
|
||||
|
||||
.. _sec-api-util-test-server:
|
||||
|
||||
server
|
||||
Tests whether a provided server identified by host and port can be reached. Protocol can optionally be specified
|
||||
as well. Supported parameters are:
|
||||
|
||||
* ``host``: The host to test. IP or host name. Mandatory.
|
||||
* ``port``: The port to test. Integer. Mandatory.
|
||||
* ``protocol``: The protocol to test with. ``tcp`` or ``udp``. Optional, defaults to ``tcp``.
|
||||
* ``timeout``: A timeout for the test, in seconds. If no successful connection to the server could be established
|
||||
within this time frame, the check will be considered a failure. Optional, defaults to 3.05 seconds.
|
||||
|
||||
The ``server`` command returns :http:statuscode:`200` with a :ref:`Server test result <sec-api-util-datamodel-servertestresult>`
|
||||
when the test could be performed. The status code of the response does NOT reflect the test result!
|
||||
|
||||
Requires admin rights.
|
||||
|
||||
**Example 1**
|
||||
@@ -226,6 +243,35 @@ Test paths or URLs
|
||||
}
|
||||
}
|
||||
|
||||
**Example 6**
|
||||
|
||||
Test whether a server is reachable on a given port via TCP.
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
POST /api/util/test HTTP/1.1
|
||||
Host: example.com
|
||||
X-Api-Key: abcdef...
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"command": "server",
|
||||
"host": "8.8.8.8",
|
||||
"port": 53
|
||||
}
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"host": "8.8.8.8",
|
||||
"port": 53,
|
||||
"protocol": "tcp",
|
||||
"result": true
|
||||
}
|
||||
|
||||
:json command: The command to execute, currently either ``path`` or ``url``
|
||||
:json path: ``path`` command only: the path to test
|
||||
:json check_type: ``path`` command only: the type of path to test for, either ``file`` or ``dir``
|
||||
@@ -233,8 +279,11 @@ Test paths or URLs
|
||||
:json url: ``url`` command only: the URL to test
|
||||
:json status: ``url`` command only: one or more expected status codes
|
||||
:json method: ``url`` command only: the HTTP method to use for the check
|
||||
:json timeout: ``url`` command only: the timeout for the HTTP request
|
||||
:json timeout: ``url`` and ``server`` commands only: the timeout for the test request
|
||||
:json response: ``url`` command only: whether to include response data and if so in what form
|
||||
:json host: ``server`` command only: the server to test
|
||||
:json port: ``server`` command only: the port to test
|
||||
:json protocol: ``server`` command only: the protocol to test
|
||||
:statuscode 200: No error occurred
|
||||
|
||||
.. _sec-api-util-datamodel:
|
||||
@@ -244,6 +293,9 @@ Data model
|
||||
|
||||
.. _sec-api-util-datamodel-pathtestresult:
|
||||
|
||||
Path test result
|
||||
----------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
@@ -275,6 +327,9 @@ Data model
|
||||
|
||||
.. _sec-api-util-datamodel-urltestresult:
|
||||
|
||||
URL test result
|
||||
---------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
@@ -306,3 +361,33 @@ Data model
|
||||
- object
|
||||
- A dictionary with all headers of the checked URL's response. Only present if ``response`` in the
|
||||
request was set.
|
||||
|
||||
.. _sec-api-util-datamodel-servertestresult:
|
||||
|
||||
Server test result
|
||||
------------------
|
||||
|
||||
.. list-table::
|
||||
:widths: 15 5 10 30
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Multiplicity
|
||||
- Type
|
||||
- Description
|
||||
* - ``host``
|
||||
- 1
|
||||
- string
|
||||
- The host that was tested.
|
||||
* - ``port``
|
||||
- 1
|
||||
- int
|
||||
- The port that was tested
|
||||
* - ``protocol``
|
||||
- 1
|
||||
- string
|
||||
- The protocol that was tested, ``tcp`` or ``udp``
|
||||
* - ``result``
|
||||
- 1
|
||||
- bool
|
||||
- ``true`` if the check passed.
|
||||
@@ -1,4 +1,4 @@
|
||||
.. _sec-bundledplugins_cura:
|
||||
.. _sec-bundledplugins-cura:
|
||||
|
||||
Cura
|
||||
====
|
||||
@@ -45,7 +45,7 @@ Installing CuraEngine
|
||||
|
||||
You'll need a build of ``legacy`` branch of `CuraEngine <http://github.com/Ultimaker/CuraEngine>`_
|
||||
in order to be able to use the Cura OctoPrint plugin. You can find the ``legacy`` branch
|
||||
`here <https://github.com/ultimaker/curaengine/tree/legacy>`_.
|
||||
`here <https://github.com/ultimaker/curaengine/tree/legacy>`__.
|
||||
|
||||
If you previously used the `old variant of the Cura integration <https://github.com/foosel/OctoPrint/wiki/Cura-Integration>`_,
|
||||
you probably still have a fully functional binary lying around in the
|
||||
@@ -60,7 +60,7 @@ Compiling for Raspbian
|
||||
.. note::
|
||||
|
||||
A binary of CuraEngine 15.04.06 precompiled on Raspbian Jessie Lite 2016-03-18 is available
|
||||
`here <http://bit.ly/octopi_cura_engine_150406>`_. Don't forget to make it
|
||||
`here <http://bit.ly/octopi_cura_engine_150406>`__. Don't forget to make it
|
||||
executable after copying it to your preferred destination on your Pi
|
||||
(suggestion: ``/usr/local/bin``) with ``chmod +x cura_engine``. Use at your
|
||||
own risk.
|
||||
|
||||
@@ -43,6 +43,13 @@ Installing pybonjour
|
||||
OctoPi versions 0.12.0 and later already come with pybonjour installed and ready to go,
|
||||
you don't need to perform these steps there.
|
||||
|
||||
.. note::
|
||||
|
||||
Currently there are no releases for pybonjour available on the Python Package Index PyPI. The latest pybonjour
|
||||
release is still available in the `Google Code Archive <https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pybonjour/pybonjour-1.1.1.tar.gz>`_.
|
||||
Since that URL is hilariously long though, a shortened version is provided with https://goo.gl/SxQZ06 and
|
||||
used in the installation instructions below.
|
||||
|
||||
In order for the Zeroconf discovery to work, the
|
||||
`pybonjour package <https://pypi.python.org/pypi/pybonjour>`_ needs to be available
|
||||
to the Python installation running OctoPrint.
|
||||
@@ -52,7 +59,7 @@ into some folder ``~/OctoPrint``. You executed ``python setup.py install`` withi
|
||||
virtualenv in the same folder called ``venv``. In order to install ``pybonjour``
|
||||
so it will be available to OctoPrint you'll need to do the following::
|
||||
|
||||
venv/bin/pip install pybonjour
|
||||
venv/bin/pip install https://goo.gl/SxQZ06
|
||||
|
||||
**Linux users:** You'll need to install an additional dependency for this to work, the
|
||||
libdnssd compatibility layer for libavahi. On Debian/Ubuntu that can be achieved with::
|
||||
@@ -71,7 +78,7 @@ The plugin supports the following configuration keys:
|
||||
optional, if not set the port OctoPrint itself was started under will be used
|
||||
* ``pathPrefix``: Path prefix OctoPrint is running under, optional, if not
|
||||
set ``/`` will be used
|
||||
* ``useSsl``: ``true``if OctoPrint should be called via HTTPS, ``false`` otherwise
|
||||
* ``useSsl``: ``true`` if OctoPrint should be called via HTTPS, ``false`` otherwise
|
||||
* ``httpUsername``: HTTP Basic Auth username OctoPrint is reachable with, optional
|
||||
* ``httpPassword``: HTTP Basic Auth password OctoPrint is reachable with, optional
|
||||
* ``upnpUuid``: uPNP UUID used for SSDP service announcements, usually you will
|
||||
|
||||
@@ -9,5 +9,7 @@ Bundled Plugins
|
||||
|
||||
cura.rst
|
||||
discovery.rst
|
||||
logging.rst
|
||||
pluginmanager.rst
|
||||
printer_safety_check.rst
|
||||
softwareupdate.rst
|
||||
@@ -0,0 +1,238 @@
|
||||
.. _sec-bundledplugins-logging:
|
||||
|
||||
Logging
|
||||
=======
|
||||
|
||||
The OctoPrint Logging plugin comes bundled with OctoPrint starting with version 1.3.7.
|
||||
|
||||
It implements the log management functionality that was formerly part of the core application and adds features to
|
||||
configure logging levels for sub modules through the included settings dialog.
|
||||
|
||||
.. _fig-bundledplugins-logging-settings:
|
||||
.. figure:: ../images/bundledplugins-logging-settings.png
|
||||
:align: center
|
||||
:alt: Logging plugin
|
||||
|
||||
The settings dialog of the Logging plugin
|
||||
|
||||
.. _sec-bundledplugins-logging-api:
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
.. note::
|
||||
|
||||
All log file management operations require admin rights.
|
||||
|
||||
.. _sec-bundledplugins-logging-api-list_logs:
|
||||
|
||||
Retrieve a list of available log files
|
||||
++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
.. http:get:: /plugin/logging/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-bundledplugins-logging-api-datamodel-retrieveresponse>`.
|
||||
|
||||
**Example**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
GET /plugin/logging/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/plugin/logging/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/plugin/logging/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/plugin/logging/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-bundledplugins-logging-api-delete_logs:
|
||||
|
||||
Delete a specific logfile
|
||||
+++++++++++++++++++++++++
|
||||
|
||||
.. http:delete:: /plugin/logging/logs/(path:filename)
|
||||
|
||||
Delete the selected log file with name `filename`.
|
||||
|
||||
Returns a :http:statuscode:`204` after successful deletion.
|
||||
|
||||
**Example Request**
|
||||
|
||||
.. sourcecode:: http
|
||||
|
||||
DELETE /plugin/logging/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-bundledplugins-logging-api-datamodel:
|
||||
|
||||
Data model
|
||||
++++++++++
|
||||
|
||||
.. _sec-bundledplugins-logging-api-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-bundledplugins-logging-api-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-bundledplugins-logging-api-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:`References <sec-bundledplugins-logging-api-datamodel-ref>`
|
||||
- References relevant to this file
|
||||
|
||||
.. _sec-bundledplugins-logging-api-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
|
||||
|
||||
.. _sec-bundledplugins-logging-jsclientlib:
|
||||
|
||||
JS Client Library
|
||||
-----------------
|
||||
|
||||
:mod:`OctoPrintClient.plugins.logging`
|
||||
--------------------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.logging.listLogs(opts)
|
||||
|
||||
Retrieves a list of log files.
|
||||
|
||||
See :ref:`Retrieve a list of available log files <sec-bundledplugins-logging-api-list_logs>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.logging.deleteLog(path, opts)
|
||||
|
||||
Deletes the specified log ``path``.
|
||||
|
||||
See :ref:`Delete a specific log file <sec-bundledplugins-logging-api-delete_logs>` for details.
|
||||
|
||||
:param string path: The path to the log file to delete
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.plugins.logging.downloadLog(path, opts)
|
||||
|
||||
Downloads the specified log ``file``.
|
||||
|
||||
See :js:func:`OctoPrint.download` for more details on the underlying library download mechanism.
|
||||
|
||||
:param string path: The path to the log file to download
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. _sec-bundledplugins-logging-sourcecode:
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
The source of the Logging plugin is bundled with OctoPrint and can be found in its source repository under ``src/octoprint/plugins/logging``.
|
||||
@@ -54,6 +54,12 @@ under Settings > Plugin Manager, or by directly editing ``config.yaml``:
|
||||
# Time to live for the repository cache
|
||||
repository_ttl: 1440
|
||||
|
||||
# The URL of the plugin notices feed to use
|
||||
notices: http://plugins.octoprint.org/notices.json
|
||||
|
||||
# Time to live for the notices feed cache
|
||||
notices_ttl: 360
|
||||
|
||||
# Additional arguments to use with pip. Defaults to unset,
|
||||
# you normally shouldn't need to modify this
|
||||
pip_args: --some --additional --pip --arguments
|
||||
@@ -76,6 +82,36 @@ under Settings > Plugin Manager, or by directly editing ``config.yaml``:
|
||||
- hidden
|
||||
- plugins
|
||||
|
||||
.. _sec-bundledplugins-pluginmanager-hooks:
|
||||
|
||||
Hooks
|
||||
-----
|
||||
|
||||
.. _sec-bundledplugins-pluginmanager-hooks-reconnect_hooks:
|
||||
|
||||
octoprint.plugin.pluginmanager.reconnect_hooks
|
||||
++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
.. py:function:: reconnect_hooks_hook(*args, **kwargs)
|
||||
|
||||
Returns additional hooks defined by the plugin for which the plugin manager
|
||||
should display the "You should reconnect to your printer" message on plugin
|
||||
install/uninstall/enabling/disabling.
|
||||
|
||||
Handlers should return a Python list containing the affected hook names.
|
||||
|
||||
**Example**
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def reconnect_hooks_hook(*args, **kwargs):
|
||||
return ["octoprint.plugin.exampleplugin.some_custom_hook",
|
||||
"octoprint.plugin.exampleplugin.some_other_custom_hook"]
|
||||
|
||||
__plugin_hooks__ = {
|
||||
"octoprint.plugin.pluginmanager.reconnect_hooks": reconnect_hooks_hook
|
||||
}
|
||||
|
||||
.. _sec-bundledplugins-pluginmanager-sourcecode:
|
||||
|
||||
Source Code
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
.. _sec-bundledplugins-printer_safety_check:
|
||||
|
||||
Printer Safety Check
|
||||
====================
|
||||
|
||||
The Printer Safety Check plugin comes bundled with OctoPrint starting with version 1.3.7.
|
||||
|
||||
It tries to identify printers or rather printer firmwares with known safety issues, such as
|
||||
disabled thermal runaway protection, and displays a warning box to logged in users on
|
||||
such identification.
|
||||
|
||||
.. _fig-bundledplugins-printer_safety_check-example:
|
||||
.. figure:: ../images/bundledplugins-printer_safety_check-example.png
|
||||
:align: center
|
||||
:alt: Printer Safety Check warning example
|
||||
|
||||
An example of a warning generated by the Printer Safety Check
|
||||
|
||||
Currently the following firmwares produce this warning:
|
||||
|
||||
* Anet A8 stock firmware
|
||||
|
||||
If you know of further printers/printer firmwares that need to be added here, please
|
||||
`get in touch on the forum and provide their response to an M115 <https://faq.octoprint.org/warning-firmware-unsafe>`_.
|
||||
|
||||
.. seealso::
|
||||
|
||||
`Entry on the "unsafe firmware" warning in OctoPrint's FAQ <https://faq.octoprint.org/warning-firmware-unsafe>`_
|
||||
|
||||
.. note::
|
||||
|
||||
Feel free to disable the plugin in OctoPrint's Plugin Manager if you feel like it is unnecessary. Be advised though
|
||||
that even if your printer might be running totally fine with a known unsafe configuration, that might change
|
||||
unexpectedly and with `catastrophic <https://www.thissmarthouse.net/dont-burn-your-house-down-3d-printing-a-cautionary-tale/>`_
|
||||
`results <https://www.reddit.com/r/3Dprinting/comments/6cekgk/house_fire_thanks_to_cheap_printer_from_china/>`_.
|
||||
|
||||
.. _sec-bundledplugins-printer_safety_check-source:
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
The source of the Printer Safety Check plugin is bundled with OctoPrint and can be
|
||||
found in its source repository under ``src/octoprint/plugins/printer_safety_check``.
|
||||
@@ -14,14 +14,14 @@ First Steps
|
||||
|
||||
Out of the box the Software Update Plugin will be able to notify you of any
|
||||
updates that might be available for your OctoPrint installation or any plugins
|
||||
that registered themselves with it. In order to also be able to update
|
||||
your OctoPrint installation, you'll need to configure
|
||||
at least OctoPrint's checkout folder, and you also should
|
||||
configure the restart commands for OctoPrint and the whole server.
|
||||
that registered themselves with it. In order for automatic restarts after updates
|
||||
to work, you should configure the restart commands for OctoPrint and the whole server.
|
||||
|
||||
For configuring the plugin you'll need to go into OctoPrint's Settings Dialog, navigate to the
|
||||
Software Upda.. _section therein and once you are there click on the little wrench icon in the
|
||||
upper right corner.
|
||||
Out of the box the plugin should already be ready to update your OctoPrint installation to current
|
||||
stable release versions, but you can also switch to one of the available release candidate channels
|
||||
or outright git commit tracking via the plugin's configuration dialog. To open this dialog, fire up OctoPrint's
|
||||
Settings Dialog, navigate to the Software Update section therein and once you are there click on the little
|
||||
wrench icon in the upper right corner.
|
||||
|
||||
.. _fig-bundledplugins-softwareupdate-plugin-configuration:
|
||||
.. figure:: ../images/bundledplugins-softwareupdate-plugin-configuration.png
|
||||
@@ -32,36 +32,21 @@ upper right corner.
|
||||
|
||||
There you can adjust the following settings:
|
||||
|
||||
* **OctoPrint checkout folder**: This should be the path to OctoPrint's git checkout folder (``/home/pi/OctoPrint``
|
||||
for OctoPi or `manual installs following the Raspberry Pi setup guide <https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian>`_).
|
||||
This must be set to allow updating from within OctoPrint
|
||||
|
||||
.. note::
|
||||
|
||||
OctoPi releases 0.12.0 and later ship with this already setup for you.
|
||||
|
||||
.. note::
|
||||
|
||||
**OctoPi 0.11.0 users**: Please also take a look at
|
||||
`the note at the very end of this FAQ entry <https://github.com/foosel/OctoPrint/wiki/FAQ#how-can-i-update-the-octoprint-installation-on-my-octopi-image>`_.
|
||||
Due to a little issue in that OctoPi release 0.11.0 you might have to fix
|
||||
the URL your OctoPrint checkout is using for updating. This can easily be
|
||||
done by SSHing into your OctoPi instance and doing this::
|
||||
|
||||
cd ~/OctoPrint
|
||||
git remote set-url origin https://github.com/foosel/OctoPrint.git
|
||||
|
||||
* **OctoPrint version tracking**: Whether you want to track OctoPrint *releases* or every *commit*. Usually you want to
|
||||
select "Release" here which is also the default, unless you are a developer.
|
||||
* **OctoPrint Release Channel**: The release channel of OctoPrint to track for updates. If you only want stable versions,
|
||||
* **OctoPrint Release Channel** (if tracking releases): The release channel of OctoPrint to track for updates. If you only want stable versions,
|
||||
select "Stable" here which is also the default. "Maintenance RCs" will also allow you to update to maintenance release
|
||||
candidates, "Devel RCs" will also allow you to update to development release candidates. If in doubt, leave it at
|
||||
"Stable". `Read more about Release Channels here <https://github.com/foosel/OctoPrint/wiki/Using-Release-Channels>`_.
|
||||
* **OctoPrint checkout folder** (if tracking git commits): This must be the path to OctoPrint's git checkout folder
|
||||
(``/home/pi/OctoPrint`` for OctoPi or `manual installs following the Raspberry Pi setup guide <https://github.com/foosel/OctoPrint/wiki/Setup-on-a-Raspberry-Pi-running-Raspbian>`_).
|
||||
Note that since OctoPrint 1.3.6 you will no longer need to set this to be able to update to releases, only if you
|
||||
want to be able to update against some bleeding edge git branch.
|
||||
* **Version cache TTL**: The "time to live" of the cache OctoPrint will use to temporarily persist the version information
|
||||
for the various components registered with the plugin, so that they don't have to be queried from the internet every time
|
||||
you load the page. Defaults to 24h, you usually shouldn't need to change that value.
|
||||
|
||||
More settings are available by :ref:`editing the correspondi.. _section in config.yaml <sec-bundledplugins-softwareupdate-configuration>`.
|
||||
More settings are available by :ref:`editing the corresponding section in config.yaml <sec-bundledplugins-softwareupdate-configuration>`.
|
||||
|
||||
That restart commands for OctoPrint and the whole server can be configured under Settings > Server.
|
||||
|
||||
@@ -71,9 +56,9 @@ Command line usage
|
||||
------------------
|
||||
|
||||
The functionality of the Software Update Plugin is also available on OctoPrint's command line interface under the
|
||||
``plugins`` sub command. It's is possible to check for updates via ``octoprint plugins softwareupdate:check``
|
||||
and to apply available updates via ``octoprint plugins softwareupdate:update``. Please the corresponding
|
||||
``--help`` pages on details:
|
||||
``plugins`` sub command. It's possible to check for updates via ``octoprint plugins softwareupdate:check``
|
||||
and to apply available updates via ``octoprint plugins softwareupdate:update``. Please see the corresponding
|
||||
``--help`` pages for details:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
@@ -132,30 +117,29 @@ Configuring the Plugin
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
# the time-to-live of the version cache, in minutes
|
||||
cache_ttl: 60
|
||||
plugins:
|
||||
softwareupdate:
|
||||
# the time-to-live of the version cache, in minutes
|
||||
cache_ttl: 60
|
||||
|
||||
# configured version check and update methods
|
||||
checks:
|
||||
# "octoprint" is reserved for OctoPrint
|
||||
octoprint:
|
||||
# this defines an version check that will check against releases
|
||||
# published on OctoPrint's Github repository and an update method
|
||||
# utilizing an (included) update script that will be run on
|
||||
# OctoPrint's checkout folder
|
||||
type: github_release
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
update_script: '{python} "/path/to/octoprint-update.py" --python="{python}" "{folder}" "{target}"'
|
||||
update_folder: /path/to/octoprint/checkout/folder
|
||||
# configured version check and update methods
|
||||
checks:
|
||||
# "octoprint" is reserved for OctoPrint
|
||||
octoprint:
|
||||
# this defines a version check that will check against releases
|
||||
# published on OctoPrint's Github repository and pip as update method
|
||||
# against the release archives on Github - this is the default
|
||||
type: github_release
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
method: pip
|
||||
pip: 'https://github.com/foosel/OctoPrint/archive/{target_version}.zip'
|
||||
|
||||
# further checks may be define here
|
||||
# further checks may be defined here
|
||||
|
||||
# pip command, if another one than the automatically detected one should be
|
||||
# used - should normally NOT be necessary and hence set
|
||||
pip_command: /path/to/pip
|
||||
# pip command, if another one than the automatically detected one should be
|
||||
# used - should normally NOT be necessary and hence set
|
||||
pip_command: /path/to/pip
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-versionchecks:
|
||||
|
||||
@@ -188,6 +172,23 @@ Version checks
|
||||
* ``repo``: (mandatory) Github repository to check
|
||||
* ``branch``: Branch of the Github repository to check, defaults to
|
||||
``master`` if not set.
|
||||
* ``current``: Current commit hash. Will be updated automatically.
|
||||
|
||||
* ``bitbucket_commit``: Checks against commits pushed to Bitbucket. Additional
|
||||
config parameters:
|
||||
|
||||
* ``user``: (mandatory) Bitbucket user the repository to check belongs to
|
||||
* ``repo``: (mandatory) Bitbucket repository to check
|
||||
* ``branch``: Branch of the Bitbucket repository to check, defaults to
|
||||
``master`` if not set.
|
||||
* ``current``: Current commit hash. Will be updated automatically.
|
||||
* ``api_user``: (mandatory only for private repositories) Bitbucket user name (not email address).
|
||||
Requires ``api_password`` to be set. Hint: This is used for the check only. For the actual
|
||||
download you might register your public SSH key as access key for the according repo and
|
||||
configure this as pip URL in ``config.yaml``: ``git+ssh://git@bitbucket.org/my_user/my_repo.git@{target_version}``
|
||||
* ``api_password``: (mandatory only for private repositories) App password. Requires
|
||||
``api_user`` to be set. **Important**: Never use your actual Bitbucket login password. Generate
|
||||
a new app password. App passwords are user specific on Bitbucket.
|
||||
|
||||
* ``git_commit``: Checks a local git repository for new commits on its
|
||||
configured remote. Additional config parameters:
|
||||
@@ -208,10 +209,21 @@ Version checks
|
||||
:ref:`hook <sec-bundledplugins-softwareupdate-hooks>`. Additional config
|
||||
parameters:
|
||||
|
||||
* ``python_checker``: (mandatory) A python callable which returns version
|
||||
* ``python_checker``: (mandatory) A Python callable which returns version
|
||||
information and whether the current version is up-to-date or not, see
|
||||
below for details.
|
||||
|
||||
* ``always_current``: Always reports that no update is necessary. Useful for debugging
|
||||
software update mechanisms during development. Additional config parameters:
|
||||
|
||||
* ``current_version``: Version to report for both local and remote version.
|
||||
|
||||
* ``never_current``: Always reports that an update is necessary. Useful for debugging
|
||||
software update mechanisms during development. Additional config parameters:
|
||||
|
||||
* ``local_version``: Current local version. Defaults to ``1.0.0``.
|
||||
* ``remote_version``: Remote version to offer update to. Defaults to ``1.0.1``.
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-updatemethods:
|
||||
|
||||
Update methods
|
||||
@@ -229,8 +241,37 @@ Update methods
|
||||
``update_folder`` setting or if the ``git_commit`` check is used its
|
||||
``checkout_folder`` setting.
|
||||
* ``python_updater``: Can only be specified by plugins through the
|
||||
:ref:`hook <sec-bundledplugins-softwareupdate-hooks>`. A python callable
|
||||
:ref:`hook <sec-bundledplugins-softwareupdate-hooks>`. A Python callable
|
||||
which performs the update, see below for details.
|
||||
* ``sleep_a_bit``: Does nothing but block for a configurable ``duration`` and log
|
||||
a countdown in the meantime. Useful for debugging software update mechanisms
|
||||
during development.
|
||||
|
||||
.. note::
|
||||
|
||||
To allow default configurations for multiple update methods, if more than one of
|
||||
the above update method specific settings is set the one to use can be selected
|
||||
by setting the property ``method`` to the method specific setting in question.
|
||||
|
||||
**Example**
|
||||
|
||||
The following example defines both ``pip`` and ``update_script``. By setting to
|
||||
``method`` to ``pip``, the Software Update plugin is instructed to use that as
|
||||
update method.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
plugins:
|
||||
softwareupdate:
|
||||
checks:
|
||||
octoprint:
|
||||
type: github_release
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
method: pip
|
||||
pip: 'https://github.com/foosel/OctoPrint/archive/{target_version}.zip'
|
||||
update_script: '{python} "/path/to/octoprint-update.py" --python="{python}" "{folder}" "{target}"'
|
||||
checkout_folder: /path/to/octoprint/checkout/folder
|
||||
|
||||
.. _sec-bundledplugins-softwareupdate-configuration-patterns:
|
||||
|
||||
@@ -251,6 +292,7 @@ plugin itself):
|
||||
user: foosel
|
||||
repo: OctoPrint
|
||||
branch: devel
|
||||
method: update_script
|
||||
update_folder: /home/pi/OctoPrint
|
||||
|
||||
Plugin installed via pip and hosted on Github under
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ 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 = ['codeblockext', 'onlineinclude', 'sphinx.ext.todo', 'sphinx.ext.autodoc', 'sphinxcontrib.httpdomain',
|
||||
'sphinx.ext.napoleon']
|
||||
'sphinx.ext.napoleon', 'sphinxcontrib.mermaid']
|
||||
todo_include_todos = True
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
|
||||
@@ -36,7 +36,7 @@ Use the following settings to enable access control:
|
||||
|
||||
# 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
|
||||
autologinLocal: false
|
||||
|
||||
# The name of the user to automatically log on clients originating from "localNetworks" as. Must
|
||||
# be the name of one of your configured users.
|
||||
@@ -51,6 +51,17 @@ Use the following settings to enable access control:
|
||||
- 127.0.0.0/8
|
||||
- 192.168.1.0/24
|
||||
|
||||
# Whether to trust Basic Authentication headers. If you have setup Basic Authentication in front of
|
||||
# OctoPrint and the user names you use there match OctoPrint accounts, by setting this to true users will
|
||||
# be logged into OctoPrint as the user user during Basic Authentication. Your should ONLY ENABLE THIS if your
|
||||
# OctoPrint instance is only accessible through a connection locked down through Basic Authentication!
|
||||
trustBasicAuthentication: false
|
||||
|
||||
# Whether to also check the password provided through Basic Authentication if the Basic Authentication
|
||||
# header is to be trusted. Disabling this will only match the user name in the Basic Authentication
|
||||
# header and login the user without further checks. Use with caution.
|
||||
checkBasicAuthenticationPassword: true
|
||||
|
||||
.. _sec-configuration-config_yaml-api:
|
||||
|
||||
API
|
||||
@@ -285,9 +296,13 @@ The following settings are only relevant to you if you want to do OctoPrint deve
|
||||
# to false.
|
||||
okWithLinenumber: false
|
||||
|
||||
# Number of extruders to simulate on the virtual printer.
|
||||
# Number of extruders to simulate on the virtual printer. Map from tool id (0, 1, ...) to temperature
|
||||
# in °C
|
||||
numExtruders: 1
|
||||
|
||||
# Allows pinning certain hotends to a fixed temperature
|
||||
pinnedExtruders: null
|
||||
|
||||
# Whether to include the current tool temperature in the M105 output as separate T segment or not.
|
||||
#
|
||||
# True: > M105
|
||||
@@ -304,13 +319,6 @@ The following settings are only relevant to you if you want to do OctoPrint deve
|
||||
# > 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
|
||||
|
||||
@@ -331,6 +339,18 @@ The following settings are only relevant to you if you want to do OctoPrint deve
|
||||
# to make sure nothing gets lost on the line
|
||||
repetierStyleResends: false
|
||||
|
||||
# If enabled, ok will be sent before a commands output, otherwise after or inline (M105)
|
||||
#
|
||||
# True: > M20
|
||||
# < ok
|
||||
# < Begin file list
|
||||
# < End file list
|
||||
# False: > M20
|
||||
# < Begin file list
|
||||
# < End file list
|
||||
# < ok
|
||||
okBeforeCommandOutput: false
|
||||
|
||||
# If enabled, reports the first extruder in M105 responses as T instead of T0
|
||||
#
|
||||
# True: > M105
|
||||
@@ -358,7 +378,8 @@ The following settings are only relevant to you if you want to do OctoPrint deve
|
||||
# side will block
|
||||
rxBuffer: 64
|
||||
|
||||
# Size of simulated command buffer
|
||||
# Size of simulated command buffer, number of commands. If full, buffered commands will block
|
||||
# until a slot frees up
|
||||
commandBuffer: 4
|
||||
|
||||
# Whether to support the M112 command with simulated kill
|
||||
@@ -370,6 +391,58 @@ The following settings are only relevant to you if you want to do OctoPrint deve
|
||||
# Whether to simulate broken M29 behaviour (missing ok after response)
|
||||
brokenM29: true
|
||||
|
||||
# Whether F is supported as individual command
|
||||
supportF: false
|
||||
|
||||
# Firmware name to report (useful for testing firmware detection)
|
||||
firmwareName: Virtual Marlin 1.0
|
||||
|
||||
# Simulate a shared nozzle
|
||||
sharedNozzle: false
|
||||
|
||||
# Send "busy" messages if busy processing something
|
||||
sendBusy: false
|
||||
|
||||
# Simulate a reset on connect
|
||||
simulateReset: true
|
||||
|
||||
# Lines to send on simulated reset
|
||||
resetLines:
|
||||
- start
|
||||
- Marlin: Virtual Marlin!
|
||||
- "\x80"
|
||||
- "SD card ok"
|
||||
|
||||
# Initial set of prepared oks to use instead of regular ok (e.g. to simulate
|
||||
# mis-sent oks). Can also be filled at runtime via the debug command prepare_ok
|
||||
preparedOks: []
|
||||
|
||||
# Format string for ok response.
|
||||
#
|
||||
# Placeholders:
|
||||
# - lastN: last acknowledged line number
|
||||
# - buffer: empty slots in internal command buffer
|
||||
#
|
||||
# Example format string for "extended" ok format:
|
||||
# ok N{lastN} P{buffer}
|
||||
okFormatString: ok
|
||||
|
||||
# Format string for M115 output.
|
||||
#
|
||||
# Placeholders:
|
||||
# - firmare_name: The firmware name as defined in firmwareName
|
||||
m115FormatString: "FIRMWARE_NAME: {firmware_name} PROTOCOL_VERSION:1.0"
|
||||
|
||||
# Whether to include capability report in M115 output
|
||||
m115ReportCapabilites: false
|
||||
|
||||
# Capabilities to report if capability report is enabled
|
||||
capabilities:
|
||||
AUTOREPORT_TEMP: true
|
||||
|
||||
# Simulated ambient temperature in °C
|
||||
ambientTemperature: 21.3
|
||||
|
||||
.. _sec-configuration-config_yaml-estimation:
|
||||
|
||||
Estimation
|
||||
@@ -460,52 +533,16 @@ 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
|
||||
|
||||
@@ -513,11 +550,16 @@ Use the following settings to enable or disable OctoPrint features:
|
||||
# notifications instead (false)
|
||||
pollWatched: false
|
||||
|
||||
# Whether to ignore identical resends from the printer (true, repetier) or not (false)
|
||||
ignoreIdenticalResends: false
|
||||
# Whether to enable model size detection and warning (true) or not (false)
|
||||
modelSizeDetection: true
|
||||
|
||||
# If ignoredIdenticalResends is true, how many consecutive identical resends to ignore
|
||||
identicalResendsCount: 7
|
||||
# Whether to show a confirmation on print cancelling (true) or not (false)
|
||||
printCancelConfirmation: true
|
||||
|
||||
# Commands that should never be auto-uppercased when sent to the printer through the Terminal tab.
|
||||
# Defaults to only M117.
|
||||
autoUppercaseBlacklist:
|
||||
- M117
|
||||
|
||||
.. _sec-configuration-config_yaml-folder:
|
||||
|
||||
@@ -565,6 +607,45 @@ Use the following settings to set custom paths for folders used by OctoPrint:
|
||||
# Absolute path where to store (GCODE) scripts
|
||||
scripts: /path/to/scripts/folder
|
||||
|
||||
.. _sec-configuration-config_yaml-gcodeanalysis:
|
||||
|
||||
GCODE Analysis
|
||||
--------------
|
||||
|
||||
Settings pertaining to the server side GCODE analysis implementation.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Maximum number of extruders to support/to sanity check for
|
||||
maxExtruders: 10
|
||||
|
||||
# Pause between each processed GCODE line in normal priority mode, seconds
|
||||
throttle_normalprio: 0.01
|
||||
|
||||
# Pause between each processed GCODE line in high priority mode (e.g. on fresh
|
||||
# uploads), seconds
|
||||
throttle_highprio: 0.0
|
||||
|
||||
.. _sec-configuration-config_yaml-gcodeviewer:
|
||||
|
||||
GCODE Viewer
|
||||
------------
|
||||
|
||||
Settings pertaining to the built in GCODE Viewer.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Whether to enable the GCODE viewer in the UI
|
||||
enabled: true
|
||||
|
||||
# Maximum size a GCODE file may have on mobile devices to automatically be loaded
|
||||
# into the viewer, defaults to 2MB
|
||||
mobileSizeThreshold: 2097152
|
||||
|
||||
# Maximum size a GCODE file may have to automatically be loaded into the viewer,
|
||||
# defaults to 20MB
|
||||
sizeThreshold: 20971520
|
||||
|
||||
.. _sec-configuration-config_yaml-plugins:
|
||||
|
||||
Plugin settings
|
||||
@@ -679,8 +760,38 @@ Use the following settings to configure the serial connection to the printer:
|
||||
connection: 2
|
||||
|
||||
# Timeout during serial communication, in seconds.
|
||||
# Defaults to 5 sec
|
||||
communication: 5
|
||||
# Defaults to 30 sec
|
||||
communication: 30
|
||||
|
||||
# Timeout during serial communication when busy protocol support is detected, in seconds.
|
||||
# Defaults to 3 sec
|
||||
communicationBusy: 3
|
||||
|
||||
# Timeout after which to query temperature when no target is set
|
||||
temperature: 5
|
||||
|
||||
# Timeout after which to query temperature when a target is set
|
||||
temperatureTargetSet: 2
|
||||
|
||||
# Timeout after which to query the SD status while SD printing
|
||||
sdStatus: 1
|
||||
|
||||
# Maximum number of consecutive communication timeouts after which the printer will be considered
|
||||
# dead and OctoPrint disconnects with an error.
|
||||
maxCommunicationTimeouts:
|
||||
|
||||
# max. timeouts when the printer is idle
|
||||
idle: 2
|
||||
|
||||
# max. timeouts when the printer is printing
|
||||
printing: 5
|
||||
|
||||
# max. timeouts when a long running command is active
|
||||
long: 5
|
||||
|
||||
# Maximum number of write attempts to serial during which nothing can be written before the communication
|
||||
# with the printer is considered dead and OctoPrint will disconnect with an error
|
||||
maxWritePasses: 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.
|
||||
@@ -702,6 +813,7 @@ Use the following settings to configure the serial connection to the printer:
|
||||
- G32
|
||||
- M400
|
||||
- M226
|
||||
- M600
|
||||
|
||||
# Commands which need to always be send with a checksum. Defaults to only M110
|
||||
checksumRequiringCommands:
|
||||
@@ -710,7 +822,8 @@ Use the following settings to configure the serial connection to the printer:
|
||||
# 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
|
||||
helloCommand:
|
||||
- M110 N0
|
||||
|
||||
# Whether to disconnect on errors or not
|
||||
disconnectOnErrors: true
|
||||
@@ -722,6 +835,60 @@ Use the following settings to configure the serial connection to the printer:
|
||||
# impact, leave on if possible please
|
||||
logResends: 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 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 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
|
||||
|
||||
# Whether to support F on its own as a valid GCODE command (true) or not (false)
|
||||
supportFAsCommand: false
|
||||
|
||||
# Whether to attempt to auto detect the firmware of the printer and adjust settings
|
||||
# accordingly (true) or not and rely on manual configuration (false)
|
||||
firmwareDetection: true
|
||||
|
||||
# Whether to block all sending to the printer while a G4 (dwell) command is active (true, repetier)
|
||||
# or not (false)
|
||||
blockWhileDwelling: false
|
||||
|
||||
# Whether to support resends without follow-up ok or not
|
||||
supportResendsWithoutOk: false
|
||||
|
||||
@@ -729,6 +896,14 @@ Use the following settings to configure the serial connection to the printer:
|
||||
# the responds skips on the ok)
|
||||
triggerOkForM29: true
|
||||
|
||||
capabilities:
|
||||
|
||||
# Whether to enable temperature autoreport in the firmware if its support is detected
|
||||
autoreport_temp: true
|
||||
|
||||
# Whether to shorten the communication timeout if the firmware seems to support the busy protocol
|
||||
busy_protocol: true
|
||||
|
||||
.. _sec-configuration-config_yaml-server:
|
||||
|
||||
Server
|
||||
@@ -746,10 +921,14 @@ Use the following settings to configure the server:
|
||||
# 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
|
||||
# If this option is true, OctoPrint will show the First Run wizard and set the setting to
|
||||
# false after that completes
|
||||
firstRun: false
|
||||
|
||||
# If this option is true, OctoPrint will enable safe mode on the next server start and
|
||||
# reset the setting to false
|
||||
startOnceInSafeMode: false
|
||||
|
||||
# Secret key for encrypting cookies and such, randomly generated on first run
|
||||
secretKey: someSecretKey
|
||||
|
||||
@@ -822,6 +1001,31 @@ Use the following settings to configure the server:
|
||||
# Command to shut down the system OctoPrint is running on, defaults to being unset
|
||||
systemShutdownCommand: sudo shutdown -h now
|
||||
|
||||
# Configuration of the regular online connectivity check
|
||||
onlineCheck:
|
||||
# whether the online check is enabled, defaults to false due to valid privacy concerns
|
||||
enabled: false
|
||||
|
||||
# interval in which to check for online connectivity (in seconds)
|
||||
interval: 300
|
||||
|
||||
# DNS host against which to check (default: 8.8.8.8 aka Google's DNS)
|
||||
host: 8.8.8.8
|
||||
|
||||
# DNS port against which to check (default: 53 - the default DNS port)
|
||||
port: 53
|
||||
|
||||
# Configuration of the plugin blacklist
|
||||
pluginBlacklist:
|
||||
# whether use of the blacklist is enabled, defaults to false
|
||||
enabled: false
|
||||
|
||||
# the URL from which to fetch the blacklist
|
||||
url: http://plugins.octoprint.org/blacklist.json
|
||||
|
||||
# time to live of the cached blacklist, in seconds (default: 15 minutes)
|
||||
ttl: 15 * 60
|
||||
|
||||
# Settings of when to display what disk space warning
|
||||
diskspace:
|
||||
|
||||
@@ -856,8 +1060,8 @@ Use the following settings to configure the server:
|
||||
* ``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.
|
||||
`into OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki/Reverse-proxy-configuration-examples>`_ for some
|
||||
examples on how to configure this.
|
||||
|
||||
.. _sec-configuration-config_yaml-slicing:
|
||||
|
||||
@@ -903,7 +1107,7 @@ OctoPrint is running is allowed to do this without password entry:
|
||||
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:
|
||||
You can also add a divider by setting action to divider like this:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
@@ -944,10 +1148,12 @@ Use `Javascript regular expressions <https://developer.mozilla.org/en/docs/Web/J
|
||||
|
||||
# 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)'
|
||||
- name: Suppress temperature messages
|
||||
regex: '(Send: (N\d+\s+)?M105)|(Recv: ok T:)'
|
||||
- name: Suppress SD status messages
|
||||
regex: '(Send: (N\d+\s+)?M27)|(Recv: SD printing byte)'
|
||||
- name: Suppress wait responses
|
||||
regex: 'Recv: wait'
|
||||
|
||||
.. _sec-configuration-config_yaml-webcam:
|
||||
|
||||
@@ -981,22 +1187,42 @@ Use the following settings to configure webcam support:
|
||||
# Whether to include a "created with OctoPrint" watermark in the generated timelapse movies
|
||||
watermark: true
|
||||
|
||||
# Whether to flip the webcam horizontally
|
||||
flipH: false
|
||||
|
||||
# Whether to flip the webcam vertically
|
||||
flipV: false
|
||||
|
||||
# Whether to rotate the webcam 90° counter clockwise
|
||||
rotate90: false
|
||||
|
||||
# The default timelapse settings.
|
||||
timelapse:
|
||||
|
||||
# The timelapse type. Can be either "off", "zchange" or "timed". Defaults to "off"
|
||||
type: timed
|
||||
|
||||
# The framerate at which to render the movie
|
||||
fps: 25
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# Timed timelapses only: Whether to capture the snapshots for the post roll (true) or just copy
|
||||
# the last captured snapshot from the print over and over again (false)
|
||||
capturePostRoll: true
|
||||
|
||||
# ZChange timelapses only: Z-hop height during retractions to ignore for capturing snapshots
|
||||
retractionZHop: 0.0
|
||||
|
||||
# After how many days unrendered timelapses will be deleted
|
||||
cleanTmpAfterDays: 7
|
||||
@@ -0,0 +1,218 @@
|
||||
.. _sec-development-environment:
|
||||
|
||||
Setting up a Development environment
|
||||
====================================
|
||||
|
||||
.. _sec-development-environment-source:
|
||||
|
||||
Obtaining, building and running the source
|
||||
------------------------------------------
|
||||
|
||||
This describes the general steps in obtaining, building and running. OS specific instructions can be found
|
||||
below.
|
||||
|
||||
* Prerequisites:
|
||||
|
||||
* `Python 2.7 <https://python.org>`_ including ``pip``, ``setuptools`` and ``virtualenv``
|
||||
* `Git <https://git-scm.com>`_
|
||||
|
||||
* Checkout the OctoPrint sources from their Git repository: ``git clone https://github.com/foosel/OctoPrint.git``
|
||||
* Enter the checked out source folder: ``cd OctoPrint``
|
||||
* Create a virtual environment in the checked out source folder to use for installing and running OctoPrint and its
|
||||
dependencies (this avoids potential versioning issues for the dependencies with system wide installed
|
||||
instances): ``virtualenv venv``
|
||||
* Activate the virtual environment: ``source venv/bin/activate`` (Linux, MacOS) or
|
||||
``source venv/Scripts/activate`` (Git Bash under Windows, see below)
|
||||
* Update ``pip`` in the virtual environment: ``pip install --upgrade pip``
|
||||
* Install OctoPrint in `"editable" mode <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>`_,
|
||||
including its regular *and* development and plugin development dependencies: ``pip install -e .[develop,plugins]``
|
||||
|
||||
When the virtual environment is activated you can then:
|
||||
|
||||
* run the OctoPrint server via ``octoprint serve``
|
||||
* run the test suite from the checked out source folder via ``nosetests --with-doctest``
|
||||
* build the documentation from the ``docs`` sub folder of the checked out sources via ``sphinx-build -b html . _build``
|
||||
|
||||
.. _sec-development-environment-source-linux:
|
||||
|
||||
Linux
|
||||
.....
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First make sure you have python including its header files, pip, setuptools, virtualenv, git and some build requirements
|
||||
installed:
|
||||
|
||||
* On apt based distributions (e.g. Debian, Ubuntu, ...):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt-get install python python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
|
||||
|
||||
* On zypper based distributions (example below for SLES 12 SP2):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo zypper ar https://download.opensuse.org/repositories/devel:/languages:/python/SLE_12_SP2/ python_devel
|
||||
sudo zypper ref
|
||||
sudo zypper in python python-pip python-devel python-setuptools python-virtualenv git libyaml-devel
|
||||
sudo zypper in -t pattern Basis-Devel
|
||||
|
||||
.. todo::
|
||||
|
||||
Using a Linux distribution that doesn't use ``apt`` or ``zypper``? Please send a
|
||||
`Pull Request <https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
Then:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins]
|
||||
|
||||
You can then start OctoPrint via ``~/devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-windows:
|
||||
|
||||
Windows
|
||||
.......
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First download & install:
|
||||
|
||||
* `Python 2.7.12 Windows x86 MSI installer <https://www.python.org/downloads/release/python-2712/>`_
|
||||
|
||||
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
|
||||
|
||||
* `Microsoft Visual C++ Compiler for Python 2.7 <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_
|
||||
* `Git for Windows <https://git-for-windows.github.io/>`_
|
||||
|
||||
Open the Git Bash you just installed and in that:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
pip install virtualenv
|
||||
cd /c/Devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/Scripts/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins]
|
||||
|
||||
.. _sec-development-environment-mac:
|
||||
|
||||
Mac OS X
|
||||
........
|
||||
|
||||
.. note::
|
||||
|
||||
This guide is based on the `Setup Guide for Mac OS X on OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki/Setup-on-Mac/>`_.
|
||||
Please report back if it works for you, due to lack of access to a Mac I cannot test it myself. Thanks.
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
You'll need a user account with administrator privileges.
|
||||
|
||||
* Install the latest version of Xcode suitable for your OS. For example, OS X 10.11 (El Capitan) requires Xcode 7.
|
||||
* Install Xcode's command line tools:
|
||||
|
||||
* ``xcode-select --install``
|
||||
* ``sudo xcodebuild`` (ensure the license was accepted)
|
||||
* If you have more than one Xcode installed: ``sudo xcode-select -s /Applications/Xcode.app/Contents/Developer``
|
||||
|
||||
* Install Homebrew and use that to install Python:
|
||||
|
||||
* ``ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``
|
||||
* ``brew install python``
|
||||
|
||||
* Install `virtualenv <https://virtualenv.pypa.io/>`_
|
||||
|
||||
* ``pip install virtualenv``
|
||||
|
||||
* Install OctoPrint
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop,plugins]
|
||||
|
||||
.. _sec-development-environment-ides:
|
||||
|
||||
IDE Setup
|
||||
---------
|
||||
|
||||
.. todo::
|
||||
|
||||
Using another IDE than the ones below? Please send a
|
||||
`Pull Request <https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
.. _sec-development-environment-ides-pycharm:
|
||||
|
||||
PyCharm
|
||||
.......
|
||||
|
||||
- "File" > "Open ...", select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
- "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...", select OctoPrint venv
|
||||
folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\OctoPrint\venv``)
|
||||
- Right click "src" in project tree, mark as source folder
|
||||
- Add Run/Debug Configuration, select "Python":
|
||||
|
||||
* Name: OctoPrint server
|
||||
* Script: path to ``run`` in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/run`` or ``C:\Devel\OctoPrint\run``)
|
||||
* Script parameters: ``serve --debug``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: the ``venv`` local virtual environment
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
* If you want dependencies to auto-update on run if necessary: "Before Launch" > "+" > "Run external tool" > "+"
|
||||
|
||||
* Name: Update OctoPrint dependencies
|
||||
* Program: ``$PyInterpreterDirectory$/pip`` (or ``$PyInterpreterDirectory$/pip.exe`` on Windows)
|
||||
* Parameters: ``install -e .[develop,plugins]``
|
||||
* Working directory: ``$ProjectFileDir$``
|
||||
|
||||
- Add Run/Debug Configuration, select "Python tests" and therein "Nosetests":
|
||||
|
||||
* Name: OctoPrint nosetests
|
||||
* Target: Path, ``.``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: the ``venv`` local virtual environment
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
* Just like with the run configuration for the server you can also have the dependencies auto-update on run of
|
||||
the tests, see above on how to set this up.
|
||||
|
||||
- Add Run/Debug Configuration, select "Python docs" and therein "Sphinx task"
|
||||
|
||||
* Name: OctoPrint docs
|
||||
* Command: ``html``
|
||||
* Input: the ``docs`` folder in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/docs`` or
|
||||
``C:\Devel\OctoPrint\docs``)
|
||||
* Output: the ``docs/_build`` folder in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/docs/_build`` or
|
||||
``C:\Devel\OctoPrint\docs\_build``)
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: the ``venv`` local virtual environment
|
||||
* Just like with the run configuration for the server you can also have the dependencies auto-update when building
|
||||
the documentation, see above on how to set this up.
|
||||
|
||||
.. note::
|
||||
|
||||
Make sure you are running a PyCharm version of 2016.1 or later, or manually fix
|
||||
`a debugger bug contained in earlier versions <https://youtrack.jetbrains.com/issue/PY-18365>`_ or plugin management
|
||||
will not work in your developer install when running OctoPrint from PyCharm in debug mode.
|
||||
+4
-180
@@ -4,184 +4,8 @@
|
||||
Development
|
||||
###########
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
.. _sec-development-environment:
|
||||
|
||||
Setting up a Development environment
|
||||
====================================
|
||||
|
||||
.. _sec-development-environment-source:
|
||||
|
||||
Obtaining, building and running the source
|
||||
------------------------------------------
|
||||
|
||||
This describes the general steps in obtaining, building and running. OS specific instructions can be found
|
||||
below.
|
||||
|
||||
* Prerequisites:
|
||||
|
||||
* `Python 2.7 <https://python.org>`_ including ``pip``, ``setuptools`` and ``virtualenv``
|
||||
* `Git <https://git-scm.com>`_
|
||||
|
||||
* Checkout the OctoPrint sources from their Git repository: ``git clone https://github.com/foosel/OctoPrint.git``
|
||||
* Create a virtual environment in the checkout folder to use for installing and running OctoPrint and its
|
||||
dependencies (this avoids potential versioning issues for the dependencies with system wide installed
|
||||
instances): ``virtualenv venv``
|
||||
* Activate the virtual environment: ``source venv/bin/activate`` (might differ per your platform/OS)
|
||||
* Update ``pip`` in the virtual environment: ``pip install --upgrade pip``
|
||||
* Install OctoPrint in `"editable" mode <https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>`_,
|
||||
including its regular *and* development dependencies: ``pip install -e .[develop]``
|
||||
|
||||
.. _sec-development-environment-source-linux:
|
||||
|
||||
Linux
|
||||
.....
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First make sure you have python including its header files, pip, setuptools, virtualenv, git and some build requirements
|
||||
installed:
|
||||
|
||||
* On apt based distributions (e.g. Debian, Ubuntu, ...):
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
sudo apt-get install python python-pip python-dev python-setuptools python-virtualenv git libyaml-dev build-essential
|
||||
|
||||
.. todo::
|
||||
|
||||
Using a Linux distribution that doesn't use ``apt``? Please send a
|
||||
`Pull Request <https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
Then:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop]
|
||||
|
||||
You can then start OctoPrint via ``~/devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-windows:
|
||||
|
||||
Windows
|
||||
.......
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``C:\Devel\OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
First download & install:
|
||||
|
||||
* `Python 2.7.12 Windows x86 MSI installer <https://www.python.org/downloads/release/python-2712/>`_
|
||||
|
||||
* make sure to have the installer add Python to the ``PATH`` and have it install ``pip`` too
|
||||
|
||||
* `Microsoft Visual C++ Compiler for Python 2.7 <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_
|
||||
* `Git for Windows <https://git-for-windows.github.io/>`_
|
||||
|
||||
Open the Git Bash you just installed and in that:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
pip install virtualenv
|
||||
cd /c/Devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source ./venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install -e .[develop]
|
||||
|
||||
You can then start OctoPrint via ``/c/Devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-mac:
|
||||
|
||||
Mac OS X
|
||||
........
|
||||
|
||||
.. note::
|
||||
|
||||
This guide is based on the `Setup Guide for Mac OS X on OctoPrint's wiki <https://github.com/foosel/OctoPrint/wiki/Setup-on-Mac/>`_.
|
||||
Please report back if it works for you, due to lack of access to a Mac I cannot test it myself. Thanks.
|
||||
|
||||
This assumes you'll host your OctoPrint development checkout at ``~/devel/OctoPrint``. If you want to use a different
|
||||
location, please substitute accordingly.
|
||||
|
||||
You'll need a user account with administrator privileges.
|
||||
|
||||
* Install the latest version of Xcode suitable for your OS. For example, OS X 10.11 (El Capitan) requires Xcode 7.
|
||||
* Install Xcode's command line tools:
|
||||
|
||||
* ``xcode-select --install``
|
||||
* ``sudo xcodebuild`` (ensure the license was accepted)
|
||||
* If you have more than one Xcode installed: ``sudo xcode-select -s /Applications/Xcode.app/Contents/Developer``
|
||||
|
||||
* Install Homebrew and use that to install Python:
|
||||
|
||||
* ``ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``
|
||||
* ``brew install python``
|
||||
|
||||
* Install `virtualenv <https://virtualenv.pypa.io/>`_
|
||||
|
||||
* ``pip install virtualenv``
|
||||
|
||||
* Install OctoPrint
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
cd ~/devel
|
||||
git clone https://github.com/foosel/OctoPrint.git
|
||||
cd OctoPrint
|
||||
virtualenv venv
|
||||
source venv/bin/activate
|
||||
pip install -U pyobjc
|
||||
pip install -e .[develop]
|
||||
|
||||
You can then start OctoPrint via ``~/devel/OctoPrint/venv/bin/octoprint`` or just ``octoprint`` if you activated the virtual
|
||||
environment.
|
||||
|
||||
.. _sec-development-environment-ides:
|
||||
|
||||
IDE Setup
|
||||
---------
|
||||
|
||||
.. todo::
|
||||
|
||||
Using another IDE than the ones below? Please send a
|
||||
`Pull Request <https://github.com/foosel/OctoPrint/blob/master/CONTRIBUTING.md#pull-requests>`_ to get the necessary
|
||||
steps into this guide!
|
||||
|
||||
.. _sec-development-environment-ides-pycharm:
|
||||
|
||||
PyCharm
|
||||
.......
|
||||
|
||||
- "File" > "Open ...", select OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\OctoPrint``)
|
||||
- "File" > "Settings ..." > "Project: OctoPrint" > "Project Interpreter" > "Add local ...", select OctoPrint venv
|
||||
folder (e.g. ``~/devel/OctoPrint/venv`` or ``C:\Devel\OctoPrint\venv``)
|
||||
- Right click "src" in project tree, mark as source folder
|
||||
- Add Run/Debug Configuration, select "Python":
|
||||
|
||||
* Name: OctoPrint server
|
||||
* Script: path to ``run`` in the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint/run`` or ``C:\Devel\OctoPrint\run``)
|
||||
* Script parameters: ``--debug``
|
||||
* Project: ``OctoPrint``
|
||||
* Python interpreter: the ``venv`` local virtual environment
|
||||
* Working directory: the OctoPrint checkout folder (e.g. ``~/devel/OctoPrint`` or ``C:\Devel\OctoPrint``)
|
||||
|
||||
.. note::
|
||||
|
||||
Make sure you are running a PyCharm version of 2016.1 or later, or manually fix
|
||||
`a debugger bug contained in earlier versions <https://youtrack.jetbrains.com/issue/PY-18365>`_ or plugin management
|
||||
will not work in your developer install when running OctoPrint from PyCharm in debug mode.
|
||||
environment.rst
|
||||
virtual_printer.rst
|
||||
@@ -0,0 +1,116 @@
|
||||
.. _sec-development-virtual-printer:
|
||||
|
||||
Setting up the virtual printer for debugging
|
||||
============================================
|
||||
|
||||
OctoPrint includes, by default, a virtual printer plugin. This plugin allows you to debug OctoPrint's serial
|
||||
communication without connecting to an actual printer. Furthermore, it is possible to create certain edge conditions
|
||||
that may be hard to reproduce with a real printer.
|
||||
|
||||
.. _sec-development-virtual-printer-enable:
|
||||
|
||||
Enabling the virtual printer
|
||||
----------------------------
|
||||
|
||||
The virtual printer is enabled by editing OctoPrint's config.yaml file. Details on the configuration file can
|
||||
be found in the full :ref:`config.yaml documentation <sec-configuration-config_yaml>`.
|
||||
|
||||
The steps to take are as follows:
|
||||
|
||||
* Find config.yaml in the OctoPrint settings folder. Usually in ``~/.octoprint`` on Linux, in ``%APPDATA%/OctoPrint`` on Windows and in ``~/Library/Application Support/OctoPrint`` on MacOS.
|
||||
* Add or extend the ``devel`` section with:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
devel:
|
||||
virtualPrinter:
|
||||
enabled: true
|
||||
|
||||
* Restart OctoPrint.
|
||||
* In the connection panel, a new option will appear in the Serial Port dropdown labeled ``VIRTUAL``.
|
||||
* Select this option and click ``connect``.
|
||||
* The virtual printer is now active.
|
||||
|
||||
.. _sec-development-virtual-printer-config:
|
||||
|
||||
Virtual printer configuration options
|
||||
-------------------------------------
|
||||
|
||||
The config.yaml file has many configuration options for the virtual printer that allow you to fine-tune its behavior.
|
||||
|
||||
Please see the relevant :ref:`config.yaml section <sec-configuration-config_yaml-devel>` for the full details.
|
||||
|
||||
.. _sec-development-virtual-printer-log:
|
||||
|
||||
Log file
|
||||
--------
|
||||
|
||||
Once activated, the virtual printer will log all serial communication in the ``plugin_virtual_printer_serial.log`` file
|
||||
that can be found in the OctoPrint settings folder.
|
||||
|
||||
.. _sec-development-virtual-printer-debug:
|
||||
|
||||
Debug commands
|
||||
--------------
|
||||
|
||||
You can simulate certain conditions and communications through the terminal tab in OctoPrint's interface.
|
||||
|
||||
All commands start with ``!!DEBUG:`` and are followed by the command you want to execute. For instance, sending
|
||||
``!!DEBUG:action_disconnect`` will disconnect the printer. Sending ``!!DEBUG`` without command will show a help
|
||||
message with all the available commands.
|
||||
|
||||
Action Triggers
|
||||
...............
|
||||
|
||||
``action_pause``
|
||||
Sends a "// action:pause" action trigger to the host.
|
||||
|
||||
``action_resume``
|
||||
Sends a "// action:resume" action trigger to the host.
|
||||
|
||||
``action_disconnect``
|
||||
Sends a "// action:disconnect" action trigger to the host.
|
||||
|
||||
``action_custom <action>[ <parameters>]``
|
||||
Sends a custom "// action:<action> <parameters>" action trigger to the host.
|
||||
|
||||
Communication Errors
|
||||
....................
|
||||
|
||||
``dont_answer``
|
||||
Will not acknowledge the next command.
|
||||
|
||||
``go_awol``
|
||||
Will completely stop replying.
|
||||
|
||||
``trigger_resend_lineno``
|
||||
Triggers a resend error with a line number mismatch
|
||||
|
||||
``trigger_resend_checksum``
|
||||
Triggers a resend error with a checksum mismatch
|
||||
|
||||
``drop_connection``
|
||||
Drops the serial connection
|
||||
|
||||
``prepare_ok <broken ok>``
|
||||
Will cause <broken ok> to be enqueued for use, will be used instead of actual "ok"
|
||||
|
||||
Reply Timing / Sleeping
|
||||
.......................
|
||||
``sleep <int:seconds>``
|
||||
Sleep <seconds> s
|
||||
|
||||
``sleep_after <str:command> <int:seconds>``
|
||||
Sleeps <seconds> s after each execution of <command>
|
||||
|
||||
``sleep_after_next <str:command> <int:seconds>``
|
||||
Sleeps <seconds> s after execution of next <command>
|
||||
|
||||
Misc
|
||||
....
|
||||
|
||||
``help``
|
||||
Show the available commands.
|
||||
|
||||
``send <str:message>``
|
||||
Sends back <message>
|
||||
+91
-9
@@ -110,6 +110,14 @@ ClientClosed
|
||||
|
||||
* ``remoteAddress``: the remote address (IP) of the client that disconnected
|
||||
|
||||
ConnectivityChanged
|
||||
The server's internet connectivity changed
|
||||
|
||||
Payload:
|
||||
|
||||
* ``old``: Old connectivity value (true for online, false for offline)
|
||||
* ``new``: New connectivity value (true for online, false for offline)
|
||||
|
||||
Printer communication
|
||||
---------------------
|
||||
|
||||
@@ -152,7 +160,7 @@ File handling
|
||||
-------------
|
||||
|
||||
Upload
|
||||
A file has been uploaded.
|
||||
A file has been uploaded through the web interface.
|
||||
|
||||
Payload:
|
||||
* ``name``: the file's name
|
||||
@@ -165,19 +173,74 @@ Upload
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
|
||||
FileAdded
|
||||
A file has been added to a storage.
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``name``: the file's name
|
||||
* ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or
|
||||
``["model", "stl"]``
|
||||
|
||||
.. note::
|
||||
|
||||
A copied file triggers this for its new path. A moved file first triggers ``FileRemoved`` for its original
|
||||
path and then ``FileAdded`` for the new one.
|
||||
|
||||
FileRemoved
|
||||
A file has been removed from a storage.
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``name``: the file's name
|
||||
* ``type``: the file's type, a list of the path within the type hierarchy, e.g. ``["machinecode", "gcode"]`` or
|
||||
``["model", "stl"]``
|
||||
|
||||
.. note::
|
||||
|
||||
A moved file first triggers ``FileRemoved`` for its original path and then ``FileAdded`` for the new one.
|
||||
|
||||
FolderAdded
|
||||
A folder has been added to a storage.
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the folders's path within its storage location
|
||||
* ``name``: the folders's name
|
||||
|
||||
.. note::
|
||||
|
||||
A copied folder triggers this for its new path. A moved folder first triggers ``FolderRemoved`` for its original
|
||||
path and then ``FolderAdded`` for the new one.
|
||||
|
||||
FolderRemoved
|
||||
A folder has been removed from a storage.
|
||||
|
||||
Payload:
|
||||
* ``storage``: the storage's identifier
|
||||
* ``path``: the folders's path within its storage location
|
||||
* ``name``: the folders's name
|
||||
|
||||
.. note::
|
||||
|
||||
A moved folder first triggers ``FolderRemoved`` for its original path and then ``FolderAdded`` for the new one.
|
||||
|
||||
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.
|
||||
* ``type``: the type of file list that was modified. Only ``printables`` is supported here. See the deprecation
|
||||
note below.
|
||||
|
||||
.. note::
|
||||
.. deprecated:: 1.2.0
|
||||
|
||||
The ``gcode`` modification type has been superseded by ``printables``. It is currently still available for
|
||||
reasons of backwards compatibility and will also be sent on modification of ``printables``. It will however
|
||||
be removed with 1.4.0.
|
||||
|
||||
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 file has started.
|
||||
@@ -202,7 +265,7 @@ MetadataAnalysisFinished
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the file's origin storage location
|
||||
* ``result``: the analysis result -- this is a python object currently only available for internal use
|
||||
* ``result``: the analysis result -- this is a Python object currently only available for internal use
|
||||
|
||||
.. deprecated:: 1.3.0
|
||||
|
||||
@@ -300,8 +363,18 @@ PrintDone
|
||||
|
||||
Still available for reasons of backwards compatibility. Will be removed with 1.4.0.
|
||||
|
||||
PrintCancelling
|
||||
The print is about to be cancelled.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``name``: the file's name
|
||||
* ``path``: the file's path within its storage location
|
||||
* ``origin``: the origin storage location of the file, either ``local`` or ``sdcard``
|
||||
* ``firmwareError``: the firmware error that caused cancelling the print job, if any
|
||||
|
||||
PrintCancelled
|
||||
The print has been cancelled via the cancel button.
|
||||
The print has been cancelled.
|
||||
|
||||
Payload:
|
||||
|
||||
@@ -422,6 +495,15 @@ PositionUpdate
|
||||
* ``t``: last tool selected *through OctoPrint*
|
||||
* ``f``: last feedrate for move commands ``G0``, ``G1`` or ``G28`` sent *through OctoPrint*
|
||||
|
||||
ToolChange
|
||||
A tool change command was sent to the printer. The payload contains the former current tool index and the
|
||||
new current tool index.
|
||||
|
||||
Payload:
|
||||
|
||||
* ``old``: old tool index
|
||||
* ``new``: new tool index
|
||||
|
||||
Timelapses
|
||||
----------
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ 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``
|
||||
possible to re-run it by editing ``config.yaml`` [#f1]_ and setting ``firstRun``
|
||||
in the ``server`` section and ``enabled`` in the ``accessControl`` section to
|
||||
``true``:
|
||||
|
||||
|
||||
@@ -21,16 +21,20 @@ Action commands are a feature defined for the GCODE based RepRap communication p
|
||||
|
||||
OctoPrint out of the box supports handling of the above mentioned commands:
|
||||
|
||||
cancel
|
||||
When this command is received from the printer, OctoPrint will cancel a current print job like if the
|
||||
"Cancel" button had been clicked.
|
||||
|
||||
pause
|
||||
When this command is received from the printer, OctoPrint will pause streaming of a current print job just like if the
|
||||
When this command is received from the printer, OctoPrint will pause 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
|
||||
When this command is received from the printer, OctoPrint will resume 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.
|
||||
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,30 @@
|
||||
.. _sec-features-atcommands:
|
||||
|
||||
@ Commands
|
||||
==========
|
||||
|
||||
@ commands (also known as host commands elsewhere) are special commands you may include in GCODE files streamed
|
||||
through OctoPrint to your printer or send as part of GCODE scripts, through the Terminal Tab, the API or plugins.
|
||||
Contrary to other commands they will never be sent to the printer but instead trigger functions inside OctoPrint.
|
||||
|
||||
They are always of the form ``@<command>[ <parameters>]``, e.g. ``@pause`` or ``@custom_command with some parameters``.
|
||||
|
||||
Out of the box OctoPrint supports handling of these commands starting with version 1.3.7:
|
||||
|
||||
@cancel
|
||||
OctoPrint will cancel the current print job like if the "Cancel" button had been clicked. This command doesn't
|
||||
take any parameters.
|
||||
|
||||
@abort
|
||||
Same as ``cancel``.
|
||||
|
||||
@pause
|
||||
OctoPrint will pause the current print job just like if the "Pause" button had been clicked. This command doesn't
|
||||
take any parameters.
|
||||
|
||||
@resume
|
||||
OctoPrint will resume the current print job just like if the "Resume" button had been clicked. This command doesn't
|
||||
take any parameters.
|
||||
|
||||
Support for additional commands may be added by plugins by implementing a handler for one of the
|
||||
:ref:`octoprint.comm.protocol.atcommand <sec-plugins-hook-comm-protocol-atcommand-phase>` hooks.
|
||||
@@ -166,6 +166,10 @@ Controls
|
||||
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``.
|
||||
* - ``additionalClasses``
|
||||
- (Optional) Additional classes to apply to the button of a ``command``, ``commands``, ``script`` or ``javascript``
|
||||
control, other than the default ``btn``. Can be used to visually style the button, e.g. set to ``btn-danger`` to
|
||||
turn the button red.
|
||||
* - ``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
|
||||
|
||||
+113
-13
@@ -13,11 +13,19 @@ Unless :ref:`configured otherwise <sec-configuration-config_yaml-folder>`, OctoP
|
||||
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
|
||||
These GCODE scripts are backed by the templating engine Jinja2, 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>`
|
||||
this end, OctoPrint injects some variables into the :ref:`template rendering context <sec-features-gcode_scripts-context>`
|
||||
as described below.
|
||||
|
||||
You can find the docs on the Jinja templating engine as used in OctoPrint at `jinja.octoprint.org <http://jinja.octoprint.org/templates.html>`_.
|
||||
|
||||
.. note::
|
||||
|
||||
Due to backwards compatibility issues with Jinja versions 2.9+, OctoPrint currently only supports Jinja 2.8. For this
|
||||
reason use the template documentation at `jinja.octoprint.org <http://jinja.octoprint.org/templates.html>`_ instead of the
|
||||
documentation of current stable Jinja versions.
|
||||
|
||||
.. _sec-features-gcode_scripts-predefined:
|
||||
|
||||
Predefined Scripts
|
||||
@@ -58,22 +66,44 @@ Context
|
||||
|
||||
All GCODE scripts have access to the following template variables through the template context:
|
||||
|
||||
* ``printer_profile``: The currently selected Printer Profile, including
|
||||
* ``printer_profile``: The currently selected :ref:`Printer Profile <sec-modules-printer-profile>`, including
|
||||
information such as the extruder count, the build volume size, the filament diameter etc.
|
||||
* ``last_position``: Last position reported by the printer via `M114` (might be unset if no `M114` was sent so far!)
|
||||
* ``last_position``: Last position reported by the printer via `M114` (might be unset if no `M114` was sent so far!).
|
||||
Consists of ``x``, ``y``, ``z`` and ``e`` coordinates as received by the printer and tracked values for ``f`` and
|
||||
current tool ``t`` taken from commands sent through OctoPrint. All of these coordinates might be ``None`` if no
|
||||
position could be retrieved from the printer or the values could not be tracked (in case of ``f`` and ``t``)!
|
||||
* ``last_temperature``: Last actual and target temperature reported for all available tools and if available the
|
||||
heated bed. This is a dictionary of key-value pairs. The keys are the indices of the available tools (``0``, ``1``,
|
||||
...) and ``b`` for the heated bed. The values are a dictionary consisting of ``actual`` and ``target`` keys mapped
|
||||
to the corresponding temperature in degrees celsius. Note that not all tools your printer has must necessarily be
|
||||
present here, neither must the heated bed - it depends on whether OctoPrint has values for a tool or the bed. Also
|
||||
note that ``actual`` and ``target`` might be ``None``.
|
||||
* ``script``: An object wrapping the script's type (``gcode``) and name (e.g. ``afterPrintCancelled``) as ``script.type``
|
||||
and ``script.name`` respectively.
|
||||
* ``plugins``: An object containing variables provided by plugins (e.g ``plugins.myplugin.myvariable``)
|
||||
|
||||
There are a couple of additional template variables available for the following specific scripts:
|
||||
There are a few additional template variables available for the following specific scripts:
|
||||
|
||||
* ``afterPrintPaused`` and ``beforePrintResumed``
|
||||
* ``pause_position``: Position reported by the printer via ``M114`` immediately before the print was paused. Consists
|
||||
of ``x``, ``y``, ``z`` and ``e`` coordinates as received by the printer and tracked values for ``f`` and current tool
|
||||
``t`` taken from commands sent through OctoPrint.
|
||||
|
||||
* ``pause_position``: Position reported by the printer via ``M114`` immediately before the print was paused. See
|
||||
``last_position`` above for the structure to expect here.
|
||||
|
||||
**Please note:** This will not be available if you disable
|
||||
"Log position on pause" under Settings > Serial > Advanced options!
|
||||
* ``pause_temperature``: Last known temperature values when the print was paused. See ``last_temperature`` above
|
||||
for the structure to expect here.
|
||||
|
||||
* ``afterPrintCancelled``
|
||||
|
||||
* ``cancel_position``: Position reported by the printer via ``M114`` immediately before the print was cancelled.
|
||||
Consists of ``x``, ``y``, ``z`` and ``e`` coordinates as received by the printer and tracked values for ``f`` and
|
||||
current tool ``t`` taken from commands sent through OctoPrint.
|
||||
See ``last_position`` above for the structure to expect here.
|
||||
|
||||
**Please note:** This will not be available if you disable
|
||||
"Log position on cancel" under Settings > Serial > Advanced options!
|
||||
* ``cancel_temperature``: Last known temperature values when the print was cancelled. See ``last_temperature`` above
|
||||
for the structure to expect here.
|
||||
|
||||
|
||||
.. warning::
|
||||
|
||||
@@ -117,7 +147,7 @@ Out of the box, OctoPrint defaults to the following script setup for ``afterPrin
|
||||
|
||||
;disable all heaters
|
||||
{% snippet 'disable_hotends' %}
|
||||
[% snippet 'disable_bed' %}
|
||||
{% snippet 'disable_bed' %}
|
||||
|
||||
;disable fan
|
||||
M106 S0
|
||||
@@ -145,8 +175,78 @@ As you can see, the ``disable_hotends`` and ``disable_bed`` snippets utilize the
|
||||
extruders and set their temperature to 0, and to also set the bed temperature
|
||||
to 0 if a heated bed is configured.
|
||||
|
||||
.. _sec-features-gcode_scripts-examples:
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. _sec-features-gcode_scripts-examples-more_nifty_pause_and_resume:
|
||||
|
||||
More nifty pause and resume
|
||||
...........................
|
||||
|
||||
If you do not have a multi-extruder setup, aren't printing from SD and have "Log position on pause" enabled under
|
||||
Settings > Serial > Advanced options, the following ``afterPrintPaused`` and
|
||||
``beforePrintResumed`` scripts might be interesting for you. With something like them in place, OctoPrint will move your print head
|
||||
out of the way to a safe rest position (here ``G1 X0 Y0``, you might want to adjust that) on pause and move it back
|
||||
to the persisted pause position on resume, making sure to also reset the extruder and feedrate.
|
||||
|
||||
.. code-block:: jinja
|
||||
:caption: ``afterPrintPaused`` script
|
||||
|
||||
{% if pause_position.x is not none %}
|
||||
; relative XYZE
|
||||
G91
|
||||
M83
|
||||
|
||||
; retract filament, move Z slightly upwards
|
||||
G1 Z+5 E-5 F4500
|
||||
|
||||
; absolute XYZE
|
||||
M82
|
||||
G90
|
||||
|
||||
; move to a safe rest position, adjust as necessary
|
||||
G1 X0 Y0
|
||||
{% endif %}
|
||||
|
||||
.. code-block:: jinja
|
||||
:caption: ``beforePrintResumed`` script
|
||||
|
||||
{% if pause_position.x is not none %}
|
||||
; relative extruder
|
||||
M83
|
||||
|
||||
; prime nozzle
|
||||
G1 E-5 F4500
|
||||
G1 E5 F4500
|
||||
G1 E5 F4500
|
||||
|
||||
; absolute E
|
||||
M82
|
||||
|
||||
; absolute XYZ
|
||||
G90
|
||||
|
||||
; reset E
|
||||
G92 E{{ pause_position.e }}
|
||||
|
||||
; move back to pause position XYZ
|
||||
G1 X{{ pause_position.x }} Y{{ pause_position.y }} Z{{ pause_position.z }} F4500
|
||||
|
||||
; reset to feed rate before pause if available
|
||||
{% if pause_position.f is not none %}G1 F{{ pause_position.f }}{% endif %}
|
||||
{% endif %}
|
||||
|
||||
.. warning::
|
||||
|
||||
As mentioned in the warning above and the description of the example itself, this will *only* work if you are
|
||||
not printing from SD and not using multiple extruders since OctoPrint will only then be able to track the
|
||||
necessary position data and print parameters due to firmware limitations.
|
||||
|
||||
.. seealso::
|
||||
|
||||
`Jinja Template Designer Documentation <http://jinja.pocoo.org/docs/dev/templates/>`_
|
||||
`Jinja Template Designer Documentation <http://jinja.octoprint.org/templates.html>`_
|
||||
Jinja's Template Designer Documentation describes the syntax and semantics of the template language used
|
||||
also by OctoPrint's GCODE scripts.
|
||||
also by OctoPrint's GCODE scripts. Linked here are the docs for Jinja 2.8.1, which OctoPrint still
|
||||
relies on for backwards compatibility reasons.
|
||||
@@ -15,4 +15,6 @@ Features
|
||||
custom_controls.rst
|
||||
gcode_scripts.rst
|
||||
action_commands.rst
|
||||
atcommands.rst
|
||||
plugins.rst
|
||||
safemode.rst
|
||||
@@ -11,6 +11,16 @@ Right now plugins can be used to extend OctoPrint's web interface, to execute sp
|
||||
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.
|
||||
|
||||
.. note::
|
||||
|
||||
Since a plugin might not function properly and cause issues that are hard to diagnose or outright disrupt server
|
||||
functionality, you might want to be able to start OctoPrint without any third party plugins enabled. This is also
|
||||
very important when reporting bugs in OctoPrint, to ensure that what you are observing is actually a bug in
|
||||
OctoPrint and not in any of your installed third party plugins.
|
||||
|
||||
To do that, OctoPrint has a built-in safe mode that disables all plugins not shipped as part of OctoPrint. You can
|
||||
read more on how to enable that :ref:`here <sec-features-safemode>`.
|
||||
|
||||
.. _sec-features-plugins-available:
|
||||
|
||||
Finding Plugins
|
||||
@@ -36,7 +46,7 @@ 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]_.
|
||||
``<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
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
.. _sec-features-safemode:
|
||||
|
||||
*********
|
||||
Safe mode
|
||||
*********
|
||||
|
||||
With the advent of support for plugins in OctoPrint, it quickly became apparent that some of the bugs
|
||||
reported on OctoPrint's bug tracker were actually bugs with installed third party plugins instead of
|
||||
OctoPrint itself.
|
||||
|
||||
To allow an easier identification of these cases, OctoPrint 1.3.0 introduced safe mode. Starting
|
||||
OctoPrint in safe mode disables all plugins that are not bundled with OctoPrint, allowing to easier
|
||||
identify most cases where a third party plugin is the culprit of an observed issue.
|
||||
|
||||
Additionally, OctoPrint allows uninstalling plugins in this mode, allowing recovery from cases where
|
||||
a third party plugin causes the server to not start up or the web interface to not render or function
|
||||
correctly anymore.
|
||||
|
||||
Whenever reporting an issue with OctoPrint, please always attempt to reproduce it in safe mode as well to
|
||||
ensure it really is an issue in OctoPrint itself and now caused by one of your installed third party plugins.
|
||||
|
||||
.. _sec-features-safemode-how:
|
||||
|
||||
How to start OctoPrint in safe mode
|
||||
===================================
|
||||
|
||||
There exist three ways to start OctoPrint in safe mode:
|
||||
|
||||
* by selecting "Restart OctoPrint in safe mode" from the "System" menu,
|
||||
if the "Restart OctoPrint" server command has been correctly configured (since OctoPrint 1.3.2,
|
||||
see :numref:`fig-features-safemode-systemmenu`)
|
||||
* by setting the flag ``server.startOnceInSafeMode`` in :ref:`config.yaml <sec-configuration-config_yaml>`
|
||||
to ``true`` and restarting. To set this flag you have the following options:
|
||||
|
||||
* from command line run ``octoprint safemode`` (since OctoPrint 1.3.6)
|
||||
* from command line run ``octoprint config set --bool server.startOnceInSafeMode true`` (fixed in OctoPrint 1.3.6)
|
||||
* use the `Yamlpatcher Plugin <http://plugins.octoprint.org/plugins/yamlpatcher/>`_ and enter & apply the patch
|
||||
``[["set", "server.startOnceInSafeMode", true]]``
|
||||
* edit ``config.yaml`` manually with a text editor, locate the ``server`` block if it already exists or create it
|
||||
if it doesn't and add ``startOnceInSafeMode: true`` to it:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# ...
|
||||
server:
|
||||
startOnceInSafeMode: true
|
||||
# ...
|
||||
|
||||
Please also refer to the :ref:`YAML primer <sec-configuration-yaml>`.
|
||||
* by starting OctoPrint with the command line parameter ``--safe``, e.g. ``octoprint serve --safe`` (don't forget to
|
||||
shutdown OctoPrint first before doing this)
|
||||
|
||||
The last two options will have OctoPrint enable safe mode only for the next server start - once you
|
||||
restart OctoPrint again, safe mode will be disabled again.
|
||||
|
||||
.. note::
|
||||
|
||||
**OctoPi users**: For you that's ``~/oprint/bin/octoprint`` wherever it says just ``octoprint``.
|
||||
|
||||
.. _fig-features-safemode-systemmenu:
|
||||
.. figure:: ../images/features-safemode-systemmenu.png
|
||||
:align: center
|
||||
:alt: "Restart OctoPrint in safe mode" in the "System" menu
|
||||
|
||||
"Restart OctoPrint in safe mode" in the "System" menu
|
||||
|
||||
.. _sec-features-safemode-differences:
|
||||
|
||||
Differences of safe mode vs normal operation mode
|
||||
=================================================
|
||||
|
||||
When OctoPrint is running in safe mode the following changes to its normal operation mode apply:
|
||||
|
||||
* OctoPrint will not enable any of the installed third party plugins. OctoPrint considers all plugins third
|
||||
party plugins that do not ship with OctoPrint's sources, so any plugins installed either via `pip` or
|
||||
into OctoPrint's plugin folder at ``~/.octoprint/plugins`` (Linux), ``%APPDATA%/OctoPrint`` (Windows) and
|
||||
``~/Library/Application Support/OctoPrint`` (MacOS).
|
||||
* OctoPrint will still allow to uninstall third party plugins through the built-in Plugin Manager.
|
||||
* OctoPrint will still allow to disable (bundled) plugins that are still enabled.
|
||||
* OctoPrint will not allow to enable third party plugins.
|
||||
* OctoPrint's web interface will display a notification to remind you that it is running in
|
||||
safe mode.
|
||||
|
||||
.. _fig-features-safemode-notification:
|
||||
.. figure:: ../images/features-safemode-notification.png
|
||||
:align: center
|
||||
:alt: Safe mode notification
|
||||
|
||||
Safe mode notification
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
+18
-3
@@ -6,9 +6,24 @@ Welcome to OctoPrint's documentation!
|
||||
: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!
|
||||
OctoPrint provides a snappy web interface for controlling consumer 3D printers. 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 <https://octoprint.org/>`_.
|
||||
|
||||
The community forum is available at `discourse.octoprint.org <https://discourse.octoprint.org/>`_.
|
||||
|
||||
The FAQ can be accessed by following `faq.octoprint.org <https://faq.octoprint.org/>`_.
|
||||
|
||||
The official plugin repository can be reached at `plugins.octoprint.org <https://plugins.octoprint.org/>`_.
|
||||
|
||||
OctoPrint's development wouldn't be possible without the `financial support by its community <https://octoprint.org/support-octoprint/>`_.
|
||||
If you enjoy OctoPrint, please consider becoming a regular supporter!
|
||||
|
||||
.. note::
|
||||
|
||||
This documentation currently focuses primarily on developers and less on end users. If you are interested in
|
||||
helping to change this, please get in touch `on the forum <https://discourse.octoprint.org/>`_!
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
+100
-42
@@ -1,29 +1,45 @@
|
||||
.. sec-jsclientlib-base:
|
||||
.. _sec-jsclientlib-base:
|
||||
|
||||
:mod:`OctoPrint`
|
||||
----------------
|
||||
:mod:`OctoPrintClient`
|
||||
----------------------
|
||||
|
||||
.. js:data:: OctoPrint.options
|
||||
.. js:class:: OctoPrintClient([options])
|
||||
|
||||
The client library's options.
|
||||
Instantiates a new instance of the client library. Note that by default there's always an instance registered
|
||||
globally called ``OctoPrint``.
|
||||
|
||||
``OctoPrint.options.apikey``
|
||||
:param object options: An optional object of options to set :js:attr:`OctoPrintClient.options` to.
|
||||
|
||||
.. js:attribute:: OctoPrintClient.options
|
||||
|
||||
The client library instance's options. The following keys are currently supported:
|
||||
|
||||
``apikey``
|
||||
The API Key to use for requests against the OctoPrint API. Should usually be
|
||||
the anonymous UI API Key provided on the socket.
|
||||
|
||||
``OctoPrint.options.baseurl``
|
||||
``baseurl``
|
||||
The base URL of the OctoPrint API
|
||||
|
||||
``OctoPrint.options.locale``
|
||||
``locale``
|
||||
The locale to set in ``X-Locale`` headers on API requests. Useful for API
|
||||
endpoints that might return localized content.
|
||||
|
||||
.. js:data:: OctoPrint.plugins
|
||||
.. js:attribute:: OctoPrintClient.plugins
|
||||
|
||||
Registration of client library components provided by plugins.
|
||||
|
||||
OctoPrint plugins should always register their library exports
|
||||
in this object, using their plugin identifier as key.
|
||||
OctoPrint plugins should always register their client classes here using their plugin identifier as key via
|
||||
:js:func:`OctoPrintClient.registerPluginComponent`.
|
||||
|
||||
.. note::
|
||||
|
||||
The registration mechanism has changed slightly with OctoPrint 1.3.2 due to an otherwise unsolvable issue with
|
||||
allowing multiple clients to exist concurrently and still keeping the existing architecture intact.
|
||||
|
||||
The old mechanism works fine as long as you are only planning to offer your plugin client implementation on the
|
||||
default client instance ``OctoPrint``, however if you also want to support additional clients you'll need to
|
||||
use the implementation and registration approach as described below.
|
||||
|
||||
**Example:**
|
||||
|
||||
@@ -31,19 +47,26 @@
|
||||
|
||||
(function (global, factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define(["OctoPrint"], factory);
|
||||
define(["OctoPrintClient"], factory);
|
||||
} else {
|
||||
factory(window.OctoPrint);
|
||||
factory(window.OctoPrintClient);
|
||||
}
|
||||
})(window || this, function(OctoPrint) {
|
||||
var exports = {};
|
||||
})(window || this, function(OctoPrintClient) {
|
||||
var MyPluginClient = function(base) {
|
||||
this.base = base;
|
||||
};
|
||||
|
||||
// fill exports
|
||||
MyPluginClient.prototype.someFunction = function() {
|
||||
// do something
|
||||
};
|
||||
|
||||
OctoPrint.plugins.myplugin = exports
|
||||
// further define API
|
||||
|
||||
OctoPrintClient.registerPluginComponent("myplugin", MyPluginClient);
|
||||
return MyPluginClient;
|
||||
});
|
||||
|
||||
.. js:function:: OctoPrint.getBaseUrl()
|
||||
.. js:function:: OctoPrintClient.getBaseUrl()
|
||||
|
||||
Returns the canonical base URL to use for OctoPrint's API. Uses the current value of
|
||||
:js:data:`OctoPrint.options.baseurl <OctoPrint.options>`. If that doesn't end in a ``/``,
|
||||
@@ -51,7 +74,7 @@
|
||||
|
||||
:returns string: The base url to use to access OctoPrint's API.
|
||||
|
||||
.. js:function:: OctoPrint.getRequestHeaders(additional)
|
||||
.. js:function:: OctoPrintClient.getRequestHeaders(additional)
|
||||
|
||||
Generates a dictionary of HTTP headers to use for API requests against OctoPrint with all
|
||||
necessary headers and any additionally provided ones.
|
||||
@@ -62,7 +85,7 @@
|
||||
:param object additional: Additional headers to add to the request.
|
||||
:returns object: HTTP headers to use for requests.
|
||||
|
||||
.. js:function:: OctoPrint.ajax(method, url, opts)
|
||||
.. js:function:: OctoPrintClient.ajax(method, url, opts)
|
||||
|
||||
Performs an AJAX request against the OctoPrint API, utilizing `jQuery's own ajax function <http://api.jquery.com/jquery.ajax/>`_.
|
||||
|
||||
@@ -87,7 +110,7 @@
|
||||
:param object opts: Additional options to use for the request, see above for details (optional)
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.ajaxWithData(method, url, data, opts)
|
||||
.. js:function:: OctoPrintClient.ajaxWithData(method, url, data, opts)
|
||||
|
||||
Performs an AJAX request against the OctoPrint API, including the provided ``data`` in the body of the request.
|
||||
|
||||
@@ -96,10 +119,10 @@
|
||||
:param string method: The HTTP method to use for the request (optional)
|
||||
:param string url: The URL to perform the request against (optional)
|
||||
:param object data: The data to send in the request body (optional)
|
||||
:param object opts: Additonal options to use for the request (optional)
|
||||
:param object opts: Additional options to use for the request (optional)
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.get(url, opts)
|
||||
.. js:function:: OctoPrintClient.get(url, opts)
|
||||
|
||||
Performs a ``GET`` request against ``url``.
|
||||
|
||||
@@ -116,7 +139,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.getWithQuery(url, data, opts)
|
||||
.. js:function:: OctoPrintClient.getWithQuery(url, data, opts)
|
||||
|
||||
Performs a ``GET`` request against ``url`` using the provided ``data`` as URL query.
|
||||
|
||||
@@ -132,7 +155,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.post(url, data, opts)
|
||||
.. js:function:: OctoPrintClient.post(url, data, opts)
|
||||
|
||||
Performs a ``POST`` request against ``url`` using the provided ``data`` as request body.
|
||||
|
||||
@@ -152,7 +175,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.postJson(url, data, opts)
|
||||
.. js:function:: OctoPrintClient.postJson(url, data, opts)
|
||||
|
||||
Performs a ``POST`` request against ``url`` using the provided ``data`` object as request body
|
||||
after serializing it to JSON.
|
||||
@@ -172,33 +195,33 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.put(url, data, opts)
|
||||
.. js:function:: OctoPrintClient.put(url, data, opts)
|
||||
|
||||
Performs ``PUT`` request against ``url`` using the provided ``data`` as request body.
|
||||
|
||||
See :js:func:`OctoPrint.post` for details.
|
||||
|
||||
.. js:function:: OctoPrint.putJson(url, data, opts)
|
||||
.. js:function:: OctoPrintClient.putJson(url, data, opts)
|
||||
|
||||
Performs ``PUT`` request against ``url`` using the provided ``data`` as request body after
|
||||
serializing it to JSON.
|
||||
|
||||
See :js:func:`OctoPrint.postJson` for details.
|
||||
|
||||
.. js:function:: OctoPrint.patch(url, data, opts)
|
||||
.. js:function:: OctoPrintClient.patch(url, data, opts)
|
||||
|
||||
Performs ``PATCH`` request against ``url`` using the provided ``data`` as request body.
|
||||
|
||||
See :js:func:`OctoPrint.post` for details.
|
||||
|
||||
.. js:function:: OctoPrint.patchJson(url, data, opts)
|
||||
.. js:function:: OctoPrintClient.patchJson(url, data, opts)
|
||||
|
||||
Performs ``PATCH`` request against ``url`` using the provided ``data`` as request body after
|
||||
serializing it to JSON.
|
||||
|
||||
See :js:func:`OctoPrint.postJson` for details.
|
||||
|
||||
.. js:function:: OctoPrint.delete(url, opts)
|
||||
.. js:function:: OctoPrintClient.delete(url, opts)
|
||||
|
||||
Performs a ``DELETE`` request against ``url``.
|
||||
|
||||
@@ -206,7 +229,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.download(url, opts)
|
||||
.. js:function:: OctoPrintClient.download(url, opts)
|
||||
|
||||
Downloads a file from ``url``, returning the response body as data type ``text``.
|
||||
|
||||
@@ -218,7 +241,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.upload(url, file, filename, additional)
|
||||
.. js:function:: OctoPrintClient.upload(url, file, filename, additional)
|
||||
|
||||
Uploads a ``file`` to ``url`` using a ``multipart/form-data`` ``POST`` request.
|
||||
|
||||
@@ -286,7 +309,7 @@
|
||||
:param string filename: An optional file name to use for the upload
|
||||
:param object additional: An optional object of additional key/value pairs to set on the uploaded form data
|
||||
|
||||
.. js:function:: OctoPrint.issueCommand(url, command, payload, opts)
|
||||
.. js:function:: OctoPrintClient.issueCommand(url, command, payload, opts)
|
||||
|
||||
Issues a command against an OctoPrint command API endpoint.
|
||||
|
||||
@@ -318,7 +341,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.getSimpleApiUrl(plugin)
|
||||
.. js:function:: OctoPrintClient.getSimpleApiUrl(plugin)
|
||||
|
||||
Returns the proper URL for the endpoint of a :class:`~octoprint.plugin.SimpleApiPlugin`, based on the
|
||||
plugin identifier.
|
||||
@@ -333,7 +356,7 @@
|
||||
:param string plugin: The identifier of the plugin for which to return the URL
|
||||
:returns string: The URL to use as endpoint
|
||||
|
||||
.. js:function:: OctoPrint.simpleApiGet(plugin, opts)
|
||||
.. js:function:: OctoPrintClient.simpleApiGet(plugin, opts)
|
||||
|
||||
Performs a ``GET`` request against the endpoint of a :class:`~octoprint.plugin.SimpleApiPlugin` with
|
||||
identifier ``plugin``.
|
||||
@@ -349,7 +372,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.simpleApiCommand(plugin, command, payload, opts)
|
||||
.. js:function:: OctoPrintClient.simpleApiCommand(plugin, command, payload, opts)
|
||||
|
||||
Performs the API command ``command`` against the endpoint of a :class:`~octoprint.plugin.SimpleApiPlugin` with
|
||||
identifier ``plugin``, including the optional ``payload``.
|
||||
@@ -370,7 +393,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.getBlueprintUrl(plugin)
|
||||
.. js:function:: OctoPrintClient.getBlueprintUrl(plugin)
|
||||
|
||||
Returns the proper base URL for blueprint endpoints of a :class:`~octoprint.plugin.BlueprintPlugin` with
|
||||
identifier ``plugin``.
|
||||
@@ -382,11 +405,15 @@
|
||||
// prints "plugin/myplugin/"
|
||||
console.log(OctoPrint.getBlueprintUrl("myplugin"));
|
||||
|
||||
.. js:function:: OctoPrint.createRejectedDeferred()
|
||||
.. js:function:: OctoPrintClient.createRejectedDeferred()
|
||||
|
||||
Static method.
|
||||
|
||||
Shortcut for creating a rejected `jQuery Deferred <http://api.jquery.com/category/deferred-object/>`_.
|
||||
|
||||
.. js:function:: OctoPrint.createCustomException(name)
|
||||
.. js:function:: OctoPrintClient.createCustomException(name)
|
||||
|
||||
Static method.
|
||||
|
||||
Creates a custom exception class. ``name`` may be either a function in which case it will be used
|
||||
as constructor for the new exception class, or a string, in which case a constructor with proper
|
||||
@@ -397,9 +424,40 @@
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
MyCustomException = OctoPrint.createCustomException("MyCustomException");
|
||||
MyCustomException = OctoPrintClient.createCustomException("MyCustomException");
|
||||
throw new MyCustomException("Something went horribly wrong!");
|
||||
|
||||
.. js:class:: OctoPrint.InvalidArgumentError
|
||||
.. js:function:: OctoPrintClient.registerPluginComponent(identifier, clientClass)
|
||||
|
||||
Static method.
|
||||
|
||||
Registers the plugin client component ``clientClass`` under the name ``identifier`` on the
|
||||
:js:attr:`OctoPrintClient.plugins` registry.
|
||||
|
||||
``clientClass`` must have a constructor that follows the signature ``ClientClass(base)`` and in which it sets
|
||||
the attribute ``base`` on the instance to:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var MyPluginClient = function(base) {
|
||||
this.base = base;
|
||||
}
|
||||
|
||||
Each :js:class:`OctoPrintClient` will create its own instance of registered plugin classes and make them available
|
||||
under :js:attr:`OctoPrintClient.plugins`. It will inject itself into those instances in order to allow plugin
|
||||
clients to access its functionality via ``this.base``:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
MyPluginClient.prototype.doSomething = function(data, opts) {
|
||||
return this.base.simpleApiCommand("myplugin", "doSomething", data, opts);
|
||||
};
|
||||
|
||||
:param string identifier: The identifier of the plugin for which ``clientClass`` is the client
|
||||
:param class clientClass: The client class to register. Constructor must follow the signature ``ClientClass(base)``
|
||||
where ``base`` will be assigned to the instance as ``this.base`` and be the :js:class:`OctoPrintClient`
|
||||
instance to use for API calls etc via ``this.base``.
|
||||
|
||||
.. js:class:: OctoPrintClient.InvalidArgumentError
|
||||
|
||||
Exception to use when functions are called with invalid arguments.
|
||||
@@ -1,9 +1,9 @@
|
||||
.. sec-jsclientlib-browser:
|
||||
.. _sec-jsclientlib-browser:
|
||||
|
||||
:mod:`OctoPrint.browser`
|
||||
------------------------
|
||||
:mod:`OctoPrintClient.browser`
|
||||
------------------------------
|
||||
|
||||
.. js:function:: OctoPrint.browser.login(username, password, remember, opts)
|
||||
.. js:function:: OctoPrintClient.browser.login(username, password, remember, opts)
|
||||
|
||||
Logs the browser into OctoPrint, using the provided ``username`` and
|
||||
``password`` as credentials. If ``remember`` is set to ``true``, the session
|
||||
@@ -24,7 +24,7 @@
|
||||
:param object opts: Additional request options
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.browser.passiveLogin(opts)
|
||||
.. js:function:: OctoPrintClient.browser.passiveLogin(opts)
|
||||
|
||||
Tries to perform a passive login into OctoPrint, using existing session data
|
||||
stored in the browser's cookies.
|
||||
@@ -32,7 +32,7 @@
|
||||
:param object opts: Additional request options
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.browser.logout(opts)
|
||||
.. js:function:: OctoPrintClient.browser.logout(opts)
|
||||
|
||||
Logs the browser out of OctoPrint.
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.. sec-jsclientlib-connection:
|
||||
.. _sec-jsclientlib-connection:
|
||||
|
||||
:mod:`OctoPrint.connection`
|
||||
---------------------------
|
||||
:mod:`OctoPrintClient.connection`
|
||||
---------------------------------
|
||||
|
||||
.. js:function:: OctoPrint.connection.getSettings(opts)
|
||||
.. js:function:: OctoPrintClient.connection.getSettings(opts)
|
||||
|
||||
Retrieves the available connection options for connection to a printer.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.connection.connect(data, opts)
|
||||
.. js:function:: OctoPrintClient.connection.connect(data, opts)
|
||||
|
||||
Connects to the printer, optionally using the provided connection ``data`` as parameters.
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.connection.disconnect(opts)
|
||||
.. js:function:: OctoPrintClient.connection.disconnect(opts)
|
||||
|
||||
Disconnects from the printer.
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.connection.fakeAck(opts)
|
||||
.. js:function:: OctoPrintClient.connection.fakeAck(opts)
|
||||
|
||||
Triggers a fake acknowledgement (``ok``) on the printer.
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
.. sec-jsclientlib-control:
|
||||
.. _sec-jsclientlib-control:
|
||||
|
||||
:mod:`OctoPrint.control`
|
||||
------------------------
|
||||
:mod:`OctoPrintClient.control`
|
||||
------------------------------
|
||||
|
||||
.. js:function:: OctoPrint.control.getCustomControls(opts)
|
||||
.. js:function:: OctoPrintClient.control.getCustomControls(opts)
|
||||
|
||||
Retrieves the defined custom controls from the server.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.control.sendGcode(commands, opts)
|
||||
.. js:function:: OctoPrintClient.control.sendGcode(commands, opts)
|
||||
|
||||
Sends the provided ``commands`` to the printer.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.control.sendGcodeWithParameters(commands, parameters, opts)
|
||||
.. js:function:: OctoPrintClient.control.sendGcodeWithParameters(commands, parameters, opts)
|
||||
|
||||
Sends the provided ``commands`` to the printer, replacing contained placeholders with
|
||||
the provided ``parameters`` first.
|
||||
@@ -34,7 +34,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.control.sendGcodeScript(script, context, opts)
|
||||
.. js:function:: OctoPrintClient.control.sendGcodeScript(script, context, opts)
|
||||
|
||||
Sends the provided ``script`` to the printer, enhancing the template with the
|
||||
specified ``context``.
|
||||
@@ -44,7 +44,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.control.sendGcodeScriptWithParameters(script, context, parameters, opts)
|
||||
.. js:function:: OctoPrintClient.control.sendGcodeScriptWithParameters(script, context, parameters, opts)
|
||||
|
||||
Sends the provided ``script`` to the printer, enhancing the template with the
|
||||
specified ``context`` and ``parameters``.
|
||||
|
||||
+16
-16
@@ -1,9 +1,9 @@
|
||||
.. sec-jsclientlib-files:
|
||||
.. _sec-jsclientlib-files:
|
||||
|
||||
:mod:`OctoPrint.files`
|
||||
----------------------
|
||||
:mod:`OctoPrintClient.files`
|
||||
----------------------------
|
||||
|
||||
.. js:function:: OctoPrint.files.get(location, filename, opts)
|
||||
.. js:function:: OctoPrintClient.files.get(location, filename, opts)
|
||||
|
||||
Retrieves information about the file ``filename`` at ``location``.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.list(recursively, opts)
|
||||
.. js:function:: OctoPrintClient.files.list(recursively, opts)
|
||||
|
||||
Retrieves a list of all files from the server.
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.listForLocation(location, recursively, opts)
|
||||
.. js:function:: OctoPrintClient.files.listForLocation(location, recursively, opts)
|
||||
|
||||
Retrieves a list of all files stored at the specified ``location`` from the server.
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.select(location, path, print, opts)
|
||||
.. js:function:: OctoPrintClient.files.select(location, path, print, opts)
|
||||
|
||||
Selects a file at ``location`` named ``filename`` for printing. If ``print`` is supplied and
|
||||
truthy, also starts printing the file immediately.
|
||||
@@ -86,7 +86,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.slice(location, path, parameters, opts)
|
||||
.. js:function:: OctoPrintClient.files.slice(location, path, parameters, opts)
|
||||
|
||||
Slices a file at ``location`` called ``filename``, using the supplied slice command ``parameters``.
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.delete(location, path, opts)
|
||||
.. js:function:: OctoPrintClient.files.delete(location, path, opts)
|
||||
|
||||
Deletes the file or folder at ``location`` and ``path``.
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.copy(location, path, destination, opts)
|
||||
.. js:function:: OctoPrintClient.files.copy(location, path, destination, opts)
|
||||
|
||||
Copies file or folder ``path`` on ``location`` to new parent folder ``destination`` on ``location``.
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.move(location, filename, destination, opts)
|
||||
.. js:function:: OctoPrintClient.files.move(location, filename, destination, opts)
|
||||
|
||||
Moves file or folder ``path`` on ``location`` to new parent folder ``destination`` on ``location``.
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.createFolder(location, name, path, opts)
|
||||
.. js:function:: OctoPrintClient.files.createFolder(location, name, path, opts)
|
||||
|
||||
Creates a new folder ``name`` on ``location``. If ``path`` is provided and not empty the folder
|
||||
will be created as a new child of it.
|
||||
@@ -173,7 +173,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.upload(location, file, data)
|
||||
.. js:function:: OctoPrintClient.files.upload(location, file, data)
|
||||
|
||||
Uploads a ``file`` to the specified ``location``.
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
:param object or string file: The file to upload, see :js:func:`OctoPrint.upload` for more details
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.download(location, path, opts)
|
||||
.. js:function:: OctoPrintClient.files.download(location, path, opts)
|
||||
|
||||
Downloads the file at ``path`` in ``location``.
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.files.pathForEntry(entry)
|
||||
.. js:function:: OctoPrintClient.files.pathForEntry(entry)
|
||||
|
||||
Utility function to retrieve the path within its location for a given ``entry``.
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
:param object entry: The entry object for which to retrieve the path
|
||||
:returns string: The path of the entry within its location
|
||||
|
||||
.. js:function:: OctoPrint.files.entryForPath(path, root)
|
||||
.. js:function:: OctoPrintClient.files.entryForPath(path, root)
|
||||
|
||||
Utility function to retrieve an entry by its ``path`` based on an entry tree provided by its
|
||||
``root``.
|
||||
|
||||
@@ -14,7 +14,7 @@ If you are using it from a web page hosted on OctoPrint as a Jinja2 template, yo
|
||||
methods to embed it instead of manually entering the URL, in order to have OctoPrint take care of setting the
|
||||
correct URL prefix:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: html+jinja
|
||||
|
||||
<!--
|
||||
full client library or all individual files, depending
|
||||
@@ -32,10 +32,10 @@ correct URL prefix:
|
||||
-->
|
||||
<script type="text/javascript" src="{{ url_for("static", filename="js/app/client/<component>.js") }}"></script>
|
||||
|
||||
Regardless of which way you use to include the library, you'll also need to make sure you included JQuery and lodash,
|
||||
Regardless of which way you use to include the library, you'll also need to make sure you included jQuery and lodash,
|
||||
because the library depends on those to be available (as ``$`` and ``_``). You can embed those like this:
|
||||
|
||||
.. code-block:: html
|
||||
.. code-block:: html+jinja
|
||||
|
||||
<script src="{{ url_for("static", filename="js/lib/jquery/jquery.min.js") }}"></script>
|
||||
<script src="{{ url_for("static", filename="js/lib/lodash.min.js") }}"></script>
|
||||
@@ -43,6 +43,41 @@ because the library depends on those to be available (as ``$`` and ``_``). You c
|
||||
Note that all components depend on the ``base`` component to be present, so if you are only including a select
|
||||
number of components, make sure to at the very least include that one to be able to utilize the client.
|
||||
|
||||
When you import the client library as described above, a global variable ``OctoPrint`` will become available, which is
|
||||
a prepared instance of the ``OctoPrintClient`` class the library assembles from registered components. You can directly
|
||||
use that singular ``OctoPrint`` instance if you only need to talk to one OctoPrint server:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.options.baseurl = "http://example.com/octoprint/"
|
||||
OctoPrint.options.apikey = "apikey";
|
||||
|
||||
OctoPrint.files.list()
|
||||
.done(function(response) {
|
||||
// do something with the response
|
||||
});
|
||||
|
||||
If you want to access multiple servers, you should however instead instantiate your own clients. You can provide the
|
||||
connection options (``baseurl`` and ``apikey``) directly in the constructor or set them later:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
var client1 = new OctoPrintClient({baseurl: "http://example.com/octoprint1/", apikey: "apikey1"});
|
||||
|
||||
var client2 = new OctoPrintClient();
|
||||
client2.options.baseurl = "http://example.com/octoprint2/";
|
||||
client2.options.apikey = "apikey2";
|
||||
|
||||
client1.files.list()
|
||||
.done(function(response) {
|
||||
// do something with the response for server 1
|
||||
});
|
||||
|
||||
client2.files.list()
|
||||
.done(function(response) {
|
||||
// do something with the response for server 2
|
||||
});
|
||||
|
||||
.. seealso::
|
||||
|
||||
`OctoPrint-ForceLogin <https://github.com/OctoPrint/OctoPrint-ForceLogin>`_
|
||||
|
||||
+11
-11
@@ -1,9 +1,9 @@
|
||||
.. sec-jsclientlib-job:
|
||||
.. _sec-jsclientlib-job:
|
||||
|
||||
:mod:`OctoPrint.job`
|
||||
--------------------
|
||||
:mod:`OctoPrintClient.job`
|
||||
--------------------------
|
||||
|
||||
.. js:function:: OctoPrint.job.get(opts)
|
||||
.. js:function:: OctoPrintClient.job.get(opts)
|
||||
|
||||
Retrieves information about the current job.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.job.start(opts)
|
||||
.. js:function:: OctoPrintClient.job.start(opts)
|
||||
|
||||
Starts the current job.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.job.cancel(opts)
|
||||
.. js:function:: OctoPrintClient.job.cancel(opts)
|
||||
|
||||
Cancels the current job.
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.job.restart(opts)
|
||||
.. js:function:: OctoPrintClient.job.restart(opts)
|
||||
|
||||
Restarts the current job. This is equivalent to cancelling and immediately restarting
|
||||
the job.
|
||||
@@ -53,7 +53,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.job.pause(opts)
|
||||
.. js:function:: OctoPrintClient.job.pause(opts)
|
||||
|
||||
Pauses the current job if it's running, does nothing if it's already paused.
|
||||
|
||||
@@ -62,16 +62,16 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.job.resume(opts)
|
||||
.. js:function:: OctoPrintClient.job.resume(opts)
|
||||
|
||||
Resumes the current job if it's currently pause, does nothing if it's running.
|
||||
Resumes the current job if it's currently paused, does nothing if it's running.
|
||||
|
||||
See :ref:`Issue a job command <sec-api-jobs-command>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.job.togglePause(opts)
|
||||
.. js:function:: OctoPrintClient.job.togglePause(opts)
|
||||
|
||||
Resumes a paused and pauses a running job.
|
||||
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
.. sec-jsclientlib-languages:
|
||||
.. _sec-jsclientlib-languages:
|
||||
|
||||
:mod:`OctoPrint.languages`
|
||||
--------------------------
|
||||
:mod:`OctoPrintClient.languages`
|
||||
--------------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
All methods here require that the used API token or the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrint.languages.list(opts)
|
||||
.. js:function:: OctoPrintClient.languages.list(opts)
|
||||
|
||||
Retrieves a list of available language packs.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.languages.upload(file)
|
||||
.. js:function:: OctoPrintClient.languages.upload(file)
|
||||
|
||||
Uploads a language pack.
|
||||
|
||||
:param object or string file: The file to upload, see :js:func:`OctoPrint.upload` for more details
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.languages.delete(locale, pack, opts)
|
||||
.. js:function:: OctoPrintClient.languages.delete(locale, pack, opts)
|
||||
|
||||
Deletes the language pack ``pack`` for the specified locale ``locale``.
|
||||
|
||||
|
||||
@@ -1,39 +1,11 @@
|
||||
.. sec-jsclientlib-logs:
|
||||
.. _sec-jsclientlib-logs:
|
||||
|
||||
:mod:`OctoPrint.logs`
|
||||
---------------------
|
||||
:mod:`OctoPrintClient.logs`
|
||||
---------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrint.logs.list(opts)
|
||||
|
||||
Retrieves a list of log files.
|
||||
|
||||
See :ref:`Retrieve a list of available log files <sec-api-logs-list>` for details.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.logs.delete(path, opts)
|
||||
|
||||
Deletes the specified log ``path``.
|
||||
|
||||
See :ref:`Delete a specific log file <sec-api-logs-delete>` for details.
|
||||
|
||||
:param string path: The path to the log file to delete
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.logs.download(path, opts)
|
||||
|
||||
Downloads the specified log ``file``.
|
||||
|
||||
See :js:func:`OctoPrint.download` for more details on the underlying library download mechanism.
|
||||
|
||||
:param string path: The path to the log file to download
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
Log file management (and logging configuration) was moved into a bundled plugin in OctoPrint 1.3.7. Refer to
|
||||
:ref:`the Logging's plugins JS Client Library <sec-bundledplugins-logging-jsclientlib>` for the JS Client documentation.
|
||||
|
||||
The former module ``OctoPrintClient.logs`` and its methods are marked as deprecated but still work for now. New
|
||||
client implementations should directly use the new module provided by the bundled plugin. Existing implementations
|
||||
should adapt their used module as soon as possible.
|
||||
@@ -1,7 +1,7 @@
|
||||
.. sec-jsclientlib-printer:
|
||||
.. _sec-jsclientlib-printer:
|
||||
|
||||
:mod:`OctoPrint.printer`
|
||||
------------------------
|
||||
:mod:`OctoPrintClient.printer`
|
||||
------------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
.. js:function:: OctoPrint.printer.getFullState(flags, opts)
|
||||
.. js:function:: OctoPrintClient.printer.getFullState(flags, opts)
|
||||
|
||||
Retrieves the full printer state, including temperature information, sd state and general
|
||||
printer state.
|
||||
@@ -34,7 +34,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.getToolState(flags, opts)
|
||||
.. js:function:: OctoPrintClient.printer.getToolState(flags, opts)
|
||||
|
||||
Retrieves the current printer extruder state/temperature information, and optionally also the temperature
|
||||
history.
|
||||
@@ -52,7 +52,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.setToolTargetTemperatures(targets, opts)
|
||||
.. js:function:: OctoPrintClient.printer.setToolTargetTemperatures(targets, opts)
|
||||
|
||||
Sets the given temperatures on the printer's extruders.
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.setToolTemperatureOffsets(offsets, opts)
|
||||
.. js:function:: OctoPrintClient.printer.setToolTemperatureOffsets(offsets, opts)
|
||||
|
||||
Sets the given temperature offsets for the printer's extruders.
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.selectTool(tool, opts)
|
||||
.. js:function:: OctoPrintClient.printer.selectTool(tool, opts)
|
||||
|
||||
Selects the printer's current extruder.
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.extrude(amount, opts)
|
||||
.. js:function:: OctoPrintClient.printer.extrude(amount, opts)
|
||||
|
||||
Extrudes or retracts ``amount`` mm of filament on the currently selected extruder.
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.setFlowrate(factor, opts)
|
||||
.. js:function:: OctoPrintClient.printer.setFlowrate(factor, opts)
|
||||
|
||||
Sets the current flowrate multiplier.
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.getBedState(data, opts)
|
||||
.. js:function:: OctoPrintClient.printer.getBedState(data, opts)
|
||||
|
||||
Retrieves the current printer bed state/temperature information, and optionally also the temperature
|
||||
history.
|
||||
@@ -170,11 +170,11 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.setBedTargetTemperature(target, opts)
|
||||
.. js:function:: OctoPrintClient.printer.setBedTargetTemperature(target, opts)
|
||||
|
||||
Sets the given temperature on the printer's heated bed (if available).
|
||||
|
||||
``target`` is expected to be a the target temperature as a float value.
|
||||
``target`` is expected to be the target temperature as a float value.
|
||||
|
||||
**Example:**
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.setBedTemperatureOffset(offset, opts)
|
||||
.. js:function:: OctoPrintClient.printer.setBedTemperatureOffset(offset, opts)
|
||||
|
||||
Sets the given temperature offset for the printer's heated bed (if available).
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.jog(amounts, opts)
|
||||
.. js:function:: OctoPrintClient.printer.jog(amounts, opts)
|
||||
|
||||
Jogs the specified axes by the specified ``amounts``.
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.home(axes, opts)
|
||||
.. js:function:: OctoPrintClient.printer.home(axes, opts)
|
||||
|
||||
Homes the specified ``axes``.
|
||||
|
||||
@@ -263,7 +263,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.setFeedrate(factor, opts)
|
||||
.. js:function:: OctoPrintClient.printer.setFeedrate(factor, opts)
|
||||
|
||||
Sets the feedrate multiplier to use.
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.getSdState(opts)
|
||||
.. js:function:: OctoPrintClient.printer.getSdState(opts)
|
||||
|
||||
Retrieves the current ready state of the printer's SD card.
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.initSd(opts)
|
||||
.. js:function:: OctoPrintClient.printer.initSd(opts)
|
||||
|
||||
Instructs the printer to initialize its SD card (if present).
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.refreshSd(opts)
|
||||
.. js:function:: OctoPrintClient.printer.refreshSd(opts)
|
||||
|
||||
Instructs the printer to refresh the list of files on the SD card (if present).
|
||||
|
||||
@@ -302,7 +302,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printer.releaseSd(opts)
|
||||
.. js:function:: OctoPrintClient.printer.releaseSd(opts)
|
||||
|
||||
Instructs the printer to release its SD card (if present).
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
.. sec-jsclientlib-printerprofiles:
|
||||
.. _sec-jsclientlib-printerprofiles:
|
||||
|
||||
:mod:`OctoPrint.printerprofiles`
|
||||
--------------------------------
|
||||
:mod:`OctoPrintClient.printerprofiles`
|
||||
--------------------------------------
|
||||
|
||||
.. js:function:: OctoPrint.printerprofiles.list(opts)
|
||||
.. js:function:: OctoPrintClient.printerprofiles.list(opts)
|
||||
|
||||
Retrieves a list of all configured printer profiles.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printerprofiles.get(id, opts)
|
||||
.. js:function:: OctoPrintClient.printerprofiles.get(id, opts)
|
||||
|
||||
:param string id: The identifier of the profile to retrieve
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printerprofiles.add(profile, additional, opts)
|
||||
.. js:function:: OctoPrintClient.printerprofiles.add(profile, additional, opts)
|
||||
|
||||
Adds a new profile to OctoPrint.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printerprofiles.update(id, profile, opts)
|
||||
.. js:function:: OctoPrintClient.printerprofiles.update(id, profile, opts)
|
||||
|
||||
Updates an existing profile in OctoPrint.
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.printerprofiles.delete(id, opts)
|
||||
.. js:function:: OctoPrintClient.printerprofiles.delete(id, opts)
|
||||
|
||||
Deletes a profile in OctoPrint.
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
.. sec-jsclientlib-settings:
|
||||
.. _sec-jsclientlib-settings:
|
||||
|
||||
:mod:`OctoPrint.settings`
|
||||
-------------------------
|
||||
:mod:`OctoPrintClient.settings`
|
||||
-------------------------------
|
||||
|
||||
.. js:function:: OctoPrint.settings.get(opts)
|
||||
.. js:function:: OctoPrintClient.settings.get(opts)
|
||||
|
||||
Retrieves the current settings.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.settings.save(settings, opts)
|
||||
.. js:function:: OctoPrintClient.settings.save(settings, opts)
|
||||
|
||||
Saves the provided ``settings``.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.settings.getPluginSettings(plugin, opts)
|
||||
.. js:function:: OctoPrintClient.settings.getPluginSettings(plugin, opts)
|
||||
|
||||
Retrieves the settings of the specified ``plugin``.
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.settings.savePluginSettings(plugin, settings, opts)
|
||||
.. js:function:: OctoPrintClient.settings.savePluginSettings(plugin, settings, opts)
|
||||
|
||||
Saves the ``settings`` for the specified ``plugin``.
|
||||
|
||||
@@ -35,6 +35,13 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.settings.generateApiKey(opts)
|
||||
|
||||
Generate a new system wide API key.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Settings API <sec-api-settings>`
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
.. sec-jsclientlib-slicing:
|
||||
.. _sec-jsclientlib-slicing:
|
||||
|
||||
:mod:`OctoPrint.slicing`
|
||||
------------------------
|
||||
:mod:`OctoPrintClient.slicing`
|
||||
------------------------------
|
||||
|
||||
.. js:function:: OctoPrint.slicing.listAllSlicersAndProfiles(opts)
|
||||
.. js:function:: OctoPrintClient.slicing.listAllSlicersAndProfiles(opts)
|
||||
|
||||
Retrieves a list of all slicers and their available slicing profiles.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.slicing.listProfilesForSlicer(slicer, opts)
|
||||
.. js:function:: OctoPrintClient.slicing.listProfilesForSlicer(slicer, opts)
|
||||
|
||||
Retrieves of all slicing profiles for the specified ``slicer``.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.slicing.getProfileForSlicer(slicer, profileId, opts)
|
||||
.. js:function:: OctoPrintClient.slicing.getProfileForSlicer(slicer, profileId, opts)
|
||||
|
||||
Retrieves the slicing profile with ``profileId`` for the specified ``slicer``.
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.slicing.addProfileForSlicer(slicer, profileId, profile, opts)
|
||||
.. js:function:: OctoPrintClient.slicing.addProfileForSlicer(slicer, profileId, profile, opts)
|
||||
|
||||
Adds the profile with identifier ``profileId`` to the specified ``slicer``, using the provided ``profile`` data.
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.slicing.updateProfileForSlicer(slicer, profileId, profile, opts)
|
||||
.. js:function:: OctoPrintClient.slicing.updateProfileForSlicer(slicer, profileId, profile, opts)
|
||||
|
||||
Updates the profile ``profileId`` for ``slicer`` with the provided ``profile`` data.
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.slicing.deleteProfileForSlicer(slicer, profileId, opts)
|
||||
.. js:function:: OctoPrintClient.slicing.deleteProfileForSlicer(slicer, profileId, opts)
|
||||
|
||||
Deletes the profile ``profileId`` for ``slicer``.
|
||||
|
||||
|
||||
+15
-15
@@ -1,24 +1,24 @@
|
||||
.. sec-jsclientlib-socket:
|
||||
.. _sec-jsclientlib-socket:
|
||||
|
||||
:mod:`OctoPrint.socket`
|
||||
-----------------------
|
||||
:mod:`OctoPrintClient.socket`
|
||||
-----------------------------
|
||||
|
||||
.. js:data:: OctoPrint.socket.options
|
||||
.. js:attribute:: OctoPrintClient.socket.options
|
||||
|
||||
The socket client's options.
|
||||
|
||||
``OctoPrint.socket.options.timeouts``
|
||||
``OctoPrintClient.socket.options.timeouts``
|
||||
A list of consecutive timeouts after which to attempt reconnecting to a
|
||||
disconnected sockets, in seconds. Defaults to ``[1, 1, 2, 3, 5, 8, 13, 20, 40, 100]``.
|
||||
The default setting here makes the client slowly back off after the first couple of very
|
||||
fast connection attempts don't succeed, and give up after 10 tries.
|
||||
|
||||
``OctoPrint.socket.options.rateSlidingWindowSize``
|
||||
``OctoPrintClient.socket.options.rateSlidingWindowSize``
|
||||
Number of last rate measurements to take into account for timing analysis and
|
||||
communication throttling. See :ref:`Communication Throttling <sec-jsclient-socket-throttling>`
|
||||
below.
|
||||
|
||||
.. js:function:: OctoPrint.socket.connect(opts)
|
||||
.. js:function:: OctoPrintClient.socket.connect(opts)
|
||||
|
||||
Connects the socket client to OctoPrint's `SockJS <http://sockjs.org/>`_ socket.
|
||||
|
||||
@@ -27,15 +27,15 @@
|
||||
|
||||
:param object opts: Additional options for the SockJS constructor.
|
||||
|
||||
.. js:function:: OctoPrint.socket.reconnect()
|
||||
.. js:function:: OctoPrintClient.socket.reconnect()
|
||||
|
||||
Reconnects the socket client. If the socket is currently connected it will be disconnected first.
|
||||
|
||||
.. js:function:: OctoPrint.socket.disconnect()
|
||||
.. js:function:: OctoPrintClient.socket.disconnect()
|
||||
|
||||
Disconnects the socket client.
|
||||
|
||||
.. js:function:: OctoPrint.socket.onMessage(message, handler)
|
||||
.. js:function:: OctoPrintClient.socket.onMessage(message, handler)
|
||||
|
||||
Registers the ``handler`` for messages of type ``message``.
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
:param string message: The type of message for which to register
|
||||
:param function handler: The handler function
|
||||
|
||||
.. js:function:: OctoPrint.socket.sendMessage(type, payload)
|
||||
.. js:function:: OctoPrintClient.socket.sendMessage(type, payload)
|
||||
|
||||
Sends a message of type ``type`` with the provided ``payload`` to the server.
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
:param string type: Type of message to send
|
||||
:param object payload: Payload to send
|
||||
|
||||
.. js:function:: OctoPrint.socket.onRateTooLow(measured, minimum)
|
||||
.. js:function:: OctoPrintClient.socket.onRateTooLow(measured, minimum)
|
||||
|
||||
Called by the socket client when the measured message round trip times have been lower than
|
||||
the current lower processing limit over the full sliding window, indicating that messages
|
||||
@@ -82,7 +82,7 @@
|
||||
:param Number measured: Maximal measured message round trip time
|
||||
:param Number minimum: Lower round trip time limit for keeping the rate
|
||||
|
||||
.. js:function:: OctoPrint.socket.onRateTooHigh(measured, maximum)
|
||||
.. js:function:: OctoPrintClient.socket.onRateTooHigh(measured, maximum)
|
||||
|
||||
Called by the socket client when the last measured round trip time was higher than the
|
||||
current upper procesisng limit, indicating that the messages are now processed slower than
|
||||
@@ -94,11 +94,11 @@
|
||||
:param Number measured: Measured message round trip time
|
||||
:param Number minimum: Upper round trip time limit for keeping the rate
|
||||
|
||||
.. js:function:: OctoPrint.socket.increaseRate()
|
||||
.. js:function:: OctoPrintClient.socket.increaseRate()
|
||||
|
||||
Instructs the server to increase the message rate by 500ms.
|
||||
|
||||
.. js:function:: OctoPrint.socket.decreaseRate()
|
||||
.. js:function:: OctoPrintClient.socket.decreaseRate()
|
||||
|
||||
Instructs the server to decrease the message rate by 500ms.
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
.. sec-jsclientlib-system:
|
||||
|
||||
:mod:`OctoPrint.system`
|
||||
-----------------------
|
||||
:mod:`OctoPrintClient.system`
|
||||
-----------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
All methods here require that the used API token or the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrint.system.getCommands(opts)
|
||||
.. js:function:: OctoPrintClient.system.getCommands(opts)
|
||||
|
||||
Retrieves a list of configured system commands for both ``core`` and ``custom`` sources.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.system.getCommandsForSource(source, opts)
|
||||
.. js:function:: OctoPrintClient.system.getCommandsForSource(source, opts)
|
||||
|
||||
Retrieves a list of system commands, limiting it to the specified ``source``, which might be
|
||||
either ``core`` or ``custom``.
|
||||
@@ -23,7 +23,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.system.executeCommand(source, action, opts)
|
||||
.. js:function:: OctoPrintClient.system.executeCommand(source, action, opts)
|
||||
|
||||
Executes command ``action`` on ``source``.
|
||||
|
||||
@@ -35,4 +35,4 @@
|
||||
.. seealso::
|
||||
|
||||
:ref:`System API <sec-api-system>`
|
||||
Documentation of the underlying system API
|
||||
Documentation of the underlying system API.
|
||||
@@ -1,9 +1,9 @@
|
||||
.. sec-jsclientlib-timelapse:
|
||||
.. _sec-jsclientlib-timelapse:
|
||||
|
||||
:mod:`OctoPrint.timelapse`
|
||||
--------------------------
|
||||
:mod:`OctoPrintClient.timelapse`
|
||||
--------------------------------
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.get(unrendered, opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.get(unrendered, opts)
|
||||
|
||||
Get a list of all timelapses and the current timelapse config.
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.list(opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.list(opts)
|
||||
|
||||
Get the lists of rendered and unrendered timelapses. The returned promis
|
||||
Get the lists of rendered and unrendered timelapses. The returned promise
|
||||
will be resolved with an object containing the properties ``rendered``
|
||||
which will have the list of rendered timelapses, and ``unrendered`` which
|
||||
will have the list of unrendered timelapses.
|
||||
@@ -23,21 +23,21 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.listRendered(opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.listRendered(opts)
|
||||
|
||||
Get the list of rendered timelapses.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.listUnrendered(opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.listUnrendered(opts)
|
||||
|
||||
Get the list of unrendered timelapses.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.download(filename, opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.download(filename, opts)
|
||||
|
||||
Download the rendered timelapse ``filename``.
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.delete(filename, opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.delete(filename, opts)
|
||||
|
||||
Delete the rendered timelapse ``filename``.
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.deleteUnrendered(name, opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.deleteUnrendered(name, opts)
|
||||
|
||||
Delete the unrendered timelapse ``name``.
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.renderUnrendered(name, opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.renderUnrendered(name, opts)
|
||||
|
||||
Render the unrendered timelapse ``name``.
|
||||
|
||||
@@ -69,14 +69,14 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.getConfig(opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.getConfig(opts)
|
||||
|
||||
Get the current timelapse configuration.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.timelapse.saveConfig(config, opts)
|
||||
.. js:function:: OctoPrintClient.timelapse.saveConfig(config, opts)
|
||||
|
||||
Save the timelapse configuration.
|
||||
|
||||
|
||||
+14
-14
@@ -1,15 +1,15 @@
|
||||
.. sec-jsclientlib-users:
|
||||
.. _sec-jsclientlib-users:
|
||||
|
||||
:mod:`OctoPrint.users`
|
||||
----------------------
|
||||
:mod:`OctoPrintClient.users`
|
||||
----------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
Most methods here require that the used API token or a the existing browser session
|
||||
Most methods here require that the used API token or the existing browser session
|
||||
has admin rights *or* corresponds to the user to be modified. Some methods
|
||||
definitely require admin rights.
|
||||
|
||||
.. js:function:: OctoPrint.users.list(opts)
|
||||
.. js:function:: OctoPrintClient.users.list(opts)
|
||||
|
||||
Get a list of all registered users.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.users.get(name, opts)
|
||||
.. js:function:: OctoPrintClient.users.get(name, opts)
|
||||
|
||||
Get information about a specific user.
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.users.add(user, opts)
|
||||
.. js:function:: OctoPrintClient.users.add(user, opts)
|
||||
|
||||
Add a new user.
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.users.update(name, active, admin, opts)
|
||||
.. js:function:: OctoPrintClient.users.update(name, active, admin, opts)
|
||||
|
||||
Update an existing user.
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.users.delete(name, opts)
|
||||
.. js:function:: OctoPrintClient.users.delete(name, opts)
|
||||
|
||||
Delete an existing user.
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.users.changePassword(name, password, opts)
|
||||
.. js:function:: OctoPrintClient.users.changePassword(name, password, opts)
|
||||
|
||||
Change the password for a user.
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.users.generateApiKey(name, opts)
|
||||
.. js:function:: OctoPrintClient.users.generateApiKey(name, opts)
|
||||
|
||||
Generate a new API key for a user.
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.users.resetApiKey(name, opts)
|
||||
.. js:function:: OctoPrintClient.users.resetApiKey(name, opts)
|
||||
|
||||
Reset the API key for a user to being unset.
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.users.getSettings(name, opts)
|
||||
.. js:function:: OctoPrintClient.users.getSettings(name, opts)
|
||||
|
||||
Get the settings for a user.
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.users.saveSettings(name, settings, opts)
|
||||
.. js:function:: OctoPrintClient.users.saveSettings(name, settings, opts)
|
||||
|
||||
Save the settings for a user.
|
||||
|
||||
|
||||
+61
-11
@@ -1,14 +1,14 @@
|
||||
.. sec-jsclientlib-util:
|
||||
.. _sec-jsclientlib-util:
|
||||
|
||||
:mod:`OctoPrint.util`
|
||||
---------------------
|
||||
:mod:`OctoPrintClient.util`
|
||||
---------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
All methods here require that the used API token or the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrint.util.test(command, parameters, opts)
|
||||
.. js:function:: OctoPrintClient.util.test(command, parameters, opts)
|
||||
|
||||
Execute a :ref:`test command <sec-api-util-test>`.
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.util.testPath(path, additional, opts)
|
||||
.. js:function:: OctoPrintClient.util.testPath(path, additional, opts)
|
||||
|
||||
Test the provided ``path`` for existance. More test criteria supported by the :ref:`path test command <sec-api-util-test-path>`
|
||||
Test the provided ``path`` for existence. More test criteria supported by the :ref:`path test command <sec-api-util-test-path>`
|
||||
can be provided via the ``additional`` object.
|
||||
|
||||
**Example 1**
|
||||
@@ -59,7 +59,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.util.testExecutable(path, opts)
|
||||
.. js:function:: OctoPrintClient.util.testExecutable(path, opts)
|
||||
|
||||
Shortcut to test if a provided ``path`` exists and is executable by OctoPrint.
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.util.testUrl(url, additional, opts)
|
||||
.. js:function:: OctoPrintClient.util.testUrl(url, additional, opts)
|
||||
|
||||
Test if a URL can be accessed. More test criteria supported by the :ref:`URL test command <sec-api-util-test-url>`
|
||||
can be provided via the ``additional`` object.
|
||||
@@ -126,8 +126,16 @@
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
var content = response.response.content;
|
||||
var mimeType = "image/jpeg";
|
||||
|
||||
var headers = response.response.headers;
|
||||
if (headers && headers["content-type"]) {
|
||||
mimeType = headers["content-type"].split(";")[0];
|
||||
}
|
||||
|
||||
var image = $("#someimage");
|
||||
image.
|
||||
image.src = "data:" + mimeType + ";base64," + content;
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
@@ -153,7 +161,49 @@
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrintClient.util.testServer(host, port, additional, opts)
|
||||
|
||||
Test if a server is reachable. More options supported by the :ref:`server test command <sec-api-util-test-server>`
|
||||
can be provided via the ``additional`` object.
|
||||
|
||||
**Example 1**
|
||||
|
||||
Test if ``8.8.8.8`` is reachable on port 53 within the default timeout.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.util.testServer("8.8.8.8", 53)
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
});
|
||||
|
||||
**Example 2**
|
||||
|
||||
Test if ``127.0.0.1`` is reachable on port 1234 and UDP.
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
OctoPrint.util.testUrl("127.0.0.1", 1234, {"protocol": "udp"})
|
||||
.done(function(response) {
|
||||
if (response.result) {
|
||||
// check passed
|
||||
} else {
|
||||
// check failed
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
:param string url: Host to test
|
||||
:param int port: Port to test
|
||||
:param object additional: Additional parameters for the test command
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. seealso::
|
||||
|
||||
:ref:`Util API <sec-api-util>`
|
||||
Documentation of the underlying util API
|
||||
Documentation of the underlying util API.
|
||||
@@ -1,21 +1,21 @@
|
||||
.. sec-jsclientlib-wizard:
|
||||
.. _sec-jsclientlib-wizard:
|
||||
|
||||
:mod:`OctoPrint.wizard`
|
||||
-----------------------
|
||||
:mod:`OctoPrintClient.wizard`
|
||||
-----------------------------
|
||||
|
||||
.. note::
|
||||
|
||||
All methods here require that the used API token or a the existing browser session
|
||||
All methods here require that the used API token or the existing browser session
|
||||
has admin rights.
|
||||
|
||||
.. js:function:: OctoPrint.wizard.get(opts)
|
||||
.. js:function:: OctoPrintClient.wizard.get(opts)
|
||||
|
||||
Retrieve additional data about registered wizards.
|
||||
|
||||
:param object opts: Additional options for the request
|
||||
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response
|
||||
|
||||
.. js:function:: OctoPrint.wizard.finish(handled, opts)
|
||||
.. js:function:: OctoPrintClient.wizard.finish(handled, opts)
|
||||
|
||||
Inform wizards that the wizard dialog has been finished.
|
||||
|
||||
|
||||
@@ -14,4 +14,5 @@ Internal Modules
|
||||
server.rst
|
||||
settings.rst
|
||||
slicing.rst
|
||||
users.rst
|
||||
util.rst
|
||||
@@ -4,3 +4,10 @@ octoprint.printer
|
||||
-----------------
|
||||
|
||||
.. automodule:: octoprint.printer
|
||||
|
||||
.. _sec-modules-printer-profile:
|
||||
|
||||
octoprint.printer.profile
|
||||
-------------------------
|
||||
|
||||
.. automodule:: octoprint.printer.profile
|
||||
@@ -0,0 +1,9 @@
|
||||
.. _sec-modules-users:
|
||||
|
||||
octoprint.users
|
||||
---------------
|
||||
|
||||
.. automodule:: octoprint.users
|
||||
:members:
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ Lifecycle
|
||||
|
||||
There are three sources of installed plugins that OctoPrint will check during start up:
|
||||
|
||||
* it's own ``octoprint/plugins`` folder (this is where the bundled plugins reside),
|
||||
* its own ``octoprint/plugins`` folder (this is where the bundled plugins reside),
|
||||
* the ``plugins`` folder in its configuration directory (e.g. ``~/.octoprint/plugins`` on Linux),
|
||||
* any python packages registered for the entry point ``octoprint.plugin``.
|
||||
* any Python packages registered for the entry point ``octoprint.plugin``.
|
||||
|
||||
Each plugin that OctoPrint finds it will first load, then enable. On enabling a plugin, OctoPrint will
|
||||
register its declared :ref:`hook handlers <sec-plugins-hooks>` and :ref:`helpers <sec-plugins-helpers>`, apply
|
||||
@@ -36,7 +36,7 @@ any :ref:`settings overlays <sec-plugins-controlproperties-plugin_settings_overl
|
||||
On disabling a plugin, its hook handlers, helpers, mixin implementations and settings overlays will be de-registered again.
|
||||
|
||||
Some plugin types require a reload of the frontend or a restart of OctoPrint for enabling/disabling them. You
|
||||
can recognized such plugins by their implementations implementing :class:`~octoprint.plugin.ReloadNeedingPlugin` or
|
||||
can recognize such plugins by their implementations implementing :class:`~octoprint.plugin.ReloadNeedingPlugin` or
|
||||
:class:`~octoprint.plugin.RestartNeedingPlugin` or providing handlers for one of the hooks marked correspondingly.
|
||||
|
||||
.. image:: ../images/plugins_lifecycle.png
|
||||
|
||||
@@ -20,7 +20,7 @@ development environment::
|
||||
$ virtualenv venv
|
||||
[...]
|
||||
$ source venv/bin/activate
|
||||
(venv) $ pip install -e[develop]
|
||||
(venv) $ pip install -e .[develop,plugins]
|
||||
[...]
|
||||
(venv) $ octoprint --help
|
||||
Usage: octoprint [OPTIONS] COMMAND [ARGS]...
|
||||
@@ -41,7 +41,15 @@ development environment::
|
||||
|
||||
[...]
|
||||
|
||||
We'll start at the most basic form a plugin can take - just a couple of simple lines of Python code:
|
||||
.. important::
|
||||
|
||||
This tutorial assumes you are running OctoPrint 1.3.0 and up. Please make sure your version of
|
||||
OctoPrint is up to date before proceeding. If you did a fresh checkout, that should already
|
||||
be the case but if not you might have to update first. You can check your version of OctoPrint
|
||||
by running ``octoprint --version`` or by taking a look into the lower left corner in OctoPrint's
|
||||
web interface.
|
||||
|
||||
We'll start at the most basic form a plugin can take - just a few simple lines of Python code:
|
||||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
@@ -108,7 +116,7 @@ used :func:`~octoprint.plugin.StartupPlugin.on_startup` instead, in which case o
|
||||
up and ready to serve requests.
|
||||
|
||||
You'll also note that we are using ``self._logger`` for logging. Where did that one come from? OctoPrint's plugin system
|
||||
injects :ref:`a couple of useful objects <sec-plugins-mixins-injectedproperties>` into our plugin implementation classes,
|
||||
injects :ref:`a some useful objects <sec-plugins-mixins-injectedproperties>` into our plugin implementation classes,
|
||||
one of those being a fully instantiated `python logger <https://docs.python.org/2/library/logging.html>`_ ready to be
|
||||
used by your plugin. As you can see in the log output above, that logger uses the namespace ``octoprint.plugins.helloworld``
|
||||
for our little plugin here, or more generally ``octoprint.plugins.<plugin identifier>``.
|
||||
@@ -126,14 +134,15 @@ as a simple python file following the naming convention ``<plugin identifier>.py
|
||||
``~/.octoprint/plugins`` folder. You already know how that works. But let's say you have more than just a simple plugin
|
||||
that can be done in one file. Distributing multiple files and getting your users to install them in the right way
|
||||
so that OctoPrint will be able to actually find and load them is certainly not impossible, but we want to do it in the
|
||||
best way possible, meaning we want to make our plugin a fully installable python module that your users will be able to
|
||||
best way possible, meaning we want to make our plugin a fully installable Python module that your users will be able to
|
||||
install directly via `OctoPrint's built-in Plugin Manager <https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager>`_
|
||||
or alternatively manually utilizing Python's standard package manager ``pip`` directly.
|
||||
|
||||
So let's begin. We'll use the `cookiecutter <https://github.com/audreyr/cookiecutter>`_ template for OctoPrint plugins here,
|
||||
so we'll first need to install that::
|
||||
So let's begin. We'll use the `cookiecutter <https://github.com/audreyr/cookiecutter>`_ template for OctoPrint plugins
|
||||
here. This should already be installed if you used the ``plugins`` extra while installing OctoPrint. However,
|
||||
you may install it with::
|
||||
|
||||
(venv) $ pip install cookiecutter
|
||||
(venv) $ pip install "cookiecutter>=1.4,<1.7"
|
||||
|
||||
Then we can use the ``octoprint dev plugin:new`` command [#f1]_ to generate a new OctoPrint plugin skeleton for us::
|
||||
|
||||
@@ -273,7 +282,7 @@ of information now defined twice:
|
||||
plugin_version = "1.0.0"
|
||||
plugin_description = "A quick \"Hello World\" example plugin for OctoPrint"
|
||||
|
||||
The nice thing about our plugin now being a proper python package is that OctoPrint can and will access the metadata defined
|
||||
The nice thing about our plugin now being a proper Python package is that OctoPrint can and will access the metadata defined
|
||||
within ``setup.py``! So, we don't really need to define all this data twice. Remove ``__plugin_name__``, ``__plugin_version__``
|
||||
and ``__plugin_description__`` from ``__init__.py``:
|
||||
|
||||
@@ -482,7 +491,7 @@ Also adjust your plugin's ``templates/helloworld_navbar.jinja2`` like this:
|
||||
|
||||
OctoPrint injects the template variables that your plugin defines prefixed with ``plugin_<plugin identifier>_`` into
|
||||
the template renderer, so your ``url`` got turned into ``plugin_helloworld_url`` which you can now use as a simple
|
||||
`Jinja2 Variable <http://jinja.pocoo.org/docs/dev/templates/#variables>`_ in your plugin's template.
|
||||
`Jinja2 Variable <http://jinja.octoprint.org/templates.html#variables>`_ in your plugin's template.
|
||||
|
||||
Restart OctoPrint and shift-reload the page in your browser (to make sure you really get a fresh copy). The link should
|
||||
still work and point to the URL we defined as default.
|
||||
@@ -811,12 +820,10 @@ Put something like the following into ``helloworld.css``:
|
||||
.. code-block:: css
|
||||
:linenos:
|
||||
|
||||
#tab_plugin_helloworld {
|
||||
iframe {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
border: 1px solid #808080;
|
||||
}
|
||||
#tab_plugin_helloworld iframe {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
border: 1px solid #808080;
|
||||
}
|
||||
|
||||
Don't forget to remove the ``style`` attribute from the ``iframe`` tag in ``helloworld_tab.jinja2``:
|
||||
@@ -1070,8 +1077,14 @@ For some insight on how to create plugins that react to various events within Oc
|
||||
add support for a slicer, OctoPrint's own bundled `CuraEngine plugin <https://github.com/foosel/OctoPrint/wiki/Plugin:-Cura>`_
|
||||
might give some hints. For extending OctoPrint's interface, the `NavbarTemp plugin <https://github.com/imrahil/OctoPrint-NavbarTemp>`_
|
||||
might show what's possible with a few lines of code already. Finally, just take a look at the
|
||||
`list of available plugins <https://github.com/foosel/OctoPrint/wiki#plugins>`_ on the OctoPrint wiki if you are
|
||||
looking for examples.
|
||||
`official Plugin Repository <http://plugins.octoprint.org>`_ if you are looking for examples.
|
||||
|
||||
.. seealso::
|
||||
|
||||
`Jinja Template Designer Documentation <http://jinja.octoprint.org/templates.html>`_
|
||||
Jinja's Template Designer Documentation describes the syntax and semantics of the template language used
|
||||
by OctoPrint's frontend. Linked here are the docs for Jinja 2.8.1, which OctoPrint still
|
||||
relies on for backwards compatibility reasons [#f3]_.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
@@ -1084,3 +1097,7 @@ looking for examples.
|
||||
.. [#f2] Refer to the `LESS documentation <http://lesscss.org/#using-less>`_ on how to do that. If you are developing
|
||||
your plugin under Windows you might also want to give `WinLESS <http://winless.org/>`_ a look which will run
|
||||
in the background and keep your CSS files up to date with your various project's LESS files automatically.
|
||||
.. [#f3] Please always consult the Jinja documentation at `jinja.octoprint.org <http://jinja.octoprint.org>`_ instead of
|
||||
the current stable documentation available at Jinja's project page. The reason for that is that for backwards
|
||||
compatibility reasons OctoPrint currently sadly has to rely on an older version of Jinja. The documentation
|
||||
available at `jinja.octoprint.org <http://jinja.octoprint.org>`_ matches that older version.
|
||||
@@ -6,9 +6,9 @@ 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
|
||||
An example for providing some 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.
|
||||
which provides its SSDP browsing and Zeroconf browsing and publishing functions as helper methods.
|
||||
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
|
||||
+246
-17
@@ -79,7 +79,7 @@ property instead, manually instantiate your implementation instance and then add
|
||||
.. 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>`_
|
||||
:caption: `custom_action_command.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_action_command.py>`__
|
||||
:name: sec-plugin-concepts-hooks-example
|
||||
|
||||
.. _sec-plugins-hooks-ordering:
|
||||
@@ -226,6 +226,37 @@ octoprint.accesscontrol.appkey
|
||||
:return: A list of 3-tuples as described above
|
||||
:rtype: list
|
||||
|
||||
.. _sec-plugins-hook-accesscontrol-keyvalidator:
|
||||
|
||||
octoprint.accesscontrol.keyvalidator
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. py:function:: acl_keyvalidator_hook(apikey, *args, **kwargs)
|
||||
|
||||
Via this hook plugins may validate their own customized API keys to be used to access OctoPrint's API.
|
||||
|
||||
``apikey`` will be the API key as read from the request headers.
|
||||
|
||||
Hook handlers are expected to return a :class:`~octoprint.users.User` instance here that will then be considered that
|
||||
user making the request. By returning ``None`` or nothing at all, hook handlers signal that they do not handle the
|
||||
provided key.
|
||||
|
||||
**Example:**
|
||||
|
||||
Allows using a user's id as their API key (for obvious reasons this is NOT recommended in production environments
|
||||
and merely provided for educational purposes):
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_keyvalidator.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `custom_keyvalidator.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_keyvalidator.py>`_
|
||||
|
||||
.. versionadded:: 1.3.6
|
||||
|
||||
:param str apikey: The API key to validate
|
||||
:return: The user in whose name the request will be processed further
|
||||
:rtype: :class:`~octoprint.users.User`
|
||||
|
||||
.. _sec-plugins-hook-cli-commands:
|
||||
|
||||
octoprint.cli.commands
|
||||
@@ -370,13 +401,52 @@ octoprint.comm.protocol.action
|
||||
.. 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>`_
|
||||
: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-atcommand-phase:
|
||||
|
||||
octoprint.comm.protocol.atcommand.<phase>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This describes actually two hooks:
|
||||
|
||||
* ``octoprint.comm.protocol.atcommand.queuing``
|
||||
* ``octoprint.comm.protocol.atcommand.sending``
|
||||
|
||||
.. py:function:: protocol_atcommandphase_hook(comm_instance, phase, command, parameters, tags=None, *args, **kwargs)
|
||||
|
||||
Trigger on :ref:`@ commands <sec-features-atcommands>` as they progress through the ``queuing`` and ``sending``
|
||||
phases of the comm layer. See :ref:`the gcode phase hook <sec-plugins-hook-comm-protocol-gcode-phase>` for a
|
||||
detailed description of each of these phases.
|
||||
|
||||
Hook handlers may use this to react to arbitrary :ref:`@ commands <sec-features-atcommands>` included in GCODE files
|
||||
streamed to the printer or sent as part of GCODE scripts, through the API or plugins.
|
||||
|
||||
Please note that these hooks do not allow to rewrite, suppress or expand @ commands, they are merely callbacks to
|
||||
trigger the *actual execution* of whatever functionality lies behind a given @ command, similar to
|
||||
:ref:`the action command hook <sec-plugins-hook-comm-protocol-action>`.
|
||||
|
||||
**Example**
|
||||
|
||||
Pause the print on ``@wait`` (this mirrors the implementation of the built-in ``@pause`` command, just with a
|
||||
different name).
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/custom_atcommand.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `custom_action_command.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/custom_atcommand.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`` or ``sending``. Will always
|
||||
match the ``<phase>`` of the hook.
|
||||
:param str cmd: The @ command without the leading @
|
||||
:param str parameters: Any parameters provided to the @ command. If none were provided this will be an empty string.
|
||||
|
||||
.. _sec-plugins-hook-comm-protocol-gcode-phase:
|
||||
|
||||
octoprint.comm.protocol.gcode.<phase>
|
||||
@@ -389,14 +459,15 @@ This describes actually four hooks:
|
||||
* ``octoprint.comm.protocol.gcode.sending``
|
||||
* ``octoprint.comm.protocol.gcode.sent``
|
||||
|
||||
.. py:function:: protocol_gcodephase_hook(comm_instance, phase, cmd, cmd_type, gcode, *args, **kwargs)
|
||||
.. py:function:: protocol_gcodephase_hook(comm_instance, phase, cmd, cmd_type, gcode, subcode=None, tags=None, *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.
|
||||
may suppress or change commands or their command type here. This is the only phase that supports multi command
|
||||
expansion by having the handler return a list, see below for details.
|
||||
* ``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
|
||||
@@ -411,7 +482,39 @@ This describes actually four hooks:
|
||||
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).
|
||||
will never contain more than one line with the same ``cmd_type``) and the detected ``gcode`` command (if it is one)
|
||||
as well as its ``subcode`` (if it has one). OctoPrint will also provide any ``tags`` attached to the command throughout
|
||||
its lifecycle.
|
||||
|
||||
Tags are arbitrary strings that can be attached to a command as it moves through the various phases and can be used to e.g.
|
||||
distinguish between commands that originated in a printed file (``source:file``) vs. a configured GCODE script
|
||||
(``source:script``) vs. an API call (``source:api``) vs. a plugin (``source:plugin`` or ``source:rewrite`` and
|
||||
``plugin:<plugin identifier>``). If during development you want to get an idea of the various possible tags, set
|
||||
the logger ``octoprint.util.comm.command_phases`` to ``DEBUG``, connect to a printer (real or virtual) and take a
|
||||
look at your ``octoprint.log`` during serial traffic:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
2018-02-16 18:20:31,213 - octoprint.util.comm.command_phases - DEBUG - phase: queuing | command: T0 | gcode: T | tags: [ api:printer.command, source:api, trigger:printer.commands ]
|
||||
2018-02-16 18:20:31,216 - octoprint.util.comm.command_phases - DEBUG - phase: queued | command: M117 Before T! | gcode: M117 | tags: [ api:printer.command, phase:queuing, plugin:multi_gcode_test, source:api, source:rewrite, trigger:printer.commands ]
|
||||
2018-02-16 18:20:31,217 - octoprint.util.comm.command_phases - DEBUG - phase: sending | command: M117 Before T! | gcode: M117 | tags: [ api:printer.command, phase:queuing, plugin:multi_gcode_test, source:api, source:rewrite, trigger:printer.commands ]
|
||||
2018-02-16 18:20:31,217 - octoprint.util.comm.command_phases - DEBUG - phase: queued | command: T0 | gcode: T | tags: [ api:printer.command, source:api, trigger:printer.commands ]
|
||||
2018-02-16 18:20:31,219 - octoprint.util.comm.command_phases - DEBUG - phase: queued | command: M117 After T! | gcode: M117 | tags: [ api:printer.command, phase:queuing, plugin:multi_gcode_test, source:api, source:rewrite, trigger:printer.commands ]
|
||||
2018-02-16 18:20:31,220 - octoprint.util.comm.command_phases - DEBUG - phase: sent | command: M117 Before T! | gcode: M117 | tags: [ api:printer.command, phase:queuing, plugin:multi_gcode_test, source:api, source:rewrite, trigger:printer.commands ]
|
||||
2018-02-16 18:20:31,230 - tornado.access - INFO - 204 POST /api/printer/command (127.0.0.1) 23.00ms
|
||||
2018-02-16 18:20:31,232 - tornado.access - INFO - 200 POST /api/printer/command (127.0.0.1) 25.00ms
|
||||
2018-02-16 18:20:31,232 - octoprint.util.comm.command_phases - DEBUG - phase: sending | command: T0 | gcode: T | tags: [ api:printer.command, source:api, trigger:printer.commands ]
|
||||
2018-02-16 18:20:31,234 - octoprint.util.comm.command_phases - DEBUG - phase: sent | command: T0 | gcode: T | tags: [ api:printer.command, source:api, trigger:printer.commands ]
|
||||
2018-02-16 18:20:31,242 - octoprint.util.comm.command_phases - DEBUG - phase: sending | command: M117 After T! | gcode: M117 | tags: [ api:printer.command, phase:queuing, plugin:multi_gcode_test, source:api, source:rewrite, trigger:printer.commands ]
|
||||
2018-02-16 18:20:31,243 - octoprint.util.comm.command_phases - DEBUG - phase: sent | command: M117 After T! | gcode: M117 | tags: [ api:printer.command, phase:queuing, plugin:multi_gcode_test, source:api, source:rewrite, trigger:printer.commands ]
|
||||
2018-02-16 18:20:38,552 - octoprint.util.comm.command_phases - DEBUG - phase: queuing | command: G91 | gcode: G91 | tags: [ api:printer.printhead, source:api, trigger:printer.commands, trigger:printer.jog ]
|
||||
2018-02-16 18:20:38,552 - octoprint.util.comm.command_phases - DEBUG - phase: queued | command: G91 | gcode: G91 | tags: [ api:printer.printhead, source:api, trigger:printer.commands, trigger:printer.jog ]
|
||||
2018-02-16 18:20:38,553 - octoprint.util.comm.command_phases - DEBUG - phase: sending | command: G91 | gcode: G91 | tags: [ api:printer.printhead, source:api, trigger:printer.commands, trigger:printer.jog ]
|
||||
2018-02-16 18:20:38,553 - octoprint.util.comm.command_phases - DEBUG - phase: queuing | command: G1 X10 F6000 | gcode: G1 | tags: [ api:printer.printhead, source:api, trigger:printer.commands, trigger:printer.jog ]
|
||||
2018-02-16 18:20:38,555 - octoprint.util.comm.command_phases - DEBUG - phase: queued | command: G1 X10 F6000 | gcode: G1 | tags: [ api:printer.printhead, source:api, trigger:printer.commands, trigger:printer.jog ]
|
||||
2018-02-16 18:20:38,556 - octoprint.util.comm.command_phases - DEBUG - phase: sent | command: G91 | gcode: G91 | tags: [ api:printer.printhead, source:api, trigger:printer.commands, trigger:printer.jog ]
|
||||
2018-02-16 18:20:38,556 - octoprint.util.comm.command_phases - DEBUG - phase: queuing | command: G90 | gcode: G90 | tags: [ api:printer.printhead, source:api, trigger:printer.commands, trigger:printer.jog ]
|
||||
2018-02-16 18:20:38,558 - octoprint.util.comm.command_phases - DEBUG - phase: queued | command: G90 | gcode: G90 | tags: [ api:printer.printhead, source:api, trigger:printer.commands, trigger:printer.jog ]
|
||||
|
||||
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
|
||||
@@ -425,7 +528,7 @@ This describes actually four hooks:
|
||||
|
||||
* ``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 explicitly from the handler. Hence, the following
|
||||
examples are all falling into this category:
|
||||
examples are all falling into this category and equivalent:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -450,6 +553,29 @@ This describes actually four hooks:
|
||||
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.
|
||||
* A 3-tuple consisting of a rewritten version of the ``cmd``, the ``cmd_type`` and any additional ``tags`` you might
|
||||
want to attach to the lifecycle of the command in a set, e.g. ``return "M105", "temperature_poll", {"my_custom_tag"}``
|
||||
* **"queuing" phase only**: A list of any of the above to allow for expanding one command into
|
||||
many. The following example shows how any queued command could be turned into a sequence of a temperature query,
|
||||
line number reset, display of the ``gcode`` on the printer's display and finally the actual command (this example
|
||||
does not make a lot of sense to be quite honest):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
def rewrite_foo(self, comm_instance, phase, cmd, cmd_type, gcode, subcode=None, tags=None *args, **kwargs):
|
||||
if gcode or not cmd.startswith("@foo"):
|
||||
return
|
||||
|
||||
return [("M105", "temperature_poll"), # 2-tuple, command & command type
|
||||
("M110",), # 1-tuple, just the command
|
||||
"M117 echo foo: {}".format(cmd)] # string, just the command
|
||||
|
||||
__plugin_hooks__ = {
|
||||
"octoprint.comm.protocol.gcode.queuing": rewrite_foo
|
||||
}
|
||||
|
||||
Note: Only one command of a given ``cmd_type`` (other than None) may be queued at a time. Trying to rewrite the ``cmd_type``
|
||||
to one already in the queue will give an error.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -469,6 +595,9 @@ This describes actually four hooks:
|
||||
: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
|
||||
:param str subcode: Parsed subcode of the GCODE command, e.g. ``1`` for ``M80.1``. Will be None if no subcode was provided
|
||||
or no command could be parsed.
|
||||
:param tags: Tags attached to the command
|
||||
:return: None, 1-tuple, 2-tuple or string, see the description above for details.
|
||||
|
||||
.. _sec-plugins-hook-comm-protocol-gcode-received:
|
||||
@@ -479,7 +608,7 @@ octoprint.comm.protocol.gcode.received
|
||||
.. py:function:: gcode_received_hook(comm_instance, line, *args, **kwargs)
|
||||
|
||||
Get the returned lines sent by the printer. Handlers should return the received line or in any case, the modified
|
||||
version of it. If the the handler returns None, processing will be aborted and the communication layer will get an
|
||||
version of it. If the handler returns None, processing will be aborted and the communication layer will get an
|
||||
empty string as the received line. Note that Python functions will also automatically return ``None`` if an empty
|
||||
``return`` statement is used or just nothing is returned explicitly from the handler.
|
||||
|
||||
@@ -497,6 +626,36 @@ octoprint.comm.protocol.gcode.received
|
||||
:return: The received line or in any case, a modified version of it.
|
||||
:rtype: str
|
||||
|
||||
.. _sec-plugins-hook-comm-protocol-gcode-error:
|
||||
|
||||
octoprint.comm.protocol.gcode.error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. py:function:: gcode_error_hook(comm_instance, error_message, *args, **kwargs)
|
||||
|
||||
Get the messages of any errors messages sent by the printer, with the leading ``Error:`` or ``!!`` already
|
||||
stripped. Handlers should return True if they handled that error internally and it should not be processed by
|
||||
the system further. Normal processing of these kinds of errors - depending on the configuration of error
|
||||
handling - involves canceling the ongoing print and possibly also disconnecting.
|
||||
|
||||
Plugins might utilize this hook to handle errors generated by the printer that are recoverable in one way or
|
||||
the other and should not trigger the normal handling that assumes the worst.
|
||||
|
||||
**Example:**
|
||||
|
||||
Looks for error messages containing "fan error" or "bed missing" (ignoring case) and marks them as handled by the
|
||||
plugin.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/comm_error_handler_test.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `comm_error_handler_test.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/comm_error_handler_test.py>`_
|
||||
|
||||
:param MachineCom comm_instance: The :class:`~octoprint.util.comm.MachineCom` instance which triggered the hook.
|
||||
:param str error_message: The error message received from the printer.
|
||||
:return: True if the error was handled in the plugin and should not be processed further, False (or None) otherwise.
|
||||
:rtype: bool
|
||||
|
||||
.. _sec-plugins-hook-comm-protocol-scripts:
|
||||
|
||||
octoprint.comm.protocol.scripts
|
||||
@@ -504,19 +663,19 @@ octoprint.comm.protocol.scripts
|
||||
|
||||
.. py:function:: protocol_scripts_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
|
||||
Return a prefix to prepend, postfix to append, and optionally a dictionary of variables to provide 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
|
||||
If the hook handler has something to add to the specified script, it may return a 2-tuple or a 3-tuple with the first entry
|
||||
defining the prefix (what to *prepend* to the script in question), the second entry defining the postfix (what to
|
||||
*append* to the script in question), and finally if desired a dictionary of variables to be made available to the script. 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
|
||||
The returned prefix and postfix 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:**
|
||||
**Example 1:**
|
||||
|
||||
Appends an ``M117 OctoPrint connected`` to the configured ``afterPrinterConnected`` GCODE script.
|
||||
|
||||
@@ -525,12 +684,47 @@ octoprint.comm.protocol.scripts
|
||||
:tab-width: 4
|
||||
:caption: `message_on_connect.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/message_on_connect.py>`_
|
||||
|
||||
**Example 2:**
|
||||
|
||||
Provides the variable ``myvariable`` to the configured ``beforePrintStarted`` GCODE script.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/gcode_script_variables.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `gcode_script_variables.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/gcode_script_variables.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
|
||||
:return: A 2-tuple in the form ``(prefix, postfix)``, 3-tuple in the form ``(prefix, postfix, variables)``, or None
|
||||
:rtype: tuple or None
|
||||
|
||||
.. _sec-plugins-hook-comm-protocol-temperatures-received:
|
||||
|
||||
octoprint.comm.protocol.temperatures.received
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. py:function:: protocol_temperatures_received_hook(comm_instance, parsed_temperatures, *args, **kwargs)
|
||||
|
||||
Get the parsed temperatures returned by the printer, allowing handlers to modify them prior to handing them off
|
||||
to the system. Handlers are expected to either return ``parsed_temperatures`` as-is or a modified copy thereof.
|
||||
|
||||
``parsed_temperatures`` is a dictionary mapping from tool/bed identifier (``B``, ``T0``, ``T1``) to a 2-tuple of
|
||||
actual and target temperature, e.g. ``{'B': (45.2, 50.0), 'T0': (178.9, 210.0), 'T1': (21.3, 0.0)}``.
|
||||
|
||||
This hook can be useful in cases where a printer e.g. is prone to returning garbage data from time to time, allowing
|
||||
additional sanity checking to be applied and invalid values to be filtered out. If a handler returns an empty
|
||||
dictionary or ``None``, no further processing will take place.
|
||||
|
||||
**Example**
|
||||
|
||||
The following example shows how to filter out actual temperatures that are outside a sane range of 1°C to 300°C.
|
||||
|
||||
.. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/sanitize_temperatures.py
|
||||
:linenos:
|
||||
:tab-width: 4
|
||||
:caption: `sanitize_temperatures.py <https://github.com/OctoPrint/Plugin-Examples/blob/master/sanitize_temperatures.py>`_
|
||||
|
||||
.. _sec-plugins-hook-comm-transport-serial-factory:
|
||||
|
||||
octoprint.comm.transport.serial.factory
|
||||
@@ -657,7 +851,7 @@ octoprint.filemanager.preprocessor
|
||||
|
||||
``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`
|
||||
to wrap it further. Handlers which do not wish to handle the `file_object` should just return it untouched.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -702,7 +896,7 @@ octoprint.printer.factory
|
||||
|
||||
If the factory returns anything but ``None``, it will be assigned to the global ``printer`` instance.
|
||||
|
||||
If no of the registered factories return a printer instance, the default :class:`~octoprint.printer.standard.Printer`
|
||||
If none of the registered factories return a printer instance, the default :class:`~octoprint.printer.standard.Printer`
|
||||
class will be instantiated.
|
||||
|
||||
:param dict components: System components to use for printer instance initialization
|
||||
@@ -804,7 +998,7 @@ octoprint.server.http.routes
|
||||
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.
|
||||
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
|
||||
@@ -922,3 +1116,38 @@ octoprint.ui.web.templatetypes
|
||||
:param dict template_sorting: read-only dictionary of currently configured template sorting specifications
|
||||
:return: a list of 3-tuples (template type, rule, sorting spec)
|
||||
:rtype: list
|
||||
|
||||
.. _sec-plugins-hook-users-factory:
|
||||
|
||||
octoprint.users.factory
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. py:function:: user_manager_factory_hook(components, settings, *args, **kwargs)
|
||||
|
||||
Return a :class:`~octoprint.users.UserManager` instance to use as global user manager object. This will
|
||||
be called only once during initial server startup.
|
||||
|
||||
The provided ``components`` is a dictionary containing the already initialized system components:
|
||||
|
||||
* ``plugin_manager``: The :class:`~octoprint.plugin.core.PluginManager`
|
||||
* ``printer_profile_manager``: The :class:`~octoprint.printer.profile.PrinterProfileManager`
|
||||
* ``event_bus``: The :class:`~octoprint.events.EventManager`
|
||||
* ``analysis_queue``: The :class:`~octoprint.filemanager.analysis.AnalysisQueue`
|
||||
* ``slicing_manager``: The :class:`~octoprint.slicing.SlicingManager`
|
||||
* ``file_manager``: The :class:`~octoprint.filemanager.FileManager`
|
||||
* ``app_session_manager``: The :class:`~octoprint.server.util.flask.AppSessionManager`
|
||||
* ``plugin_lifecycle_manager``: The :class:`~octoprint.server.LifecycleManager`
|
||||
* ``preemptive_cache``: The :class:`~octoprint.server.util.flask.PreemptiveCache`
|
||||
|
||||
If the factory returns anything but ``None``, it will be assigned to the global ``userManager`` instance.
|
||||
|
||||
If none of the registered factories return a user manager instance, the class referenced by the ``config.yaml``
|
||||
entry ``accessControl.userManager`` will be initialized if possible, otherwise a stock
|
||||
:class:`~octoprint.users.FilebasedUserManager` will be instantiated, linked to the default user storage
|
||||
file ``~/.octoprint/users.yaml``.
|
||||
|
||||
:param dict components: System components to use for user manager instance initialization
|
||||
:param SettingsManager settings: The global settings manager instance to fetch configuration values from if necessary
|
||||
:return: The ``userManager`` instance to use globally.
|
||||
:rtype: UserManager subclass or None
|
||||
|
||||
@@ -45,11 +45,13 @@ An overview of these properties follows.
|
||||
OctoPrint's application session manager, an instance of :class:`octoprint.server.util.flask.AppSessionManager`.
|
||||
``self._user_manager``
|
||||
OctoPrint's user manager, an instance of :class:`octoprint.users.UserManager`.
|
||||
``self._connectivity_checker``
|
||||
OctoPrint's connectivity checker, an instance of :class:`octoprint.util.ConnectivityChecker`.
|
||||
|
||||
.. seealso::
|
||||
|
||||
:class:`~octoprint.plugin.core.Plugin` and :class:`~octoprint.plugin.types.OctoPrintPlugin`
|
||||
Class documentation also containing the properties shared among all mixing implementations.
|
||||
Class documentation also containing the properties shared among all mixin implementations.
|
||||
|
||||
:ref:`Available Mixins <sec-plugins-mixins-available>`
|
||||
Some mixin types trigger the injection of additional properties.
|
||||
|
||||
@@ -153,7 +153,7 @@ An overview of these properties can be found in the section :ref:`Injected Prope
|
||||
.. seealso::
|
||||
|
||||
:class:`~octoprint.plugin.core.Plugin` and :class:`~octoprint.plugin.types.OctoPrintPlugin`
|
||||
Class documentation also containing the properties shared among all mixing implementations.
|
||||
Class documentation also containing the properties shared among all mixin implementations.
|
||||
|
||||
.. _sec-plugins-mixins-available:
|
||||
|
||||
|
||||
+127
-3
@@ -125,7 +125,7 @@ gcodeFilesViewModel
|
||||
logViewModel
|
||||
View model for the logfile settings dialog.
|
||||
loginStateViewModel
|
||||
View model for the current loginstate of the user, very interesting for plugins that need to
|
||||
View model for the current login state 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
|
||||
View model for the navigation bar.
|
||||
@@ -168,7 +168,7 @@ OctoPrint's web application will call several callbacks on all registered view m
|
||||
Those are listed below:
|
||||
|
||||
onStartup()
|
||||
Called when the first initialization has been done: All view models are constructed and hence their dependencies
|
||||
Called when the first initialization has been done. All view models are constructed and hence their dependencies
|
||||
resolved, no bindings have been done yet.
|
||||
|
||||
onBeforeBinding()
|
||||
@@ -210,7 +210,7 @@ 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.
|
||||
component to its 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
|
||||
@@ -299,6 +299,130 @@ on your view model, taking a list of all bound view models:
|
||||
});
|
||||
})
|
||||
|
||||
.. _sec-plugins-viewmodels-livecycle:
|
||||
|
||||
Lifecycle diagrams
|
||||
------------------
|
||||
|
||||
.. _sec-plugins-viewmodels-startup:
|
||||
|
||||
Web interface startup
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mermaid::
|
||||
|
||||
sequenceDiagram
|
||||
participant Main
|
||||
participant onServerConnect
|
||||
participant fetchSettings
|
||||
participant bindViewModels
|
||||
participant DataUpdater
|
||||
participant LoginStateViewModel
|
||||
|
||||
Note right of DataUpdater: connectCallback = undefined
|
||||
|
||||
activate Main
|
||||
|
||||
Main->>+DataUpdater: connect
|
||||
Note right of DataUpdater: initialized = false
|
||||
DataUpdater-->>Main: ok
|
||||
deactivate Main
|
||||
DataUpdater->>DataUpdater: asynchronous connect to server...
|
||||
activate DataUpdater
|
||||
Note right of DataUpdater: store any callbacks instead of triggering (e.g. onServerConnect, fromHistoryData, fromCurrentData, ...)
|
||||
DataUpdater-X+Main: done
|
||||
deactivate DataUpdater
|
||||
deactivate DataUpdater
|
||||
|
||||
Main->>+DataUpdater: connectCallback = onServerConnect
|
||||
Note right of DataUpdater: connectCallback = onServerConnect
|
||||
DataUpdater-->>-Main: ok
|
||||
Main->>+onServerConnect: call
|
||||
onServerConnect->>+LoginStateViewModel: passiveLogin
|
||||
LoginStateViewModel-->>onServerConnect: ok
|
||||
onServerConnect-->>Main: ok
|
||||
deactivate onServerConnect
|
||||
deactivate Main
|
||||
|
||||
LoginStateViewModel->>+LoginStateViewModel: asynchronous passive login
|
||||
Note over Main,LoginStateViewModel: Session available!
|
||||
LoginStateViewModel-X+onServerConnect: done
|
||||
deactivate LoginStateViewModel
|
||||
deactivate LoginStateViewModel
|
||||
|
||||
onServerConnect->>+DataUpdater: initialized
|
||||
Note right of DataUpdater: initialized = true
|
||||
DataUpdater->DataUpdater: trigger stored callbacks
|
||||
DataUpdater-->>-onServerConnect: ok
|
||||
onServerConnect-X+Main: done
|
||||
deactivate onServerConnect
|
||||
|
||||
Main->>+fetchSettings: call
|
||||
Note right of fetchSettings: trigger onStartup
|
||||
|
||||
fetchSettings-->>Main: ok
|
||||
deactivate Main
|
||||
|
||||
fetchSettings->>+fetchSettings: asynchronous settings fetch
|
||||
fetchSettings->>+bindViewModels: call
|
||||
|
||||
loop for each view model
|
||||
bindViewModels->bindViewModels: trigger onBeforeBinding
|
||||
bindViewModels->bindViewModels: trigger onBoundTo
|
||||
bindViewModels->bindViewModels: trigger onAfterBinding
|
||||
end
|
||||
|
||||
bindViewModels->bindViewModels: trigger onAllBound
|
||||
opt User is logged in
|
||||
bindViewModels->>+LoginStateViewModel: onAllBound
|
||||
LoginStateViewModel->LoginStateViewModel: trigger onUserLoggedIn
|
||||
LoginStateViewModel-->>-bindViewModels: ok
|
||||
end
|
||||
bindViewModels->bindViewModels: trigger onStartupComplete
|
||||
bindViewModels-->>-fetchSettings: ok
|
||||
|
||||
deactivate fetchSettings
|
||||
deactivate fetchSettings
|
||||
|
||||
|
||||
.. _sec-plugins-viewmodels-reconnect:
|
||||
|
||||
Web interface reconnect
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. mermaid::
|
||||
|
||||
sequenceDiagram
|
||||
participant onServerConnect
|
||||
participant DataUpdater
|
||||
participant LoginStateViewModel
|
||||
|
||||
activate DataUpdater
|
||||
DataUpdater->>DataUpdater: call connectCallback
|
||||
DataUpdater->>+onServerConnect: call
|
||||
onServerConnect-->>DataUpdater: ok
|
||||
deactivate DataUpdater
|
||||
|
||||
onServerConnect->>+LoginStateViewModel: passiveLogin
|
||||
LoginStateViewModel-->>onServerConnect: ok
|
||||
deactivate onServerConnect
|
||||
LoginStateViewModel->>+LoginStateViewModel: asynchronous passive login
|
||||
Note over onServerConnect,LoginStateViewModel: Session available!
|
||||
opt User is logged in
|
||||
LoginStateViewModel->LoginStateViewModel: trigger onUserLoggedIn
|
||||
end
|
||||
|
||||
activate onServerConnect
|
||||
LoginStateViewModel-XonServerConnect: done
|
||||
deactivate LoginStateViewModel
|
||||
deactivate LoginStateViewModel
|
||||
|
||||
onServerConnect->>+DataUpdater: initialized
|
||||
DataUpdater->DataUpdater: trigger stored callbacks
|
||||
DataUpdater-->>onServerConnect: ok
|
||||
deactivate DataUpdater
|
||||
deactivate onServerConnect
|
||||
|
||||
.. seealso::
|
||||
|
||||
`OctoPrint's core viewmodels <https://github.com/foosel/OctoPrint/tree/devel/src/octoprint/static/js/app/viewmodels>`_
|
||||
|
||||
@@ -7,41 +7,99 @@ __copyright__ = "Copyright (C) 2015 Gina Häußge - Released under terms of the
|
||||
|
||||
|
||||
import codecs
|
||||
import urllib2
|
||||
import requests
|
||||
from contextlib import closing
|
||||
|
||||
from sphinx.directives import LiteralInclude, dedent_lines
|
||||
from sphinx.directives.code import LiteralIncludeReader, LiteralInclude, dedent_lines, \
|
||||
nodes, set_source_info, parselinenos, logger, container_wrapper
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
from typing import Any, List # NOQA
|
||||
|
||||
cache = dict()
|
||||
|
||||
class OnlineIncludeReader(LiteralIncludeReader):
|
||||
|
||||
def read_file(self, filename, location=None):
|
||||
# type: (unicode, Any) -> List[unicode]
|
||||
|
||||
global cache
|
||||
try:
|
||||
if filename in cache:
|
||||
lines = cache[filename]
|
||||
else:
|
||||
with closing(requests.get(filename, stream=True)) as r:
|
||||
r.encoding = self.encoding
|
||||
lines = r.text.splitlines(True)
|
||||
cache[filename] = lines
|
||||
|
||||
if 'tab-width' in self.options:
|
||||
lines = [line.expandtabs(self.options['tab-width']) for line in lines]
|
||||
|
||||
return lines
|
||||
except (IOError, OSError):
|
||||
raise IOError(_('Include file %r not found or reading it failed') % filename)
|
||||
except UnicodeError:
|
||||
raise UnicodeError(_('Encoding %r used for reading included file %r seems to '
|
||||
'be wrong, try giving an :encoding: option') %
|
||||
(self.encoding, filename))
|
||||
|
||||
|
||||
class OnlineIncludeDirective(LiteralInclude):
|
||||
|
||||
def read_with_encoding(self, filename, document, codec_info, encoding):
|
||||
global cache
|
||||
def run(self):
|
||||
# type: () -> List[nodes.Node]
|
||||
document = self.state.document
|
||||
if not document.settings.file_insertion_enabled:
|
||||
return [document.reporter.warning('File insertion disabled',
|
||||
line=self.lineno)]
|
||||
env = document.settings.env
|
||||
|
||||
# convert options['diff'] to absolute path
|
||||
if 'diff' in self.options:
|
||||
_, path = env.relfn2path(self.options['diff'])
|
||||
self.options['diff'] = path
|
||||
|
||||
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]]
|
||||
location = self.state_machine.get_source_and_line(self.lineno)
|
||||
url = self.arguments[0]
|
||||
|
||||
reader = OnlineIncludeReader(url, self.options, env.config)
|
||||
text, lines = reader.read(location=location)
|
||||
|
||||
retnode = nodes.literal_block(text, text, source=url)
|
||||
set_source_info(self, retnode)
|
||||
if self.options.get('diff'): # if diff is set, set udiff
|
||||
retnode['language'] = 'udiff'
|
||||
elif 'language' in self.options:
|
||||
retnode['language'] = self.options['language']
|
||||
retnode['linenos'] = ('linenos' in self.options or
|
||||
'lineno-start' in self.options or
|
||||
'lineno-match' in self.options)
|
||||
retnode['classes'] += self.options.get('class', [])
|
||||
extra_args = retnode['highlight_args'] = {}
|
||||
if 'emphasize-lines' in self.options:
|
||||
hl_lines = parselinenos(self.options['emphasize-lines'], lines)
|
||||
if any(i >= lines for i in hl_lines):
|
||||
logger.warning('line number spec is out of range(1-%d): %r' %
|
||||
(lines, self.options['emphasize-lines']),
|
||||
location=location)
|
||||
extra_args['hl_lines'] = [x + 1 for x in hl_lines if x < lines]
|
||||
extra_args['linenostart'] = reader.lineno_start
|
||||
|
||||
if 'caption' in self.options:
|
||||
caption = self.options['caption'] or self.arguments[0]
|
||||
retnode = container_wrapper(self, retnode, caption)
|
||||
|
||||
# retnode will be note_implicit_target that is linked from caption and numref.
|
||||
# when options['name'] is provided, it should be primary ID.
|
||||
self.add_name(retnode)
|
||||
|
||||
return [retnode]
|
||||
except Exception as exc:
|
||||
return [document.reporter.warning(str(exc), line=self.lineno)]
|
||||
|
||||
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)
|
||||
@@ -53,4 +111,4 @@ def setup(app):
|
||||
app.add_directive("onlineinclude", OnlineIncludeDirective)
|
||||
|
||||
handler = (visit_onlineinclude, depart_onlineinclude)
|
||||
app.add_node(OnlineIncludeDirective, html=handler, latex=handler, text=handler)
|
||||
app.add_node(OnlineIncludeDirective, html=handler, latex=handler, text=handler)
|
||||
@@ -7,4 +7,6 @@
|
||||
# variables INSTALL_REQUIRES and EXTRA_REQUIRES.
|
||||
###
|
||||
|
||||
# let's force the regular pypi URL, with https, just to be sure
|
||||
-i https://pypi.python.org/simple
|
||||
.
|
||||
+10
-9
@@ -13,7 +13,7 @@
|
||||
# /etc/default/octoprint.
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Sami Olmari
|
||||
# Author: Sami Olmari & Gina Häußge
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
DESC="OctoPrint Daemon"
|
||||
@@ -21,9 +21,14 @@ NAME="OctoPrint"
|
||||
PKGNAME=octoprint
|
||||
PIDFILE=/var/run/$PKGNAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$PKGNAME
|
||||
DEFAULTS=/etc/default/$PKGNAME
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$PKGNAME ] && . /etc/default/$PKGNAME
|
||||
[ -r $DEFAULTS ] && . $DEFAULTS
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
# Exit if the DAEMON is not set
|
||||
if [ -z "$DAEMON" ]
|
||||
@@ -38,10 +43,6 @@ fi
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
[ -f /etc/default/rcS ] && . /etc/default/rcS
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
if [ -z "$START" -o "$START" != "yes" ]
|
||||
then
|
||||
log_warning_msg "Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it."
|
||||
@@ -55,12 +56,12 @@ then
|
||||
fi
|
||||
|
||||
COMMAND_ARGS=
|
||||
if [ -z "$BASEDIR" ]
|
||||
if [ -n "$BASEDIR" ]
|
||||
then
|
||||
COMMAND_ARGS="--basedir $BASEDIR $COMMAND_ARGS"
|
||||
fi
|
||||
|
||||
if [ -z "$CONFIGFILE" ]
|
||||
if [ -n "$CONFIGFILE" ]
|
||||
then
|
||||
COMMAND_ARGS="--config $CONFIGFILE $COMMAND_ARGS"
|
||||
fi
|
||||
@@ -91,7 +92,7 @@ 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 --nicelevel=$NICELEVEL \
|
||||
-- $COMMAND_ARGS serve $DAEMON_ARGS
|
||||
-- serve $COMMAND_ARGS $DAEMON_ARGS
|
||||
RETVAL="$?"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ description-file = README.md
|
||||
|
||||
[versioneer]
|
||||
VCS = git
|
||||
style = pep440-post
|
||||
style = pep440-tag
|
||||
versionfile_source = src/octoprint/_version.py
|
||||
versionfile_build = octoprint/_version.py
|
||||
tag_prefix =
|
||||
|
||||
@@ -15,19 +15,22 @@ import octoprint_setuptools
|
||||
# Requirements for our application
|
||||
INSTALL_REQUIRES = [
|
||||
"flask>=0.9,<0.11",
|
||||
"Jinja2>=2.8,<2.9", # Jinja 2.9 has breaking changes WRT template scope - we can't
|
||||
# guarantee backwards compatibility for plugins and such with that
|
||||
# version, hence we need to pin to a lower version for now. See #1697
|
||||
"werkzeug>=0.8.3,<0.9",
|
||||
"tornado==4.0.2", # pinned for now, we need to migrate to a newer tornado, but due
|
||||
# to some voodoo needed to get large streamed uploads and downloads
|
||||
# to work that is probably not completely straightforward and therefore
|
||||
# something for post-1.3.0-stable release
|
||||
"sockjs-tornado>=1.0.2,<1.1",
|
||||
"sockjs-tornado>=1.0.3,<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",
|
||||
"pyserial>=2.7,<3.5",
|
||||
"netaddr>=0.7.17,<0.8",
|
||||
"watchdog>=0.8.3,<0.9",
|
||||
"sarge>=0.1.4,<0.2",
|
||||
@@ -35,29 +38,40 @@ INSTALL_REQUIRES = [
|
||||
"pylru>=1.0.9,<1.1",
|
||||
"rsa>=3.2,<3.3",
|
||||
"pkginfo>=1.2.1,<1.3",
|
||||
"requests>=2.7,<2.8",
|
||||
"requests>=2.18.4,<3",
|
||||
"semantic_version>=2.4.2,<2.5",
|
||||
"psutil>=3.2.1,<3.3",
|
||||
"psutil>=5.4.1,<6",
|
||||
"Click>=6.2,<6.3",
|
||||
"awesome-slugify>=1.6.5,<1.7",
|
||||
"feedparser>=5.2.1,<5.3",
|
||||
"chainmap>=1.0.2,<1.1",
|
||||
"future>=0.15,<0.16",
|
||||
"scandir>=1.3,<1.4"
|
||||
"scandir>=1.3,<1.4",
|
||||
"websocket-client>=0.40,<0.41",
|
||||
"python-dateutil>=2.6,<2.7",
|
||||
"wrapt>=1.10.10,<1.11",
|
||||
"futures>=3.1.1,<3.2",
|
||||
"emoji>=0.4.5,<0.5",
|
||||
"monotonic>=1.3,<1.4",
|
||||
"frozendict>=1.2,<1.3"
|
||||
]
|
||||
|
||||
if sys.platform == "darwin":
|
||||
INSTALL_REQUIRES.append("appdirs>=1.4.0")
|
||||
|
||||
# Additional requirements for optional install options
|
||||
EXTRA_REQUIRES = dict(
|
||||
# Dependencies for developing OctoPrint
|
||||
develop=[
|
||||
# Testing dependencies
|
||||
"mock>=1.0.1,<1.1",
|
||||
"mock>=2.0.0,<3",
|
||||
"nose>=1.3.0,<1.4",
|
||||
"ddt",
|
||||
|
||||
# Documentation dependencies
|
||||
"sphinx>=1.3,<1.4",
|
||||
"sphinx>=1.6,<1.7",
|
||||
"sphinxcontrib-httpdomain",
|
||||
"sphinxcontrib-mermaid>=0.3",
|
||||
"sphinx_rtd_theme",
|
||||
|
||||
# PyPi upload related
|
||||
@@ -66,7 +80,7 @@ EXTRA_REQUIRES = dict(
|
||||
|
||||
# Dependencies for developing OctoPrint plugins
|
||||
plugins=[
|
||||
"cookiecutter>=1.4,<1.5"
|
||||
"cookiecutter>=1.4,<1.7"
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
+185
-19
@@ -12,7 +12,7 @@ versions = get_versions()
|
||||
|
||||
__version__ = versions['version']
|
||||
__branch__ = versions.get('branch', None)
|
||||
__display_version__ = "{} ({} branch)".format(__version__, __branch__) if __branch__ else __version__
|
||||
__display_version__ = __version__
|
||||
__revision__ = versions.get('full-revisionid', versions.get('full', None))
|
||||
|
||||
del versions
|
||||
@@ -57,8 +57,10 @@ class FatalStartupError(BaseException):
|
||||
|
||||
def init_platform(basedir, configfile, use_logging_file=True, logging_file=None,
|
||||
logging_config=None, debug=False, verbosity=0, uncaught_logger=None,
|
||||
uncaught_handler=None, safe_mode=False, after_preinit_logging=None,
|
||||
after_settings=None, after_logging=None, after_safe_mode=None):
|
||||
uncaught_handler=None, safe_mode=False, ignore_blacklist=False, after_preinit_logging=None,
|
||||
after_settings=None, after_logging=None, after_safe_mode=None,
|
||||
after_event_manager=None, after_connectivity_checker=None,
|
||||
after_plugin_manager=None, after_environment_detector=None):
|
||||
kwargs = dict()
|
||||
|
||||
logger, recorder = preinit_logging(debug, verbosity, uncaught_logger, uncaught_handler)
|
||||
@@ -93,8 +95,34 @@ def init_platform(basedir, configfile, use_logging_file=True, logging_file=None,
|
||||
if callable(after_safe_mode):
|
||||
after_safe_mode(**kwargs)
|
||||
|
||||
plugin_manager = init_pluginsystem(settings, safe_mode=safe_mode)
|
||||
return settings, logger, safe_mode, plugin_manager
|
||||
event_manager = init_event_manager(settings)
|
||||
|
||||
kwargs["event_manager"] = event_manager
|
||||
if callable(after_event_manager):
|
||||
after_event_manager(**kwargs)
|
||||
|
||||
connectivity_checker = init_connectivity_checker(settings, event_manager)
|
||||
|
||||
kwargs["connectivity_checker"] = connectivity_checker
|
||||
if callable(after_connectivity_checker):
|
||||
after_connectivity_checker(**kwargs)
|
||||
|
||||
plugin_manager = init_pluginsystem(settings,
|
||||
safe_mode=safe_mode,
|
||||
ignore_blacklist=ignore_blacklist,
|
||||
connectivity_checker=connectivity_checker)
|
||||
kwargs["plugin_manager"] = plugin_manager
|
||||
|
||||
if callable(after_plugin_manager):
|
||||
after_plugin_manager(**kwargs)
|
||||
|
||||
environment_detector = init_environment_detector(plugin_manager)
|
||||
kwargs["environment_detector"] = environment_detector
|
||||
|
||||
if callable(after_environment_detector):
|
||||
after_environment_detector(**kwargs)
|
||||
|
||||
return settings, logger, safe_mode, event_manager, connectivity_checker, plugin_manager, environment_detector
|
||||
|
||||
|
||||
def init_settings(basedir, configfile):
|
||||
@@ -176,7 +204,7 @@ def init_logging(settings, use_logging_file=True, logging_file=None, default_con
|
||||
"stream": "ext://sys.stdout"
|
||||
},
|
||||
"file": {
|
||||
"class": "octoprint.logging.handlers.CleaningTimedRotatingFileHandler",
|
||||
"class": "octoprint.logging.handlers.OctoPrintLogHandler",
|
||||
"level": "DEBUG",
|
||||
"formatter": "simple",
|
||||
"when": "D",
|
||||
@@ -188,12 +216,13 @@ def init_logging(settings, use_logging_file=True, logging_file=None, default_con
|
||||
"level": "DEBUG",
|
||||
"formatter": "serial",
|
||||
"backupCount": 3,
|
||||
"filename": os.path.join(settings.getBaseFolder("logs"), "serial.log")
|
||||
"filename": os.path.join(settings.getBaseFolder("logs"), "serial.log"),
|
||||
"delay": True
|
||||
}
|
||||
},
|
||||
"loggers": {
|
||||
"SERIAL": {
|
||||
"level": "CRITICAL",
|
||||
"level": "INFO",
|
||||
"handlers": ["serialFile"],
|
||||
"propagate": False
|
||||
},
|
||||
@@ -221,6 +250,7 @@ def init_logging(settings, use_logging_file=True, logging_file=None, default_con
|
||||
if verbosity > 2:
|
||||
default_config["root"]["level"] = "DEBUG"
|
||||
|
||||
config = default_config
|
||||
if use_logging_file:
|
||||
# further logging configuration from file...
|
||||
if logging_file is None:
|
||||
@@ -233,9 +263,8 @@ def init_logging(settings, use_logging_file=True, logging_file=None, default_con
|
||||
config_from_file = yaml.safe_load(f)
|
||||
|
||||
# we merge that with the default config
|
||||
config = dict_merge(default_config, config_from_file)
|
||||
else:
|
||||
config = default_config
|
||||
if config_from_file is not None and isinstance(config_from_file, dict):
|
||||
config = dict_merge(default_config, config_from_file)
|
||||
|
||||
# configure logging globally
|
||||
return set_logging_config(config, debug, verbosity, uncaught_logger, uncaught_handler)
|
||||
@@ -274,27 +303,28 @@ def set_logging_config(config, debug, verbosity, uncaught_logger, uncaught_handl
|
||||
return logger
|
||||
|
||||
|
||||
def init_pluginsystem(settings, safe_mode=False):
|
||||
def init_pluginsystem(settings, safe_mode=False, ignore_blacklist=True, connectivity_checker=None):
|
||||
"""Initializes the plugin manager based on the settings."""
|
||||
|
||||
import os
|
||||
|
||||
logger = log.getLogger(__name__)
|
||||
logger = log.getLogger(__name__ + ".startup")
|
||||
|
||||
plugin_folders = [(os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "plugins")), True),
|
||||
settings.getBaseFolder("plugins")]
|
||||
plugin_entry_points = ["octoprint.plugin"]
|
||||
plugin_disabled_list = settings.get(["plugins", "_disabled"])
|
||||
|
||||
plugin_blacklist = []
|
||||
if not ignore_blacklist and settings.getBoolean(["server", "pluginBlacklist", "enabled"]):
|
||||
plugin_blacklist = get_plugin_blacklist(settings, connectivity_checker=connectivity_checker)
|
||||
|
||||
plugin_validators = []
|
||||
if safe_mode:
|
||||
def validator(phase, plugin_info):
|
||||
if phase == "after_load":
|
||||
if phase in ("before_import", "before_load", "before_enable"):
|
||||
setattr(plugin_info, "safe_mode_victim", not plugin_info.bundled)
|
||||
setattr(plugin_info, "safe_mode_enabled", False)
|
||||
elif phase == "before_enable":
|
||||
if not plugin_info.bundled:
|
||||
setattr(plugin_info, "safe_mode_enabled", True)
|
||||
return False
|
||||
return True
|
||||
plugin_validators.append(validator)
|
||||
@@ -304,13 +334,14 @@ def init_pluginsystem(settings, safe_mode=False):
|
||||
plugin_folders=plugin_folders,
|
||||
plugin_entry_points=plugin_entry_points,
|
||||
plugin_disabled_list=plugin_disabled_list,
|
||||
plugin_blacklist=plugin_blacklist,
|
||||
plugin_validators=plugin_validators)
|
||||
|
||||
settings_overlays = dict()
|
||||
disabled_from_overlays = dict()
|
||||
|
||||
def handle_plugin_loaded(name, plugin):
|
||||
if hasattr(plugin.instance, "__plugin_settings_overlay__"):
|
||||
if plugin.instance and hasattr(plugin.instance, "__plugin_settings_overlay__"):
|
||||
plugin.needs_restart = True
|
||||
|
||||
# plugin has a settings overlay, inject it
|
||||
@@ -349,7 +380,7 @@ def init_pluginsystem(settings, safe_mode=False):
|
||||
|
||||
if not addon in already_processed and not addon in disabled_list:
|
||||
disabled_list.append(addon)
|
||||
logger.info("Disabling plugin {} as defined by plugin {} through settings overlay".format(addon, name))
|
||||
logger.info("Disabling plugin {} as defined by plugin {}".format(addon, name))
|
||||
already_processed.append(name)
|
||||
|
||||
def handle_plugin_enabled(name, plugin):
|
||||
@@ -363,6 +394,141 @@ def init_pluginsystem(settings, safe_mode=False):
|
||||
pm.reload_plugins(startup=True, initialize_implementations=False)
|
||||
return pm
|
||||
|
||||
|
||||
def get_plugin_blacklist(settings, connectivity_checker=None):
|
||||
import requests
|
||||
import os
|
||||
import time
|
||||
import yaml
|
||||
|
||||
from octoprint.util import bom_aware_open
|
||||
from octoprint.util.version import is_octoprint_compatible
|
||||
|
||||
logger = log.getLogger(__name__ + ".startup")
|
||||
|
||||
if connectivity_checker is not None and not connectivity_checker.online:
|
||||
logger.info("We don't appear to be online, not fetching plugin blacklist")
|
||||
return []
|
||||
|
||||
def format_blacklist(entries):
|
||||
format_entry = lambda x: "{} ({})".format(x[0], x[1]) if isinstance(x, (list, tuple)) and len(x) == 2 \
|
||||
else "{} (any)".format(x)
|
||||
return ", ".join(map(format_entry, entries))
|
||||
|
||||
def process_blacklist(entries):
|
||||
result = []
|
||||
|
||||
if not isinstance(entries, list):
|
||||
return result
|
||||
|
||||
for entry in entries:
|
||||
if not "plugin" in entry:
|
||||
continue
|
||||
|
||||
if "octoversions" in entry and not is_octoprint_compatible(*entry["octoversions"]):
|
||||
continue
|
||||
|
||||
if "version" in entry:
|
||||
logger.debug("Blacklisted plugin: {}, version: {}".format(entry["plugin"], entry["version"]))
|
||||
result.append((entry["plugin"], entry["version"]))
|
||||
elif "versions" in entry:
|
||||
logger.debug("Blacklisted plugin: {}, versions: {}".format(entry["plugin"], ", ".join(entry["versions"])))
|
||||
for version in entry["versions"]:
|
||||
result.append((entry["plugin"], version))
|
||||
else:
|
||||
logger.debug("Blacklisted plugin: {}".format(entry["plugin"]))
|
||||
result.append(entry["plugin"])
|
||||
|
||||
return result
|
||||
|
||||
def fetch_blacklist_from_cache(path, ttl):
|
||||
if not os.path.isfile(path):
|
||||
return None
|
||||
|
||||
if os.stat(path).st_mtime + ttl < time.time():
|
||||
return None
|
||||
|
||||
with bom_aware_open(path, encoding="utf-8", mode="r") as f:
|
||||
result = yaml.safe_load(f)
|
||||
|
||||
if isinstance(result, list):
|
||||
return result
|
||||
|
||||
def fetch_blacklist_from_url(url, timeout=3, cache=None):
|
||||
result = []
|
||||
try:
|
||||
r = requests.get(url, timeout=timeout)
|
||||
result = process_blacklist(r.json())
|
||||
|
||||
if cache is not None:
|
||||
try:
|
||||
with bom_aware_open(cache, encoding="utf-8", mode="w") as f:
|
||||
yaml.safe_dump(result, f)
|
||||
except:
|
||||
logger.info("Fetched plugin blacklist but couldn't write it to its cache file.")
|
||||
except:
|
||||
logger.info("Unable to fetch plugin blacklist from {}, proceeding without it.".format(url))
|
||||
return result
|
||||
|
||||
try:
|
||||
# first attempt to fetch from cache
|
||||
cache_path = os.path.join(settings.getBaseFolder("data"), "plugin_blacklist.yaml")
|
||||
ttl = settings.getInt(["server", "pluginBlacklist", "ttl"])
|
||||
blacklist = fetch_blacklist_from_cache(cache_path, ttl)
|
||||
|
||||
if blacklist is None:
|
||||
# no result from the cache, let's fetch it fresh
|
||||
url = settings.get(["server", "pluginBlacklist", "url"])
|
||||
timeout = settings.getFloat(["server", "pluginBlacklist", "timeout"])
|
||||
blacklist = fetch_blacklist_from_url(url, timeout=timeout, cache=cache_path)
|
||||
|
||||
if blacklist is None:
|
||||
# still now result, so no blacklist
|
||||
blacklist = []
|
||||
|
||||
if blacklist:
|
||||
logger.info("Blacklist processing done, "
|
||||
"adding {} blacklisted plugin versions: {}".format(len(blacklist),
|
||||
format_blacklist(blacklist)))
|
||||
else:
|
||||
logger.info("Blacklist processing done")
|
||||
|
||||
return blacklist
|
||||
except:
|
||||
logger.exception("Something went wrong while processing the plugin blacklist. Proceeding without it.")
|
||||
|
||||
|
||||
def init_event_manager(settings):
|
||||
from octoprint.events import eventManager
|
||||
return eventManager()
|
||||
|
||||
|
||||
def init_connectivity_checker(settings, event_manager):
|
||||
from octoprint.events import Events
|
||||
from octoprint.util import ConnectivityChecker
|
||||
|
||||
# start regular check if we are connected to the internet
|
||||
connectivityEnabled = settings.getBoolean(["server", "onlineCheck", "enabled"])
|
||||
connectivityInterval = settings.getInt(["server", "onlineCheck", "interval"])
|
||||
connectivityHost = settings.get(["server", "onlineCheck", "host"])
|
||||
connectivityPort = settings.getInt(["server", "onlineCheck", "port"])
|
||||
|
||||
def on_connectivity_change(old_value, new_value):
|
||||
event_manager.fire(Events.CONNECTIVITY_CHANGED, payload=dict(old=old_value, new=new_value))
|
||||
|
||||
connectivityChecker = ConnectivityChecker(connectivityInterval,
|
||||
connectivityHost,
|
||||
port=connectivityPort,
|
||||
enabled=connectivityEnabled,
|
||||
on_change=on_connectivity_change)
|
||||
|
||||
return connectivityChecker
|
||||
|
||||
|
||||
def init_environment_detector(plugin_manager):
|
||||
from octoprint.environment import EnvironmentDetector
|
||||
return EnvironmentDetector(plugin_manager)
|
||||
|
||||
#~~ server main method
|
||||
|
||||
def main():
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env python2
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
if __name__ == "__main__":
|
||||
import octoprint
|
||||
octoprint.main()
|
||||
@@ -305,7 +305,6 @@ def git_parse_lookup_file(path):
|
||||
if not os.path.exists(path):
|
||||
return []
|
||||
|
||||
import re
|
||||
lookup = []
|
||||
with open(path, "r") as f:
|
||||
for line in f:
|
||||
|
||||
@@ -7,6 +7,7 @@ __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms
|
||||
|
||||
import click
|
||||
import octoprint
|
||||
import sys
|
||||
|
||||
#~~ click context
|
||||
|
||||
@@ -47,15 +48,25 @@ def hidden_option(*param_decls, **attrs):
|
||||
return f
|
||||
return decorator
|
||||
|
||||
#~~ helper for settings context options
|
||||
#~~ helper for setting context options
|
||||
|
||||
def set_ctx_obj_option(ctx, param, value):
|
||||
"""Helper for setting eager options on the context."""
|
||||
if ctx.obj is None:
|
||||
ctx.obj = OctoPrintContext()
|
||||
|
||||
if hasattr(ctx.obj, param.name):
|
||||
if value != param.default:
|
||||
setattr(ctx.obj, param.name, value)
|
||||
elif param.default is not None:
|
||||
setattr(ctx.obj, param.name, param.default)
|
||||
|
||||
#~~ helper for retrieving context options
|
||||
|
||||
def get_ctx_obj_option(ctx, key, default, include_parents=True):
|
||||
if include_parents and hasattr(ctx, "parent") and ctx.parent:
|
||||
fallback = get_ctx_obj_option(ctx.parent, key, default)
|
||||
else:
|
||||
fallback = default
|
||||
return getattr(ctx.obj, key, fallback)
|
||||
|
||||
#~~ helper for setting a lot of bulk options
|
||||
|
||||
@@ -91,13 +102,13 @@ def standard_options(hidden=False):
|
||||
|
||||
options = [
|
||||
factory("--basedir", "-b", type=click.Path(), callback=set_ctx_obj_option, is_eager=True, expose_value=False,
|
||||
help="Specify the basedir to use for uploads, timelapses etc."),
|
||||
help="Specify the basedir to use for configs, uploads, timelapses etc."),
|
||||
factory("--config", "-c", "configfile", type=click.Path(), callback=set_ctx_obj_option, is_eager=True, expose_value=False,
|
||||
help="Specify the config file to use."),
|
||||
factory("--verbose", "-v", "verbosity", count=True, callback=set_ctx_obj_option, is_eager=True, expose_value=False,
|
||||
help="Increase logging verbosity"),
|
||||
help="Increase logging verbosity."),
|
||||
factory("--safe", "safe_mode", is_flag=True, callback=set_ctx_obj_option, is_eager=True, expose_value=False,
|
||||
help="Enable safe mode; disables all third party plugins")
|
||||
help="Enable safe mode; disables all third party plugins.")
|
||||
]
|
||||
|
||||
return bulk_options(options)
|
||||
@@ -105,13 +116,14 @@ def standard_options(hidden=False):
|
||||
#~~ helper for settings legacy options we still have to support on "octoprint"
|
||||
|
||||
legacy_options = bulk_options([
|
||||
hidden_option("--host", type=click.STRING),
|
||||
hidden_option("--port", type=click.INT),
|
||||
hidden_option("--logging", type=click.Path()),
|
||||
hidden_option("--debug", "-d", is_flag=True),
|
||||
hidden_option("--daemon", type=click.Choice(["start", "stop", "restart"])),
|
||||
hidden_option("--pid", type=click.Path(), default="/tmp/octoprint.pid"),
|
||||
hidden_option("--iknowwhatimdoing", "allow_root", is_flag=True),
|
||||
hidden_option("--host", type=click.STRING, callback=set_ctx_obj_option),
|
||||
hidden_option("--port", type=click.INT, callback=set_ctx_obj_option),
|
||||
hidden_option("--logging", type=click.Path(), callback=set_ctx_obj_option),
|
||||
hidden_option("--debug", "-d", is_flag=True, callback=set_ctx_obj_option),
|
||||
hidden_option("--daemon", type=click.Choice(["start", "stop", "restart"]), callback=set_ctx_obj_option),
|
||||
hidden_option("--pid", type=click.Path(), default="/tmp/octoprint.pid", callback=set_ctx_obj_option),
|
||||
hidden_option("--iknowwhatimdoing", "allow_root", is_flag=True, callback=set_ctx_obj_option),
|
||||
hidden_option("--ignore-blacklist", "ignore_blacklist", is_flag=True, callback=set_ctx_obj_option)
|
||||
])
|
||||
"""Legacy options available directly on the "octoprint" command in earlier versions.
|
||||
Kept available for reasons of backwards compatibility, but hidden from the
|
||||
@@ -124,14 +136,15 @@ from .plugins import plugin_commands
|
||||
from .dev import dev_commands
|
||||
from .client import client_commands
|
||||
from .config import config_commands
|
||||
from .analysis import analysis_commands
|
||||
|
||||
@click.group(name="octoprint", invoke_without_command=True, cls=click.CommandCollection,
|
||||
sources=[server_commands, plugin_commands, dev_commands, client_commands, config_commands])
|
||||
sources=[server_commands, plugin_commands, dev_commands, client_commands, config_commands, analysis_commands])
|
||||
@standard_options()
|
||||
@legacy_options
|
||||
@click.version_option(version=octoprint.__version__)
|
||||
@click.version_option(version=octoprint.__version__, allow_from_autoenv=False)
|
||||
@click.pass_context
|
||||
def octo(ctx, debug, host, port, logging, daemon, pid, allow_root):
|
||||
def octo(ctx, **kwargs):
|
||||
|
||||
if ctx.invoked_subcommand is None:
|
||||
# We have to support calling the octoprint command without any
|
||||
@@ -140,16 +153,23 @@ def octo(ctx, debug, host, port, logging, daemon, pid, allow_root):
|
||||
# But better print a message to inform people that they should
|
||||
# use the sub commands instead.
|
||||
|
||||
def get_value(key):
|
||||
return get_ctx_obj_option(ctx, key, kwargs.get(key))
|
||||
daemon = get_value("daemon")
|
||||
|
||||
if daemon:
|
||||
click.echo("Daemon operation via \"octoprint --daemon "
|
||||
"start|stop|restart\" is deprecated, please use "
|
||||
"\"octoprint daemon start|stop|restart\" from now on")
|
||||
|
||||
from octoprint.cli.server import daemon_command
|
||||
ctx.invoke(daemon_command, debug=debug, pid=pid, daemon=daemon, allow_root=allow_root)
|
||||
if sys.platform == "win32" or sys.platform == "darwin":
|
||||
click.echo("Sorry, daemon mode is not supported under your operating system right now")
|
||||
else:
|
||||
from octoprint.cli.server import daemon_command
|
||||
ctx.invoke(daemon_command, command=daemon, **kwargs)
|
||||
else:
|
||||
click.echo("Starting the server via \"octoprint\" is deprecated, "
|
||||
"please use \"octoprint serve\" from now on.")
|
||||
|
||||
from octoprint.cli.server import serve_command
|
||||
ctx.invoke(serve_command, debug=debug, host=host, port=port, logging=logging, allow_root=allow_root)
|
||||
ctx.invoke(serve_command, **kwargs)
|
||||
@@ -0,0 +1,73 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
__copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||
|
||||
import click
|
||||
|
||||
#~~ "octoprint util" commands
|
||||
|
||||
@click.group()
|
||||
def analysis_commands():
|
||||
pass
|
||||
|
||||
@analysis_commands.group(name="analysis")
|
||||
def util():
|
||||
"""Analysis tools."""
|
||||
pass
|
||||
|
||||
|
||||
@util.command(name="gcode")
|
||||
@click.option("--throttle", "throttle", type=float, default=None)
|
||||
@click.option("--throttle-lines", "throttle_lines", type=int, default=None)
|
||||
@click.option("--speed-x", "speedx", type=float, default=6000)
|
||||
@click.option("--speed-y", "speedy", type=float, default=6000)
|
||||
@click.option("--speed-z", "speedz", type=float, default=300)
|
||||
@click.option("--offset", "offset", type=(float, float), multiple=True)
|
||||
@click.option("--max-t", "maxt", type=int, default=10)
|
||||
@click.option("--g90-extruder", "g90_extruder", is_flag=True)
|
||||
@click.option("--progress", "progress", is_flag=True)
|
||||
@click.argument("path", type=click.Path())
|
||||
def gcode_command(path, speedx, speedy, speedz, offset, maxt, throttle, throttle_lines, g90_extruder, progress):
|
||||
"""Runs a GCODE file analysis."""
|
||||
|
||||
import time
|
||||
import yaml
|
||||
from octoprint.util.gcodeInterpreter import gcode
|
||||
|
||||
throttle_callback = None
|
||||
if throttle:
|
||||
def throttle_callback(filePos, readBytes):
|
||||
if filePos % throttle_lines == 0:
|
||||
# only apply throttle every $throttle_lines lines
|
||||
time.sleep(throttle)
|
||||
|
||||
offsets = offset
|
||||
if offsets is None:
|
||||
offsets = []
|
||||
elif isinstance(offset, tuple):
|
||||
offsets = list(offsets)
|
||||
offsets = [(0, 0)] + offsets
|
||||
if len(offsets) < maxt:
|
||||
offsets += [(0, 0)] * (maxt - len(offsets))
|
||||
|
||||
start_time = time.time()
|
||||
|
||||
progress_callback = None
|
||||
if progress:
|
||||
def progress_callback(percentage):
|
||||
click.echo("PROGRESS:{}".format(percentage))
|
||||
interpreter = gcode(progress_callback=progress_callback)
|
||||
|
||||
interpreter.load(path,
|
||||
speedx=speedx,
|
||||
speedy=speedy,
|
||||
offsets=offsets,
|
||||
throttle=throttle_callback,
|
||||
max_extruders=maxt,
|
||||
g90_extruder=g90_extruder)
|
||||
|
||||
click.echo("DONE:{}s".format(time.time() - start_time))
|
||||
click.echo("RESULTS:")
|
||||
click.echo(yaml.safe_dump(interpreter.get_result(), default_flow_style=False, indent=" ", allow_unicode=True))
|
||||
+90
-33
@@ -9,7 +9,7 @@ import json
|
||||
|
||||
import octoprint_client
|
||||
|
||||
from octoprint.cli import pass_octoprint_ctx, bulk_options, standard_options
|
||||
from octoprint.cli import get_ctx_obj_option, bulk_options
|
||||
from octoprint import init_settings, FatalStartupError
|
||||
|
||||
|
||||
@@ -23,25 +23,66 @@ class JsonStringParamType(click.ParamType):
|
||||
self.fail("%s is not a valid json string" % value, param, ctx)
|
||||
|
||||
|
||||
def create_client(settings=None, apikey=None, host=None, port=None, httpuser=None, httppass=None, https=False, prefix=None):
|
||||
assert(host is not None or settings is not None)
|
||||
assert(port is not None or settings is not None)
|
||||
assert(apikey is not None or settings is not None)
|
||||
|
||||
if not host:
|
||||
host = settings.get(["server", "host"])
|
||||
host = host if host != "0.0.0.0" else "127.0.0.1"
|
||||
if not port:
|
||||
port = settings.getInt(["server", "port"])
|
||||
|
||||
if not apikey:
|
||||
apikey = settings.get(["api", "key"])
|
||||
|
||||
baseurl = octoprint_client.build_base_url(https=https,
|
||||
httpuser=httpuser,
|
||||
httppass=httppass,
|
||||
host=host,
|
||||
port=port,
|
||||
prefix=prefix)
|
||||
|
||||
return octoprint_client.Client(baseurl, apikey)
|
||||
|
||||
|
||||
client_options = bulk_options([
|
||||
click.option("--apikey", "-a", type=click.STRING),
|
||||
click.option("--host", "-h", type=click.STRING),
|
||||
click.option("--port", "-p", type=click.INT),
|
||||
click.option("--httpuser", type=click.STRING),
|
||||
click.option("--httppass", type=click.STRING),
|
||||
click.option("--https", is_flag=True),
|
||||
click.option("--prefix", type=click.STRING)
|
||||
])
|
||||
"""Common options to configure an API client."""
|
||||
|
||||
|
||||
@click.group()
|
||||
def client_commands():
|
||||
pass
|
||||
|
||||
|
||||
@client_commands.group("client", context_settings=dict(ignore_unknown_options=True))
|
||||
@click.option("--host", "-h", type=click.STRING)
|
||||
@click.option("--port", "-p", type=click.INT)
|
||||
@click.option("--httpuser", type=click.STRING)
|
||||
@click.option("--httppass", type=click.STRING)
|
||||
@click.option("--https", is_flag=True)
|
||||
@click.option("--prefix", type=click.STRING)
|
||||
@pass_octoprint_ctx
|
||||
@client_options
|
||||
@click.pass_context
|
||||
def client(ctx, obj, host, port, httpuser, httppass, https, prefix):
|
||||
def client(ctx, apikey, host, port, httpuser, httppass, https, prefix):
|
||||
"""Basic API client."""
|
||||
try:
|
||||
obj.settings = init_settings(obj.basedir, obj.configfile)
|
||||
octoprint_client.init_client(obj.settings, https=https, httpuser=httpuser, httppass=httppass, host=host, port=port, prefix=prefix)
|
||||
settings = None
|
||||
if not host or not port or not apikey:
|
||||
settings = init_settings(get_ctx_obj_option(ctx, "basedir", None), get_ctx_obj_option(ctx, "configfile", None))
|
||||
|
||||
ctx.obj.client = create_client(settings=settings,
|
||||
apikey=apikey,
|
||||
host=host,
|
||||
port=port,
|
||||
httpuser=httpuser,
|
||||
httppass=httppass,
|
||||
https=https,
|
||||
prefix=prefix)
|
||||
|
||||
except FatalStartupError as e:
|
||||
click.echo(e.message, err=True)
|
||||
click.echo("There was a fatal error initializing the client.", err=True)
|
||||
@@ -61,27 +102,33 @@ def log_response(response, status_code=True, body=True, headers=False):
|
||||
|
||||
@client.command("get")
|
||||
@click.argument("path")
|
||||
def get(path):
|
||||
@click.option("--timeout", type=float, default=None)
|
||||
@click.pass_context
|
||||
def get(ctx, path, timeout):
|
||||
"""Performs a GET request against the specified server path."""
|
||||
r = octoprint_client.get(path)
|
||||
r = ctx.obj.client.get(path, timeout=timeout)
|
||||
log_response(r)
|
||||
|
||||
|
||||
@client.command("post_json")
|
||||
@click.argument("path")
|
||||
@click.argument("data", type=JsonStringParamType())
|
||||
def post_json(path, data):
|
||||
@click.option("--timeout", type=float, default=None)
|
||||
@click.pass_context
|
||||
def post_json(ctx, path, data, timeout):
|
||||
"""POSTs JSON data to the specified server path."""
|
||||
r = octoprint_client.post_json(path, data)
|
||||
r = ctx.obj.client.post_json(path, data, timeout=timeout)
|
||||
log_response(r)
|
||||
|
||||
|
||||
@client.command("patch_json")
|
||||
@click.argument("path")
|
||||
@click.argument("data", type=JsonStringParamType())
|
||||
def patch_json(path, data):
|
||||
@click.option("--timeout", type=float, default=None, help="Request timeout in seconds")
|
||||
@click.pass_context
|
||||
def patch_json(ctx, path, data, timeout):
|
||||
"""PATCHes JSON data to the specified server path."""
|
||||
r = octoprint_client.patch(path, data, encoding="json")
|
||||
r = ctx.obj.client.patch(path, data, encoding="json", timeout=timeout)
|
||||
log_response(r)
|
||||
|
||||
|
||||
@@ -90,8 +137,10 @@ def patch_json(path, data):
|
||||
@click.argument("file_path", type=click.Path(exists=True, dir_okay=False, resolve_path=True))
|
||||
@click.option("--json", is_flag=True)
|
||||
@click.option("--yaml", is_flag=True)
|
||||
def post_from_file(path, file_path, json_flag, yaml_flag):
|
||||
"""POSTs JSON data to the specified server path."""
|
||||
@click.option("--timeout", type=float, default=None, help="Request timeout in seconds")
|
||||
@click.pass_context
|
||||
def post_from_file(ctx, path, file_path, json_flag, yaml_flag, timeout):
|
||||
"""POSTs JSON data to the specified server path, taking the data from the specified file."""
|
||||
if json_flag or yaml_flag:
|
||||
if json_flag:
|
||||
with open(file_path, "rb") as fp:
|
||||
@@ -101,12 +150,12 @@ def post_from_file(path, file_path, json_flag, yaml_flag):
|
||||
with open(file_path, "rb") as fp:
|
||||
data = yaml.safe_load(fp)
|
||||
|
||||
r = octoprint_client.post_json(path, data)
|
||||
r = ctx.obj.client.post_json(path, data, timeout=timeout)
|
||||
else:
|
||||
with open(file_path, "rb") as fp:
|
||||
data = fp.read()
|
||||
|
||||
r = octoprint_client.post(path, data)
|
||||
r = ctx.obj.client.post(path, data, timeout=timeout)
|
||||
|
||||
log_response(r)
|
||||
|
||||
@@ -118,13 +167,15 @@ def post_from_file(path, file_path, json_flag, yaml_flag):
|
||||
@click.option("--int", "-i", "int_params", multiple=True, nargs=2, type=click.Tuple([unicode, int]))
|
||||
@click.option("--float", "-f", "float_params", multiple=True, nargs=2, type=click.Tuple([unicode, float]))
|
||||
@click.option("--bool", "-b", "bool_params", multiple=True, nargs=2, type=click.Tuple([unicode, bool]))
|
||||
def command(path, command, str_params, int_params, float_params, bool_params):
|
||||
@click.option("--timeout", type=float, default=None, help="Request timeout in seconds")
|
||||
@click.pass_context
|
||||
def command(ctx, path, command, str_params, int_params, float_params, bool_params, timeout):
|
||||
"""Sends a JSON command to the specified server path."""
|
||||
data = dict()
|
||||
params = str_params + int_params + float_params + bool_params
|
||||
for param in params:
|
||||
data[param[0]] = param[1]
|
||||
r = octoprint_client.post_command(path, command, additional=data)
|
||||
r = ctx.obj.client.post_command(path, command, additional=data, timeout=timeout)
|
||||
log_response(r, body=False)
|
||||
|
||||
|
||||
@@ -134,26 +185,32 @@ def command(path, command, str_params, int_params, float_params, bool_params):
|
||||
@click.option("--parameter", "-P", "params", multiple=True, nargs=2, type=click.Tuple([unicode, unicode]))
|
||||
@click.option("--file-name", type=click.STRING)
|
||||
@click.option("--content-type", type=click.STRING)
|
||||
def upload(path, file_path, params, file_name, content_type):
|
||||
@click.option("--timeout", type=float, default=None, help="Request timeout in seconds")
|
||||
@click.pass_context
|
||||
def upload(ctx, path, file_path, params, file_name, content_type, timeout):
|
||||
"""Uploads the specified file to the specified server path."""
|
||||
data = dict()
|
||||
for param in params:
|
||||
data[param[0]] = param[1]
|
||||
|
||||
r = octoprint_client.upload(path, file_path, additional=data, file_name=file_name, content_type=content_type)
|
||||
r = ctx.obj.client.upload(path, file_path,
|
||||
additional=data, file_name=file_name, content_type=content_type, timeout=timeout)
|
||||
log_response(r)
|
||||
|
||||
|
||||
@client.command("delete")
|
||||
@click.argument("path")
|
||||
def delete(path):
|
||||
@click.option("--timeout", type=float, default=None, help="Request timeout in seconds")
|
||||
@click.pass_context
|
||||
def delete(ctx, path, timeout):
|
||||
"""Sends a DELETE request to the specified server path."""
|
||||
r = octoprint_client.delete(path)
|
||||
r = ctx.obj.client.delete(path, timeout=timeout)
|
||||
log_response(r)
|
||||
|
||||
|
||||
@client.command("listen")
|
||||
def listen():
|
||||
@click.pass_context
|
||||
def listen(ctx):
|
||||
def on_connect(ws):
|
||||
click.echo(">>> Connected!")
|
||||
|
||||
@@ -169,11 +226,11 @@ def listen():
|
||||
def on_message(ws, message_type, message_payload):
|
||||
click.echo("Message: {}, Payload: {}".format(message_type, json.dumps(message_payload)))
|
||||
|
||||
socket = octoprint_client.connect_socket(on_connect=on_connect,
|
||||
on_close=on_close,
|
||||
on_error=on_error,
|
||||
on_heartbeat=on_heartbeat,
|
||||
on_message=on_message)
|
||||
socket = ctx.obj.client.create_socket(on_connect=on_connect,
|
||||
on_close=on_close,
|
||||
on_error=on_error,
|
||||
on_heartbeat=on_heartbeat,
|
||||
on_message=on_message)
|
||||
|
||||
click.echo(">>> Waiting for client to exit")
|
||||
try:
|
||||
|
||||
+47
-27
@@ -9,7 +9,7 @@ import click
|
||||
import logging
|
||||
|
||||
from octoprint import init_settings, FatalStartupError
|
||||
from octoprint.cli import pass_octoprint_ctx, standard_options, bulk_options
|
||||
from octoprint.cli import standard_options, bulk_options, get_ctx_obj_option
|
||||
|
||||
import yaml
|
||||
import json
|
||||
@@ -46,16 +46,15 @@ def config_commands():
|
||||
pass
|
||||
|
||||
@config_commands.group(name="config")
|
||||
@pass_octoprint_ctx
|
||||
@click.pass_context
|
||||
def config(ctx, obj):
|
||||
def config(ctx):
|
||||
"""Basic config manipulation."""
|
||||
logging.basicConfig(level=logging.DEBUG if obj.verbosity > 0 else logging.WARN)
|
||||
logging.basicConfig(level=logging.DEBUG if get_ctx_obj_option(ctx, "verbosity", 0) > 0 else logging.WARN)
|
||||
try:
|
||||
obj.settings = init_settings(obj.basedir, obj.configfile)
|
||||
ctx.obj.settings = init_settings(get_ctx_obj_option(ctx, "basedir", None), get_ctx_obj_option(ctx, "configfile", None))
|
||||
except FatalStartupError as e:
|
||||
click.echo(e.message, err=True)
|
||||
click.echo("There was a fatal error initializing the client.", err=True)
|
||||
click.echo("There was a fatal error initializing the settings manager.", err=True)
|
||||
ctx.exit(-1)
|
||||
|
||||
|
||||
@@ -71,9 +70,8 @@ def config(ctx, obj):
|
||||
help="Interpret value as int")
|
||||
@click.option("--json", "as_json", is_flag=True,
|
||||
help="Parse value from json")
|
||||
@pass_octoprint_ctx
|
||||
@click.pass_context
|
||||
def set_command(ctx, obj, path, value, as_bool, as_float, as_int, as_json):
|
||||
def set_command(ctx, path, value, as_bool, as_float, as_int, as_json):
|
||||
"""Sets a config path to the provided value."""
|
||||
if as_json:
|
||||
try:
|
||||
@@ -90,16 +88,16 @@ def set_command(ctx, obj, path, value, as_bool, as_float, as_int, as_json):
|
||||
elif as_int:
|
||||
data_type = int
|
||||
|
||||
_set_helper(obj.settings, path, value, data_type=data_type)
|
||||
_set_helper(ctx.obj.settings, path, value, data_type=data_type)
|
||||
|
||||
|
||||
@config.command(name="remove")
|
||||
@standard_options(hidden=True)
|
||||
@click.argument("path", type=click.STRING)
|
||||
@pass_octoprint_ctx
|
||||
def remove_command(obj, path):
|
||||
@click.pass_context
|
||||
def remove_command(ctx, path):
|
||||
"""Removes a config path."""
|
||||
_set_helper(obj.settings, path, None)
|
||||
_set_helper(ctx.obj.settings, path, None)
|
||||
|
||||
|
||||
@config.command(name="append_value")
|
||||
@@ -107,9 +105,8 @@ def remove_command(obj, path):
|
||||
@click.argument("path", type=click.STRING)
|
||||
@click.argument("value", type=click.STRING)
|
||||
@click.option("--json", "as_json", is_flag=True)
|
||||
@pass_octoprint_ctx
|
||||
@click.pass_context
|
||||
def append_value_command(ctx, obj, path, value, as_json=False):
|
||||
def append_value_command(ctx, path, value, as_json=False):
|
||||
"""Appends value to list behind config path."""
|
||||
path = _to_settings_path(path)
|
||||
|
||||
@@ -120,7 +117,7 @@ def append_value_command(ctx, obj, path, value, as_json=False):
|
||||
click.echo(e.message, err=True)
|
||||
ctx.exit(-1)
|
||||
|
||||
current = obj.settings.get(path)
|
||||
current = ctx.obj.settings.get(path)
|
||||
if current is None:
|
||||
current = []
|
||||
if not isinstance(current, list):
|
||||
@@ -128,7 +125,7 @@ def append_value_command(ctx, obj, path, value, as_json=False):
|
||||
ctx.exit(-1)
|
||||
|
||||
current.append(value)
|
||||
_set_helper(obj.settings, path, current)
|
||||
_set_helper(ctx.obj.settings, path, current)
|
||||
|
||||
|
||||
@config.command(name="insert_value")
|
||||
@@ -137,9 +134,8 @@ def append_value_command(ctx, obj, path, value, as_json=False):
|
||||
@click.argument("index", type=click.INT)
|
||||
@click.argument("value", type=click.STRING)
|
||||
@click.option("--json", "as_json", is_flag=True)
|
||||
@pass_octoprint_ctx
|
||||
@click.pass_context
|
||||
def insert_value_command(ctx, obj, path, index, value, as_json=False):
|
||||
def insert_value_command(ctx, path, index, value, as_json=False):
|
||||
"""Inserts value at index of list behind config key."""
|
||||
path = _to_settings_path(path)
|
||||
|
||||
@@ -150,7 +146,7 @@ def insert_value_command(ctx, obj, path, index, value, as_json=False):
|
||||
click.echo(e.message, err=True)
|
||||
ctx.exit(-1)
|
||||
|
||||
current = obj.settings.get(path)
|
||||
current = ctx.obj.settings.get(path)
|
||||
if current is None:
|
||||
current = []
|
||||
if not isinstance(current, list):
|
||||
@@ -158,7 +154,7 @@ def insert_value_command(ctx, obj, path, index, value, as_json=False):
|
||||
ctx.exit(-1)
|
||||
|
||||
current.insert(index, value)
|
||||
_set_helper(obj.settings, path, current)
|
||||
_set_helper(ctx.obj.settings, path, current)
|
||||
|
||||
|
||||
@config.command(name="remove_value")
|
||||
@@ -166,9 +162,8 @@ def insert_value_command(ctx, obj, path, index, value, as_json=False):
|
||||
@click.argument("path", type=click.STRING)
|
||||
@click.argument("value", type=click.STRING)
|
||||
@click.option("--json", "as_json", is_flag=True)
|
||||
@pass_octoprint_ctx
|
||||
@click.pass_context
|
||||
def remove_value_command(ctx, obj, path, value, as_json=False):
|
||||
def remove_value_command(ctx, path, value, as_json=False):
|
||||
"""Removes value from list at config path."""
|
||||
path = _to_settings_path(path)
|
||||
|
||||
@@ -179,7 +174,7 @@ def remove_value_command(ctx, obj, path, value, as_json=False):
|
||||
click.echo(e.message, err=True)
|
||||
ctx.exit(-1)
|
||||
|
||||
current = obj.settings.get(path)
|
||||
current = ctx.obj.settings.get(path)
|
||||
if current is None:
|
||||
current = []
|
||||
if not isinstance(current, list):
|
||||
@@ -191,7 +186,7 @@ def remove_value_command(ctx, obj, path, value, as_json=False):
|
||||
ctx.exit()
|
||||
|
||||
current.remove(value)
|
||||
_set_helper(obj.settings, path, current)
|
||||
_set_helper(ctx.obj.settings, path, current)
|
||||
|
||||
|
||||
@config.command(name="get")
|
||||
@@ -203,11 +198,11 @@ def remove_value_command(ctx, obj, path, value, as_json=False):
|
||||
@click.option("--raw", "as_raw", is_flag=True,
|
||||
help="Output value as raw string representation")
|
||||
@standard_options(hidden=True)
|
||||
@pass_octoprint_ctx
|
||||
def get_command(obj, path, as_json=False, as_yaml=False, as_raw=False):
|
||||
@click.pass_context
|
||||
def get_command(ctx, path, as_json=False, as_yaml=False, as_raw=False):
|
||||
"""Retrieves value from config path."""
|
||||
path = _to_settings_path(path)
|
||||
value = obj.settings.get(path, merged=True)
|
||||
value = ctx.obj.settings.get(path, merged=True)
|
||||
|
||||
if as_json:
|
||||
output = json.dumps(value)
|
||||
@@ -219,3 +214,28 @@ def get_command(obj, path, as_json=False, as_yaml=False, as_raw=False):
|
||||
output = pprint.pformat(value)
|
||||
|
||||
click.echo(output)
|
||||
|
||||
|
||||
@config.command(name="effective")
|
||||
@click.option("--json", "as_json", is_flag=True,
|
||||
help="Output value formatted as JSON")
|
||||
@click.option("--yaml", "as_yaml", is_flag=True,
|
||||
help="Output value formatted as YAML")
|
||||
@click.option("--raw", "as_raw", is_flag=True,
|
||||
help="Output value as raw string representation")
|
||||
@standard_options(hidden=True)
|
||||
@click.pass_context
|
||||
def effective_command(ctx, as_json=False, as_yaml=False, as_raw=False):
|
||||
"""Retrieves the full effective config."""
|
||||
value = ctx.obj.settings.effective
|
||||
|
||||
if as_json:
|
||||
output = json.dumps(value)
|
||||
elif as_yaml:
|
||||
output = yaml.safe_dump(value, default_flow_style=False, indent=" ", allow_unicode=True)
|
||||
elif as_raw:
|
||||
output = value
|
||||
else:
|
||||
output = pprint.pformat(value)
|
||||
|
||||
click.echo(output)
|
||||
@@ -8,6 +8,8 @@ __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms
|
||||
|
||||
import click
|
||||
|
||||
from past.builtins import basestring
|
||||
|
||||
class OctoPrintDevelCommands(click.MultiCommand):
|
||||
"""
|
||||
Custom `click.MultiCommand <http://click.pocoo.org/5/api/#click.MultiCommand>`_
|
||||
@@ -204,7 +206,7 @@ class OctoPrintDevelCommands(click.MultiCommand):
|
||||
click.echo("This doesn't look like an OctoPrint plugin folder")
|
||||
sys.exit(1)
|
||||
|
||||
self.command_caller.call([sys.executable, "setup.py", "develop"], cwd=path)
|
||||
self.command_caller.call([sys.executable, "-m", "pip", "install", "-e", "."], cwd=path)
|
||||
|
||||
return command
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms
|
||||
import click
|
||||
import logging
|
||||
|
||||
from octoprint.cli import pass_octoprint_ctx, OctoPrintContext
|
||||
from octoprint.cli import pass_octoprint_ctx, OctoPrintContext, get_ctx_obj_option
|
||||
|
||||
#~~ "octoprint plugin:command" commands
|
||||
|
||||
@@ -43,6 +43,7 @@ class OctoPrintPluginCommands(click.MultiCommand):
|
||||
if self._initialized:
|
||||
return
|
||||
|
||||
click.echo("Initializing settings & plugin subsystem...")
|
||||
if ctx.obj is None:
|
||||
ctx.obj = OctoPrintContext()
|
||||
|
||||
@@ -50,8 +51,9 @@ class OctoPrintPluginCommands(click.MultiCommand):
|
||||
# context (basedir and configfile)
|
||||
from octoprint import init_settings, init_pluginsystem, FatalStartupError
|
||||
try:
|
||||
self.settings = init_settings(ctx.obj.basedir, ctx.obj.configfile)
|
||||
self.plugin_manager = init_pluginsystem(self.settings, safe_mode=ctx.obj.safe_mode)
|
||||
self.settings = init_settings(get_ctx_obj_option(ctx, "basedir", None), get_ctx_obj_option(ctx, "configfile", None))
|
||||
self.plugin_manager = init_pluginsystem(self.settings,
|
||||
safe_mode=get_ctx_obj_option(ctx, "safe_mode", False))
|
||||
except FatalStartupError as e:
|
||||
click.echo(e.message, err=True)
|
||||
click.echo("There was a fatal error initializing the settings or the plugin system.", err=True)
|
||||
@@ -60,6 +62,8 @@ class OctoPrintPluginCommands(click.MultiCommand):
|
||||
# fetch registered hooks
|
||||
self.hooks = self.plugin_manager.get_hooks("octoprint.cli.commands")
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG if ctx.obj.verbosity > 0 else logging.WARN)
|
||||
|
||||
self._initialized = True
|
||||
|
||||
def list_commands(self, ctx):
|
||||
@@ -88,14 +92,14 @@ class OctoPrintPluginCommands(click.MultiCommand):
|
||||
continue
|
||||
result[name + self.sep + command.name] = command
|
||||
except:
|
||||
self._logger.exception("Error while retrieving cli commants for plugin {}".format(name))
|
||||
self._logger.exception("Error while retrieving cli commands for plugin {}".format(name))
|
||||
|
||||
return result
|
||||
|
||||
@click.group()
|
||||
@pass_octoprint_ctx
|
||||
def plugin_commands(obj):
|
||||
logging.basicConfig(level=logging.DEBUG if obj.verbosity > 0 else logging.WARN)
|
||||
pass
|
||||
|
||||
@plugin_commands.group(name="plugins", cls=OctoPrintPluginCommands)
|
||||
def plugins():
|
||||
|
||||
+172
-74
@@ -9,28 +9,33 @@ import click
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from octoprint.cli import pass_octoprint_ctx, bulk_options, standard_options
|
||||
from octoprint.cli import bulk_options, standard_options, set_ctx_obj_option, get_ctx_obj_option
|
||||
|
||||
def run_server(basedir, configfile, host, port, debug, allow_root, logging_config, verbosity, safe_mode, octoprint_daemon=None):
|
||||
def run_server(basedir, configfile, host, port, debug, allow_root, logging_config, verbosity, safe_mode,
|
||||
ignore_blacklist, octoprint_daemon=None):
|
||||
"""Initializes the environment and starts up the server."""
|
||||
|
||||
from octoprint import init_platform, __display_version__, FatalStartupError
|
||||
|
||||
def log_startup(recorder=None, safe_mode=None, **kwargs):
|
||||
logger = logging.getLogger("octoprint.server")
|
||||
from octoprint.logging import get_divider_line
|
||||
|
||||
logger = logging.getLogger("octoprint.startup")
|
||||
|
||||
logger.info(get_divider_line("*"))
|
||||
logger.info("Starting OctoPrint {}".format(__display_version__))
|
||||
if safe_mode:
|
||||
logger.info("Starting in SAFE MODE. Third party plugins will be disabled!")
|
||||
|
||||
if recorder and len(recorder):
|
||||
logger.info("--- Logged during platform initialization: ---")
|
||||
logger.info(get_divider_line("-", "Logged during platform initialization:"))
|
||||
|
||||
from octoprint.logging.handlers import CombinedLogHandler
|
||||
handler = CombinedLogHandler(*logging.getLogger().handlers)
|
||||
recorder.setTarget(handler)
|
||||
recorder.flush()
|
||||
|
||||
logger.info("----------------------------------------------")
|
||||
logger.info(get_divider_line("-"))
|
||||
|
||||
from octoprint import urllib3_ssl
|
||||
if not urllib3_ssl:
|
||||
@@ -41,16 +46,45 @@ def run_server(basedir, configfile, host, port, debug, allow_root, logging_confi
|
||||
"update to a Python version >= 2.7.9 or alternatively "
|
||||
"install PyOpenSSL plus its dependencies. For details see "
|
||||
"https://urllib3.readthedocs.org/en/latest/security.html#openssl-pyopenssl")
|
||||
logger.info(get_divider_line("*"))
|
||||
|
||||
def log_register_rollover(safe_mode=None, plugin_manager=None, environment_detector=None, **kwargs):
|
||||
from octoprint.logging import get_handler, log_to_handler, get_divider_line
|
||||
from octoprint.logging.handlers import OctoPrintLogHandler
|
||||
|
||||
def rollover_callback():
|
||||
handler = get_handler("file")
|
||||
if handler is None:
|
||||
return
|
||||
|
||||
logger = logging.getLogger("octoprint.server")
|
||||
|
||||
def _log(message, level=logging.INFO):
|
||||
log_to_handler(logger, handler, level, message)
|
||||
|
||||
_log(get_divider_line("-", "Log roll over detected"))
|
||||
_log("OctoPrint {}".format(__display_version__))
|
||||
if safe_mode:
|
||||
_log("SAFE MODE is active. Third party plugins are disabled!")
|
||||
plugin_manager.log_all_plugins(only_to_handler=handler)
|
||||
environment_detector.log_detected_environment(only_to_handler=handler)
|
||||
_log(get_divider_line("-"))
|
||||
|
||||
OctoPrintLogHandler.registerRolloverCallback(rollover_callback)
|
||||
|
||||
try:
|
||||
settings, _, safe_mode, plugin_manager = init_platform(basedir,
|
||||
configfile,
|
||||
logging_file=logging_config,
|
||||
debug=debug,
|
||||
verbosity=verbosity,
|
||||
uncaught_logger=__name__,
|
||||
safe_mode=safe_mode,
|
||||
after_safe_mode=log_startup)
|
||||
components = init_platform(basedir, configfile,
|
||||
logging_file=logging_config,
|
||||
debug=debug,
|
||||
verbosity=verbosity,
|
||||
uncaught_logger=__name__,
|
||||
safe_mode=safe_mode,
|
||||
ignore_blacklist=ignore_blacklist,
|
||||
after_safe_mode=log_startup,
|
||||
after_environment_detector=log_register_rollover)
|
||||
|
||||
settings, _, safe_mode, event_manager, connectivity_checker, plugin_manager, environment_detector = components
|
||||
|
||||
except FatalStartupError as e:
|
||||
click.echo(e.message, err=True)
|
||||
click.echo("There was a fatal error starting up OctoPrint.", err=True)
|
||||
@@ -58,6 +92,9 @@ def run_server(basedir, configfile, host, port, debug, allow_root, logging_confi
|
||||
from octoprint.server import Server
|
||||
octoprint_server = Server(settings=settings,
|
||||
plugin_manager=plugin_manager,
|
||||
event_manager=event_manager,
|
||||
connectivity_checker=connectivity_checker,
|
||||
environment_detector=environment_detector,
|
||||
host=host,
|
||||
port=port,
|
||||
debug=debug,
|
||||
@@ -69,92 +106,153 @@ def run_server(basedir, configfile, host, port, debug, allow_root, logging_confi
|
||||
#~~ server options
|
||||
|
||||
server_options = bulk_options([
|
||||
click.option("--host", type=click.STRING,
|
||||
click.option("--host", type=click.STRING, callback=set_ctx_obj_option,
|
||||
help="Specify the host on which to bind the server."),
|
||||
click.option("--port", type=click.INT,
|
||||
click.option("--port", type=click.INT, callback=set_ctx_obj_option,
|
||||
help="Specify the port on which to bind the server."),
|
||||
click.option("--logging", type=click.Path(),
|
||||
click.option("--logging", type=click.Path(), callback=set_ctx_obj_option,
|
||||
help="Specify the config file to use for configuring logging."),
|
||||
click.option("--iknowwhatimdoing", "allow_root", is_flag=True,
|
||||
click.option("--iknowwhatimdoing", "allow_root", is_flag=True, callback=set_ctx_obj_option,
|
||||
help="Allow OctoPrint to run as user root."),
|
||||
click.option("--debug", is_flag=True, help="Enable debug mode.")
|
||||
click.option("--debug", is_flag=True, callback=set_ctx_obj_option,
|
||||
help="Enable debug mode."),
|
||||
click.option("--ignore-blacklist", "ignore_blacklist", is_flag=True, callback=set_ctx_obj_option,
|
||||
help="Disable processing of the plugin blacklist.")
|
||||
])
|
||||
"""Decorator to add the options shared among the server commands: ``--host``, ``--port``,
|
||||
``--logging``, ``--iknowwhatimdoing`` and ``--debug``."""
|
||||
|
||||
daemon_options = bulk_options([
|
||||
click.option("--pid", type=click.Path(), default="/tmp/octoprint.pid", callback=set_ctx_obj_option,
|
||||
help="Pidfile to use for daemonizing.")
|
||||
])
|
||||
"""Decorator to add the options for the daemon subcommand: ``--pid``."""
|
||||
|
||||
#~~ "octoprint serve" and "octoprint daemon" commands
|
||||
|
||||
@click.group()
|
||||
@pass_octoprint_ctx
|
||||
def server_commands(obj):
|
||||
def server_commands():
|
||||
pass
|
||||
|
||||
|
||||
@server_commands.command(name="safemode")
|
||||
@standard_options()
|
||||
@click.pass_context
|
||||
def enable_safemode(ctx, **kwargs):
|
||||
"""Sets the safe mode flag for the next start."""
|
||||
from octoprint import init_settings, FatalStartupError
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG if get_ctx_obj_option(ctx, "verbosity", 0) > 0 else logging.WARN)
|
||||
try:
|
||||
settings = init_settings(get_ctx_obj_option(ctx, "basedir", None), get_ctx_obj_option(ctx, "configfile", None))
|
||||
except FatalStartupError as e:
|
||||
click.echo(e.message, err=True)
|
||||
click.echo("There was a fatal error initializing the settings manager.", err=True)
|
||||
ctx.exit(-1)
|
||||
|
||||
settings.setBoolean(["server", "startOnceInSafeMode"], True)
|
||||
settings.save()
|
||||
|
||||
click.echo("Safe mode flag set, OctoPrint will start in safe mode on next restart.")
|
||||
|
||||
|
||||
@server_commands.command(name="serve")
|
||||
@standard_options()
|
||||
@server_options
|
||||
@standard_options(hidden=True)
|
||||
@pass_octoprint_ctx
|
||||
def serve_command(obj, host, port, logging, allow_root, debug):
|
||||
@click.pass_context
|
||||
def serve_command(ctx, **kwargs):
|
||||
"""Starts the OctoPrint server."""
|
||||
run_server(obj.basedir, obj.configfile, host, port, debug,
|
||||
allow_root, logging, obj.verbosity, obj.safe_mode)
|
||||
|
||||
def get_value(key):
|
||||
return get_ctx_obj_option(ctx, key, kwargs.get(key))
|
||||
|
||||
host = get_value("host")
|
||||
port = get_value("port")
|
||||
logging = get_value("logging")
|
||||
allow_root = get_value("allow_root")
|
||||
debug = get_value("debug")
|
||||
|
||||
basedir = get_value("basedir")
|
||||
configfile = get_value("configfile")
|
||||
verbosity = get_value("verbosity")
|
||||
safe_mode = get_value("safe_mode")
|
||||
ignore_blacklist = get_value("ignore_blacklist")
|
||||
|
||||
run_server(basedir, configfile, host, port, debug,
|
||||
allow_root, logging, verbosity, safe_mode,
|
||||
ignore_blacklist)
|
||||
|
||||
|
||||
@server_commands.command(name="daemon")
|
||||
@click.option("--pid", type=click.Path(), default="/tmp/octoprint.pid",
|
||||
help="Pidfile to use for daemonizing.")
|
||||
@server_options
|
||||
@standard_options(hidden=True)
|
||||
@click.argument("command", type=click.Choice(["start", "stop", "restart", "status"]),
|
||||
metavar="start|stop|restart|status")
|
||||
@pass_octoprint_ctx
|
||||
def daemon_command(octoprint_ctx, pid, host, port, logging, allow_root, debug, command):
|
||||
"""
|
||||
Starts, stops or restarts in daemon mode.
|
||||
if sys.platform != "win32" and sys.platform != "darwin":
|
||||
# we do not support daemon mode under windows or macosx
|
||||
|
||||
Please note that daemon mode is only supported under Linux right now.
|
||||
"""
|
||||
if sys.platform == "darwin" or sys.platform == "win32":
|
||||
click.echo("Sorry, daemon mode is only supported under Linux right now",
|
||||
file=sys.stderr)
|
||||
sys.exit(2)
|
||||
@server_commands.command(name="daemon")
|
||||
@standard_options()
|
||||
@server_options
|
||||
@daemon_options
|
||||
@click.argument("command", type=click.Choice(["start", "stop", "restart", "status"]),
|
||||
metavar="start|stop|restart|status")
|
||||
@click.pass_context
|
||||
def daemon_command(ctx, command, **kwargs):
|
||||
"""
|
||||
Starts, stops or restarts in daemon mode.
|
||||
|
||||
if pid is None:
|
||||
click.echo("No path to a pidfile set",
|
||||
file=sys.stderr)
|
||||
sys.exit(1)
|
||||
Please note that daemon mode is not supported under Windows and MacOSX right now.
|
||||
"""
|
||||
|
||||
from octoprint.daemon import Daemon
|
||||
class OctoPrintDaemon(Daemon):
|
||||
def __init__(self, pidfile, basedir, configfile, host, port, debug, allow_root, logging_config, verbosity, safe_mode):
|
||||
Daemon.__init__(self, pidfile)
|
||||
def get_value(key):
|
||||
return get_ctx_obj_option(ctx, key, kwargs.get(key))
|
||||
|
||||
self._basedir = basedir
|
||||
self._configfile = configfile
|
||||
self._host = host
|
||||
self._port = port
|
||||
self._debug = debug
|
||||
self._allow_root = allow_root
|
||||
self._logging_config = logging_config
|
||||
self._verbosity = verbosity
|
||||
self._safe_mode = safe_mode
|
||||
host = get_value("host")
|
||||
port = get_value("port")
|
||||
logging = get_value("logging")
|
||||
allow_root = get_value("allow_root")
|
||||
debug = get_value("debug")
|
||||
pid = get_value("pid")
|
||||
|
||||
def run(self):
|
||||
run_server(self._basedir, self._configfile, self._host, self._port, self._debug,
|
||||
self._allow_root, self._logging_config, self._verbosity, self._safe_mode,
|
||||
octoprint_daemon=self)
|
||||
basedir = get_value("basedir")
|
||||
configfile = get_value("configfile")
|
||||
verbosity = get_value("verbosity")
|
||||
safe_mode = get_value("safe_mode")
|
||||
ignore_blacklist = get_value("ignore_blacklist")
|
||||
|
||||
octoprint_daemon = OctoPrintDaemon(pid, octoprint_ctx.basedir, octoprint_ctx.configfile,
|
||||
host, port, debug, allow_root, logging, octoprint_ctx.verbosity,
|
||||
octoprint_ctx.safe_mode)
|
||||
if pid is None:
|
||||
click.echo("No path to a pidfile set",
|
||||
file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if command == "start":
|
||||
octoprint_daemon.start()
|
||||
elif command == "stop":
|
||||
octoprint_daemon.stop()
|
||||
elif command == "restart":
|
||||
octoprint_daemon.restart()
|
||||
elif command == "status":
|
||||
octoprint_daemon.status()
|
||||
from octoprint.daemon import Daemon
|
||||
class OctoPrintDaemon(Daemon):
|
||||
def __init__(self, pidfile, basedir, configfile, host, port, debug, allow_root, logging_config, verbosity,
|
||||
safe_mode, ignore_blacklist):
|
||||
Daemon.__init__(self, pidfile)
|
||||
|
||||
self._basedir = basedir
|
||||
self._configfile = configfile
|
||||
self._host = host
|
||||
self._port = port
|
||||
self._debug = debug
|
||||
self._allow_root = allow_root
|
||||
self._logging_config = logging_config
|
||||
self._verbosity = verbosity
|
||||
self._safe_mode = safe_mode
|
||||
self._ignore_blacklist = ignore_blacklist
|
||||
|
||||
def run(self):
|
||||
run_server(self._basedir, self._configfile, self._host, self._port, self._debug,
|
||||
self._allow_root, self._logging_config, self._verbosity, self._safe_mode,
|
||||
self._ignore_blacklist, octoprint_daemon=self)
|
||||
|
||||
octoprint_daemon = OctoPrintDaemon(pid, basedir, configfile, host, port, debug, allow_root, logging, verbosity,
|
||||
safe_mode, ignore_blacklist)
|
||||
|
||||
if command == "start":
|
||||
octoprint_daemon.start()
|
||||
elif command == "stop":
|
||||
octoprint_daemon.stop()
|
||||
elif command == "restart":
|
||||
octoprint_daemon.restart()
|
||||
elif command == "status":
|
||||
octoprint_daemon.status()
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Originally from http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
import sys, os, time, signal, io
|
||||
import sys, os, time, signal
|
||||
|
||||
class Daemon:
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
# coding=utf-8
|
||||
from __future__ import absolute_import
|
||||
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
__copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
||||
|
||||
import copy
|
||||
import logging
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
import threading
|
||||
import yaml
|
||||
|
||||
import psutil
|
||||
|
||||
from octoprint.plugin import EnvironmentDetectionPlugin
|
||||
from octoprint.util.platform import get_os
|
||||
|
||||
class EnvironmentDetector(object):
|
||||
|
||||
def __init__(self, plugin_manager):
|
||||
self._plugin_manager = plugin_manager
|
||||
|
||||
self._cache = None
|
||||
self._cache_lock = threading.RLock()
|
||||
|
||||
self._environment_plugins = self._plugin_manager.get_implementations(EnvironmentDetectionPlugin)
|
||||
|
||||
self._logger = logging.getLogger(__name__)
|
||||
|
||||
@property
|
||||
def environment(self):
|
||||
with self._cache_lock:
|
||||
if self._cache is None:
|
||||
self.run_detection()
|
||||
return copy.deepcopy(self._cache)
|
||||
|
||||
def run_detection(self, notify_plugins=True):
|
||||
try:
|
||||
environment = dict()
|
||||
environment["os"] = self._detect_os()
|
||||
environment["python"] = self._detect_python()
|
||||
environment["hardware"] = self._detect_hardware()
|
||||
|
||||
plugin_result = self._detect_from_plugins()
|
||||
if plugin_result:
|
||||
environment["plugins"] = plugin_result
|
||||
|
||||
with self._cache_lock:
|
||||
self._cache = environment
|
||||
|
||||
if notify_plugins:
|
||||
self.notify_plugins()
|
||||
|
||||
return environment
|
||||
except:
|
||||
self._logger.exception("Unexpected error while detecting environment")
|
||||
with self._cache_lock:
|
||||
self._cache = dict()
|
||||
return self._cache
|
||||
|
||||
def _detect_os(self):
|
||||
return dict(id=get_os(),
|
||||
platform=sys.platform)
|
||||
|
||||
def _detect_python(self):
|
||||
result = dict(version="unknown",
|
||||
pip="unknown")
|
||||
|
||||
# determine python version
|
||||
try:
|
||||
result["version"] = platform.python_version()
|
||||
except:
|
||||
self._logger.exception("Error detecting python version")
|
||||
|
||||
# determine if we are running from a virtual environment
|
||||
try:
|
||||
if hasattr(sys, "real_prefix") or (hasattr(sys, "base_prefix") and os.path.realpath(sys.prefix) != os.path.realpath(sys.base_prefix)):
|
||||
result["virtualenv"] = sys.prefix
|
||||
except:
|
||||
self._logger.exception("Error detecting whether we are running in a virtual environment")
|
||||
|
||||
# try to find pip version
|
||||
try:
|
||||
import pkg_resources
|
||||
result["pip"] = pkg_resources.get_distribution("pip").version
|
||||
except:
|
||||
self._logger.exception("Error detecting pip version")
|
||||
|
||||
return result
|
||||
|
||||
def _detect_hardware(self):
|
||||
result = dict(cores="unknown",
|
||||
freq="unknown",
|
||||
ram="unknown")
|
||||
|
||||
try:
|
||||
cores = psutil.cpu_count()
|
||||
cpu_freq = psutil.cpu_freq()
|
||||
ram = psutil.virtual_memory()
|
||||
if cores:
|
||||
result["cores"] = cores
|
||||
if cpu_freq and hasattr(cpu_freq, "max"):
|
||||
result["freq"] = cpu_freq.max
|
||||
if ram and hasattr(ram, "total"):
|
||||
result["ram"] = ram.total
|
||||
except:
|
||||
self._logger.exception("Error while detecting hardware environment")
|
||||
|
||||
return result
|
||||
|
||||
def _detect_from_plugins(self):
|
||||
result = dict()
|
||||
|
||||
for implementation in self._environment_plugins:
|
||||
try:
|
||||
additional = implementation.get_additional_environment()
|
||||
if additional is not None and isinstance(additional, dict) and len(additional):
|
||||
result[implementation._identifier] = additional
|
||||
except:
|
||||
self._logger.exception("Error while fetching additional "
|
||||
"environment data from plugin {}".format(implementation._identifier))
|
||||
|
||||
return result
|
||||
|
||||
def log_detected_environment(self, only_to_handler=None):
|
||||
def _log(message, level=logging.INFO):
|
||||
if only_to_handler is not None:
|
||||
import octoprint.logging
|
||||
octoprint.logging.log_to_handler(self._logger, only_to_handler, level, message, [])
|
||||
else:
|
||||
self._logger.log(level, message)
|
||||
|
||||
try:
|
||||
_log(self._format())
|
||||
except:
|
||||
self._logger.exception("Error logging detected environment")
|
||||
|
||||
def _format(self):
|
||||
with self._cache_lock:
|
||||
if self._cache is None:
|
||||
self.run_detection()
|
||||
environment = copy.deepcopy(self._cache)
|
||||
|
||||
dumped_environment = yaml.safe_dump(environment,
|
||||
default_flow_style=False,
|
||||
indent=" ",
|
||||
allow_unicode=True).strip()
|
||||
environment_lines = "\n".join(map(lambda l: "| {}".format(l), dumped_environment.split("\n")))
|
||||
return u"Detected environment is Python {} under {} ({}). Details:\n{}".format(environment["python"]["version"],
|
||||
environment["os"]["id"].title(),
|
||||
environment["os"]["platform"],
|
||||
environment_lines)
|
||||
|
||||
def notify_plugins(self):
|
||||
with self._cache_lock:
|
||||
if self._cache is None:
|
||||
self.run_detection(notify_plugins=False)
|
||||
environment = copy.deepcopy(self._cache)
|
||||
|
||||
for implementation in self._environment_plugins:
|
||||
try:
|
||||
implementation.on_environment_detected(environment)
|
||||
except:
|
||||
self._logger.exception("Error while sending environment "
|
||||
"detection result to plugin {}".format(implementation._identifier))
|
||||
+69
-22
@@ -27,9 +27,10 @@ def all_events():
|
||||
|
||||
|
||||
class Events(object):
|
||||
# application startup
|
||||
# server
|
||||
STARTUP = "Startup"
|
||||
SHUTDOWN = "Shutdown"
|
||||
CONNECTIVITY_CHANGED = "ConnectivityChanged"
|
||||
|
||||
# connect/disconnect to printer
|
||||
CONNECTING = "Connecting"
|
||||
@@ -39,6 +40,7 @@ class Events(object):
|
||||
|
||||
# State changes
|
||||
PRINTER_STATE_CHANGED = "PrinterStateChanged"
|
||||
PRINTER_RESET = "PrinterReset"
|
||||
|
||||
# connect/disconnect by client
|
||||
CLIENT_OPENED = "ClientOpened"
|
||||
@@ -53,14 +55,21 @@ class Events(object):
|
||||
METADATA_ANALYSIS_FINISHED = "MetadataAnalysisFinished"
|
||||
METADATA_STATISTICS_UPDATED = "MetadataStatisticsUpdated"
|
||||
|
||||
FILE_ADDED = "FileAdded"
|
||||
FILE_REMOVED = "FileRemoved"
|
||||
FOLDER_ADDED = "FolderAdded"
|
||||
FOLDER_REMOVED = "FolderRemoved"
|
||||
|
||||
# SD Upload
|
||||
TRANSFER_STARTED = "TransferStarted"
|
||||
TRANSFER_DONE = "TransferDone"
|
||||
TRANSFER_FAILED = "TransferFailed"
|
||||
|
||||
# print job
|
||||
PRINT_STARTED = "PrintStarted"
|
||||
PRINT_DONE = "PrintDone"
|
||||
PRINT_FAILED = "PrintFailed"
|
||||
PRINT_CANCELLING = "PrintCancelling"
|
||||
PRINT_CANCELLED = "PrintCancelled"
|
||||
PRINT_PAUSED = "PrintPaused"
|
||||
PRINT_RESUMED = "PrintResumed"
|
||||
@@ -79,6 +88,8 @@ class Events(object):
|
||||
EJECT = "Eject"
|
||||
E_STOP = "EStop"
|
||||
POSITION_UPDATE = "PositionUpdate"
|
||||
FIRMWARE_DATA = "FirmwareData"
|
||||
TOOL_CHANGE = "ToolChange"
|
||||
REGISTERED_MESSAGE_RECEIVED = "RegisteredMessageReceived"
|
||||
|
||||
# Timelapse
|
||||
@@ -125,9 +136,11 @@ class EventManager(object):
|
||||
self._registeredListeners = collections.defaultdict(list)
|
||||
self._logger = logging.getLogger(__name__)
|
||||
|
||||
self._startup_signaled = False
|
||||
self._shutdown_signaled = False
|
||||
|
||||
self._queue = queue.Queue()
|
||||
self._held_back = queue.Queue()
|
||||
|
||||
self._worker = threading.Thread(target=self._work)
|
||||
self._worker.daemon = True
|
||||
@@ -154,7 +167,8 @@ class EventManager(object):
|
||||
|
||||
octoprint.plugin.call_plugin(octoprint.plugin.types.EventHandlerPlugin,
|
||||
"on_event",
|
||||
args=(event, payload))
|
||||
args=(event, payload),
|
||||
initialized=True)
|
||||
self._logger.info("Event loop shut down")
|
||||
except:
|
||||
self._logger.exception("Ooops, the event bus worker loop crashed")
|
||||
@@ -170,7 +184,30 @@ class EventManager(object):
|
||||
payload being a payload object specific to the event.
|
||||
"""
|
||||
|
||||
self._queue.put((event, payload))
|
||||
send_held_back = False
|
||||
if event == Events.STARTUP:
|
||||
self._logger.info("Processing startup event, this is our first event")
|
||||
self._startup_signaled = True
|
||||
send_held_back = True
|
||||
|
||||
self._enqueue(event, payload)
|
||||
|
||||
if send_held_back:
|
||||
self._logger.info("Adding {} events to queue that "
|
||||
"were held back before startup event".format(self._held_back.qsize()))
|
||||
while True:
|
||||
try:
|
||||
self._queue.put(self._held_back.get(block=False))
|
||||
except queue.Empty:
|
||||
break
|
||||
|
||||
def _enqueue(self, event, payload):
|
||||
if self._startup_signaled:
|
||||
q = self._queue
|
||||
else:
|
||||
q = self._held_back
|
||||
|
||||
q.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"
|
||||
@@ -178,7 +215,7 @@ class EventManager(object):
|
||||
import copy
|
||||
legacy_payload = copy.deepcopy(payload)
|
||||
legacy_payload["type"] = "gcode"
|
||||
self._queue.put((event, legacy_payload))
|
||||
q.put((event, legacy_payload))
|
||||
|
||||
def subscribe(self, event, callback):
|
||||
"""
|
||||
@@ -332,24 +369,34 @@ class CommandTrigger(GenericEventListener):
|
||||
self._executeGcodeCommand(command, debug=debug)
|
||||
|
||||
def _executeSystemCommand(self, command, debug=False):
|
||||
def commandExecutioner(command):
|
||||
def commandExecutioner(cmd):
|
||||
if debug:
|
||||
self._logger.info("Executing system command: %s" % command)
|
||||
self._logger.info("Executing system command: {}".format(cmd))
|
||||
else:
|
||||
self._logger.info("Executing a system 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)
|
||||
subprocess.check_call(cmd, shell=True)
|
||||
|
||||
try:
|
||||
if isinstance(command, (list, tuple, set)):
|
||||
for c in command:
|
||||
commandExecutioner(c)
|
||||
else:
|
||||
commandExecutioner(command)
|
||||
except subprocess.CalledProcessError as e:
|
||||
self._logger.warn("Command failed with return code %i: %s" % (e.returncode, str(e)))
|
||||
except:
|
||||
self._logger.exception("Command failed")
|
||||
def process():
|
||||
try:
|
||||
if isinstance(command, (list, tuple, set)):
|
||||
for c in command:
|
||||
commandExecutioner(c)
|
||||
else:
|
||||
commandExecutioner(command)
|
||||
except subprocess.CalledProcessError as e:
|
||||
if debug:
|
||||
self._logger.warn("Command failed with return code {}: {}".format(e.returncode, str(e)))
|
||||
else:
|
||||
self._logger.warn("Command failed with return code {}, enable debug logging on target 'octoprint.events' for details".format(e.returncode))
|
||||
except:
|
||||
self._logger.exception("Command failed")
|
||||
|
||||
t = threading.Thread(target=process)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
||||
def _executeGcodeCommand(self, command, debug=False):
|
||||
commands = [command]
|
||||
@@ -361,7 +408,7 @@ class CommandTrigger(GenericEventListener):
|
||||
|
||||
def _processCommand(self, command, payload):
|
||||
"""
|
||||
Performs string substitutions in the command string based on a couple of current parameters.
|
||||
Performs string substitutions in the command string based on a few current parameters.
|
||||
|
||||
The following substitutions are currently supported:
|
||||
|
||||
@@ -397,7 +444,7 @@ class CommandTrigger(GenericEventListener):
|
||||
|
||||
currentData = self._printer.get_current_data()
|
||||
|
||||
if "currentZ" in currentData.keys() and currentData["currentZ"] is not None:
|
||||
if "currentZ" in currentData and currentData["currentZ"] is not None:
|
||||
params["__currentZ"] = str(currentData["currentZ"])
|
||||
|
||||
if "job" in currentData and "file" in currentData["job"] and "name" in currentData["job"]["file"] \
|
||||
@@ -405,9 +452,9 @@ class CommandTrigger(GenericEventListener):
|
||||
params["__filename"] = currentData["job"]["file"]["name"]
|
||||
params["__filepath"] = currentData["job"]["file"]["path"]
|
||||
params["__fileorigin"] = currentData["job"]["file"]["origin"]
|
||||
if "progress" in currentData.keys() and currentData["progress"] is not None \
|
||||
and "completion" in currentData["progress"].keys() and currentData["progress"]["completion"] is not None:
|
||||
params["__progress"] = str(round(currentData["progress"]["completion"] * 100))
|
||||
if "progress" in currentData and currentData["progress"] is not None \
|
||||
and "completion" in currentData["progress"] and currentData["progress"]["completion"] is not None:
|
||||
params["__progress"] = str(round(currentData["progress"]["completion"]))
|
||||
|
||||
# now add the payload keys as well
|
||||
if isinstance(payload, dict):
|
||||
|
||||
@@ -20,6 +20,8 @@ from .util import AbstractFileWrapper, StreamWrapper, DiskFileWrapper
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
from past.builtins import basestring
|
||||
|
||||
ContentTypeMapping = namedtuple("ContentTypeMapping", "extensions, content_type")
|
||||
ContentTypeDetector = namedtuple("ContentTypeDetector", "extensions, detector")
|
||||
|
||||
@@ -38,13 +40,47 @@ def full_extension_tree():
|
||||
)
|
||||
)
|
||||
|
||||
def leaf_merger(a, b):
|
||||
supported_leaf_types = (ContentTypeMapping, ContentTypeDetector, list)
|
||||
if not isinstance(a, supported_leaf_types) or not isinstance(b, supported_leaf_types):
|
||||
raise ValueError()
|
||||
|
||||
if isinstance(a, ContentTypeDetector) and isinstance(b, ContentTypeMapping):
|
||||
raise ValueError()
|
||||
|
||||
if isinstance(a, ContentTypeMapping) and isinstance(b, ContentTypeDetector):
|
||||
raise ValueError()
|
||||
|
||||
a_list = a if isinstance(a, list) else a.extensions
|
||||
b_list = b if isinstance(b, list) else b.extensions
|
||||
merged = a_list + b_list
|
||||
|
||||
content_type = None
|
||||
if isinstance(b, ContentTypeMapping):
|
||||
content_type = b.content_type
|
||||
elif isinstance(a, ContentTypeMapping):
|
||||
content_type = a.content_type
|
||||
|
||||
detector = None
|
||||
if isinstance(b, ContentTypeDetector):
|
||||
detector = b.detector
|
||||
elif isinstance(a, ContentTypeDetector):
|
||||
detector = a.detector
|
||||
|
||||
if content_type is not None:
|
||||
return ContentTypeMapping(merged, content_type)
|
||||
elif detector is not None:
|
||||
return ContentTypeDetector(merged, detector)
|
||||
else:
|
||||
return merged
|
||||
|
||||
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)
|
||||
result = octoprint.util.dict_merge(result, hook_result, leaf_merger=leaf_merger)
|
||||
except:
|
||||
logging.getLogger(__name__).exception("Exception while retrieving additional extension tree entries from hook {name}".format(name=name))
|
||||
|
||||
@@ -178,9 +214,12 @@ class FileManager(object):
|
||||
import octoprint.settings
|
||||
self._recovery_file = os.path.join(octoprint.settings.settings().getBaseFolder("data"), "print_recovery_data.yaml")
|
||||
|
||||
def initialize(self):
|
||||
def initialize(self, process_backlog=False):
|
||||
self.reload_plugins()
|
||||
if process_backlog:
|
||||
self.process_backlog()
|
||||
|
||||
def process_backlog(self):
|
||||
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():
|
||||
@@ -205,17 +244,26 @@ class FileManager(object):
|
||||
# callback was not registered
|
||||
pass
|
||||
|
||||
def _determine_analysis_backlog(self, storage_type, storage_manager):
|
||||
def _determine_analysis_backlog(self, storage_type, storage_manager, root=None, high_priority=False):
|
||||
counter = 0
|
||||
for entry, path, printer_profile in storage_manager.analysis_backlog:
|
||||
|
||||
backlog_generator = storage_manager.analysis_backlog
|
||||
if root is not None:
|
||||
backlog_generator = storage_manager.analysis_backlog_for_path(path=root)
|
||||
|
||||
for entry, path, printer_profile in backlog_generator:
|
||||
file_type = get_file_type(path)[-1]
|
||||
file_name = storage_manager.split_path(path)
|
||||
|
||||
# we'll use the default printer profile for the backlog since we don't know better
|
||||
queue_entry = QueueEntry(file_name, entry, file_type, storage_type, path, self._printer_profile_manager.get_default())
|
||||
if self._analysis_queue.enqueue(queue_entry, high_priority=False):
|
||||
if self._analysis_queue.enqueue(queue_entry, high_priority=high_priority):
|
||||
counter += 1
|
||||
self._logger.info("Added {counter} items from storage type \"{storage_type}\" to analysis queue".format(**locals()))
|
||||
|
||||
if root:
|
||||
self._logger.info("Added {counter} items from storage type \"{storage_type}\" and root \"{root}\" to analysis queue".format(**locals()))
|
||||
else:
|
||||
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
|
||||
@@ -242,11 +290,33 @@ class FileManager(object):
|
||||
def default_slicer(self):
|
||||
return self._slicing_manager.default_slicer
|
||||
|
||||
def analyse(self, destination, path, printer_profile_id=None):
|
||||
if not self.file_exists(destination, path):
|
||||
return
|
||||
|
||||
if printer_profile_id is None:
|
||||
printer_profile = self._printer_profile_manager.get_current_or_default()
|
||||
else:
|
||||
printer_profile = self._printer_profile_manager.get(printer_profile_id)
|
||||
if printer_profile is None:
|
||||
printer_profile = self._printer_profile_manager.get_current_or_default()
|
||||
|
||||
queue_entry = self._analysis_queue_entry(destination, path)
|
||||
self._analysis_queue.dequeue(queue_entry)
|
||||
|
||||
queue_entry = self._analysis_queue_entry(destination, path, printer_profile=printer_profile)
|
||||
if queue_entry:
|
||||
return self._analysis_queue.enqueue(queue_entry, high_priority=True)
|
||||
|
||||
return False
|
||||
|
||||
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):
|
||||
position=None, profile=None, printer_profile_id=None, overrides=None, display=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):
|
||||
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, dict(stl=source_path,
|
||||
@@ -271,7 +341,9 @@ class FileManager(object):
|
||||
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)
|
||||
self.add_file(dest_location, dest_path, file_obj,
|
||||
display=display, links=links, allow_overwrite=True,
|
||||
printer_profile=printer_profile, analysis=_analysis)
|
||||
|
||||
end_time = time.time()
|
||||
eventManager().fire(Events.SLICING_DONE, dict(stl=source_path,
|
||||
@@ -383,7 +455,7 @@ class FileManager(object):
|
||||
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):
|
||||
def add_file(self, destination, path, file_object, links=None, allow_overwrite=False, printer_profile=None, analysis=None, display=None):
|
||||
if printer_profile is None:
|
||||
printer_profile = self._printer_profile_manager.get_current_or_default()
|
||||
|
||||
@@ -396,50 +468,133 @@ class FileManager(object):
|
||||
|
||||
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)
|
||||
_, file_name = self._storage(destination).split_path(file_path)
|
||||
|
||||
queue_entry = self._analysis_queue_entry(destination, path)
|
||||
|
||||
if queue_entry is not None:
|
||||
self._analysis_queue.dequeue(queue_entry)
|
||||
|
||||
path_in_storage = self._storage(destination).add_file(path, file_object, links=links, printer_profile=printer_profile, allow_overwrite=allow_overwrite, display=display)
|
||||
|
||||
if analysis is None:
|
||||
file_type = get_file_type(absolute_path)
|
||||
if file_type:
|
||||
queue_entry = QueueEntry(file_name, file_path, file_type[-1], destination, absolute_path, printer_profile)
|
||||
queue_entry = self._analysis_queue_entry(destination, path_in_storage, printer_profile=printer_profile)
|
||||
if queue_entry:
|
||||
self._analysis_queue.enqueue(queue_entry, high_priority=True)
|
||||
else:
|
||||
self._add_analysis_result(destination, path, analysis)
|
||||
|
||||
_, name = self._storage(destination).split_path(path_in_storage)
|
||||
eventManager().fire(Events.FILE_ADDED, dict(storage=destination,
|
||||
path=path_in_storage,
|
||||
name=name,
|
||||
type=get_file_type(name)))
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
return file_path
|
||||
return path_in_storage
|
||||
|
||||
def remove_file(self, destination, path):
|
||||
queue_entry = self._analysis_queue_entry(destination, path)
|
||||
self._analysis_queue.dequeue(queue_entry)
|
||||
self._storage(destination).remove_file(path)
|
||||
|
||||
_, name = self._storage(destination).split_path(path)
|
||||
eventManager().fire(Events.FILE_REMOVED, dict(storage=destination,
|
||||
path=path,
|
||||
name=name,
|
||||
type=get_file_type(name)))
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
|
||||
def copy_file(self, destination, source, dst):
|
||||
self._storage(destination).copy_file(source, dst)
|
||||
path_in_storage = self._storage(destination).copy_file(source, dst)
|
||||
if not self.has_analysis(destination, path_in_storage):
|
||||
queue_entry = self._analysis_queue_entry(destination, path_in_storage)
|
||||
if queue_entry:
|
||||
self._analysis_queue.enqueue(queue_entry)
|
||||
|
||||
_, name = self._storage(destination).split_path(path_in_storage)
|
||||
eventManager().fire(Events.FILE_ADDED, dict(storage=destination,
|
||||
path=path_in_storage,
|
||||
name=name,
|
||||
type=get_file_type(name)))
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
|
||||
def move_file(self, destination, source, dst):
|
||||
self._storage(destination).move_file(source, dst)
|
||||
queue_entry = self._analysis_queue_entry(destination, source)
|
||||
self._analysis_queue.dequeue(queue_entry)
|
||||
path = self._storage(destination).move_file(source, dst)
|
||||
if not self.has_analysis(destination, path):
|
||||
queue_entry = self._analysis_queue_entry(destination, path)
|
||||
if queue_entry:
|
||||
self._analysis_queue.enqueue(queue_entry)
|
||||
|
||||
source_path_in_storage = self._storage(destination).path_in_storage(source)
|
||||
_, source_name = self._storage(destination).split_path(source_path_in_storage)
|
||||
dst_path_in_storage = self._storage(destination).path_in_storage(dst)
|
||||
_, dst_name = self._storage(destination).split_path(dst_path_in_storage)
|
||||
|
||||
eventManager().fire(Events.FILE_REMOVED, dict(storage=destination,
|
||||
path=source_path_in_storage,
|
||||
name=source_name,
|
||||
type=get_file_type(source_name)))
|
||||
eventManager().fire(Events.FILE_ADDED, dict(storage=destination,
|
||||
path=dst_path_in_storage,
|
||||
name=dst_name,
|
||||
type=get_file_type(dst_name)))
|
||||
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)
|
||||
def add_folder(self, destination, path, ignore_existing=True, display=None):
|
||||
path_in_storage = self._storage(destination).add_folder(path, ignore_existing=ignore_existing, display=display)
|
||||
|
||||
_, name = self._storage(destination).split_path(path_in_storage)
|
||||
eventManager().fire(Events.FOLDER_ADDED, dict(storage=destination,
|
||||
path=path_in_storage,
|
||||
name=name))
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
return folder_path
|
||||
return path_in_storage
|
||||
|
||||
def remove_folder(self, destination, path, recursive=True):
|
||||
self._analysis_queue.dequeue_folder(destination, path)
|
||||
self._analysis_queue.pause()
|
||||
self._storage(destination).remove_folder(path, recursive=recursive)
|
||||
self._analysis_queue.resume()
|
||||
|
||||
_, name = self._storage(destination).split_path(path)
|
||||
eventManager().fire(Events.FOLDER_REMOVED, dict(storage=destination,
|
||||
path=path,
|
||||
name=name))
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
|
||||
def copy_folder(self, destination, source, dst):
|
||||
self._storage(destination).copy_folder(source, dst)
|
||||
path_in_storage = self._storage(destination).copy_folder(source, dst)
|
||||
self._determine_analysis_backlog(destination, self._storage(destination), root=path_in_storage)
|
||||
|
||||
_, name = self._storage(destination).split_path(path_in_storage)
|
||||
eventManager().fire(Events.FOLDER_ADDED, dict(storage=destination,
|
||||
path=path_in_storage,
|
||||
name=name))
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
|
||||
def move_folder(self, destination, source, dst):
|
||||
self._storage(destination).move_folder(source, dst)
|
||||
self._analysis_queue.dequeue_folder(destination, source)
|
||||
self._analysis_queue.pause()
|
||||
dst_path_in_storage = self._storage(destination).move_folder(source, dst)
|
||||
self._determine_analysis_backlog(destination, self._storage(destination), root=dst_path_in_storage)
|
||||
self._analysis_queue.resume()
|
||||
|
||||
source_path_in_storage = self._storage(destination).path_in_storage(source)
|
||||
_, source_name = self._storage(destination).split_path(source_path_in_storage)
|
||||
_, dst_name = self._storage(destination).split_path(dst_path_in_storage)
|
||||
|
||||
eventManager().fire(Events.FOLDER_REMOVED, dict(storage=destination,
|
||||
path=source_path_in_storage,
|
||||
name=source_name))
|
||||
eventManager().fire(Events.FOLDER_ADDED, dict(storage=destination,
|
||||
path=dst_path_in_storage,
|
||||
name=dst_name))
|
||||
eventManager().fire(Events.UPDATED_FILES, dict(type="printables"))
|
||||
|
||||
def has_analysis(self, destination, path):
|
||||
return self._storage(destination).has_analysis(path)
|
||||
|
||||
def get_metadata(self, destination, path):
|
||||
return self._storage(destination).get_metadata(path)
|
||||
|
||||
@@ -506,6 +661,9 @@ class FileManager(object):
|
||||
def path_on_disk(self, destination, path):
|
||||
return self._storage(destination).path_on_disk(path)
|
||||
|
||||
def canonicalize(self, destination, path):
|
||||
return self._storage(destination).canonicalize(path)
|
||||
|
||||
def sanitize(self, destination, path):
|
||||
return self._storage(destination).sanitize(path)
|
||||
|
||||
@@ -542,3 +700,15 @@ class FileManager(object):
|
||||
def _on_analysis_finished(self, entry, result):
|
||||
self._add_analysis_result(entry.location, entry.path, result)
|
||||
|
||||
def _analysis_queue_entry(self, destination, path, printer_profile=None):
|
||||
if printer_profile is None:
|
||||
printer_profile = self._printer_profile_manager.get_current_or_default()
|
||||
|
||||
absolute_path = self._storage(destination).path_on_disk(path)
|
||||
_, file_name = self._storage(destination).split_path(path)
|
||||
file_type = get_file_type(absolute_path)
|
||||
|
||||
if file_type:
|
||||
return QueueEntry(file_name, path, file_type[-1], destination, absolute_path, printer_profile)
|
||||
else:
|
||||
return None
|
||||
@@ -17,8 +17,7 @@ import collections
|
||||
import time
|
||||
|
||||
from octoprint.events import Events, eventManager
|
||||
|
||||
import octoprint.util.gcodeInterpreter as gcodeInterpreter
|
||||
from octoprint.settings import settings
|
||||
|
||||
|
||||
class QueueEntry(collections.namedtuple("QueueEntry", "name, path, type, location, absolute_path, printer_profile")):
|
||||
@@ -40,6 +39,12 @@ class QueueEntry(collections.namedtuple("QueueEntry", "name, path, type, locatio
|
||||
return "{location}:{path}".format(location=self.location, path=self.path)
|
||||
|
||||
|
||||
class AnalysisAborted(Exception):
|
||||
def __init__(self, reenqueue=True, *args, **kwargs):
|
||||
Exception.__init__(self, *args, **kwargs)
|
||||
self.reenqueue = reenqueue
|
||||
|
||||
|
||||
class AnalysisQueue(object):
|
||||
"""
|
||||
OctoPrint's :class:`AnalysisQueue` can manage various :class:`AbstractAnalysisQueue` implementations, mapped
|
||||
@@ -71,12 +76,28 @@ class AnalysisQueue(object):
|
||||
self._callbacks.remove(callback)
|
||||
|
||||
def enqueue(self, entry, high_priority=False):
|
||||
if entry is None:
|
||||
return False
|
||||
|
||||
if not entry.type in self._queues:
|
||||
return False
|
||||
|
||||
self._queues[entry.type].enqueue(entry, high_priority=high_priority)
|
||||
return True
|
||||
|
||||
def dequeue(self, entry):
|
||||
if entry is None:
|
||||
return False
|
||||
|
||||
if not entry.type in self._queues:
|
||||
return False
|
||||
|
||||
self._queues[entry.type].dequeue(entry.location, entry.path)
|
||||
|
||||
def dequeue_folder(self, destination, path):
|
||||
for queue in self._queues.values():
|
||||
queue.dequeue_folder(destination, path)
|
||||
|
||||
def pause(self):
|
||||
for queue in self._queues.values():
|
||||
queue.pause()
|
||||
@@ -112,8 +133,10 @@ class AbstractAnalysisQueue(object):
|
||||
.. automethod:: _do_abort
|
||||
"""
|
||||
|
||||
LOW_PRIO = 0
|
||||
HIGH_PRIO = 100
|
||||
LOW_PRIO = 100
|
||||
LOW_PRIO_ABORTED = 75
|
||||
HIGH_PRIO = 50
|
||||
HIGH_PRIO_ABORTED = 0
|
||||
|
||||
def __init__(self, finished_callback):
|
||||
self._logger = logging.getLogger(__name__)
|
||||
@@ -123,11 +146,15 @@ class AbstractAnalysisQueue(object):
|
||||
self._active = threading.Event()
|
||||
self._active.set()
|
||||
|
||||
self._done = threading.Event()
|
||||
self._done.clear()
|
||||
|
||||
self._currentFile = None
|
||||
self._currentProgress = None
|
||||
|
||||
self._queue = queue.PriorityQueue()
|
||||
self._current = None
|
||||
self._current_highprio = False
|
||||
|
||||
self._worker = threading.Thread(target=self._work)
|
||||
self._worker.daemon = True
|
||||
@@ -153,7 +180,24 @@ class AbstractAnalysisQueue(object):
|
||||
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))
|
||||
self._queue.put((prio, entry, high_priority))
|
||||
if high_priority and self._current is not None and not self._current_highprio:
|
||||
self._logger.debug("Aborting current analysis in favor of high priority one")
|
||||
self._do_abort()
|
||||
|
||||
def dequeue(self, location, path):
|
||||
if self._current is not None and self._current.location == location \
|
||||
and self._current.path == path:
|
||||
self._do_abort(reenqueue=False)
|
||||
self._done.wait()
|
||||
self._done.clear()
|
||||
|
||||
def dequeue_folder(self, location, path):
|
||||
if self._current is not None and self._current.location == location \
|
||||
and self._current.path.startswith(path + "/"):
|
||||
self._do_abort(reenqueue=False)
|
||||
self._done.wait()
|
||||
self._done.clear()
|
||||
|
||||
def pause(self):
|
||||
"""
|
||||
@@ -175,24 +219,23 @@ class AbstractAnalysisQueue(object):
|
||||
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()))
|
||||
|
||||
(priority, entry, high_priority) = self._queue.get()
|
||||
self._logger.debug("Processing entry {} from queue (priority {})".format(entry, priority))
|
||||
self._active.wait()
|
||||
|
||||
try:
|
||||
self._analyze(entry, high_priority=(priority == self.__class__.HIGH_PRIO))
|
||||
self._analyze(entry, high_priority=high_priority)
|
||||
self._queue.task_done()
|
||||
except gcodeInterpreter.AnalysisAborted:
|
||||
aborted = entry
|
||||
self._logger.debug("Running analysis of entry {entry} aborted".format(**locals()))
|
||||
self._done.set()
|
||||
except AnalysisAborted as ex:
|
||||
if ex.reenqueue:
|
||||
self._queue.put((self.__class__.HIGH_PRIO_ABORTED if high_priority else self.__class__.LOW_PRIO_ABORTED,
|
||||
entry,
|
||||
high_priority))
|
||||
self._logger.debug("Running analysis of entry {} aborted".format(entry))
|
||||
self._queue.task_done()
|
||||
self._done.set()
|
||||
else:
|
||||
time.sleep(1.0)
|
||||
|
||||
@@ -202,10 +245,12 @@ class AbstractAnalysisQueue(object):
|
||||
return
|
||||
|
||||
self._current = entry
|
||||
self._current_highprio = high_priority
|
||||
self._current_progress = 0
|
||||
|
||||
try:
|
||||
self._logger.info("Starting analysis of {entry}".format(**locals()))
|
||||
start_time = time.time()
|
||||
self._logger.info("Starting analysis of {}".format(entry))
|
||||
eventManager().fire(Events.METADATA_ANALYSIS_STARTED, {"name": entry.name,
|
||||
"path": entry.path,
|
||||
"origin": entry.location,
|
||||
@@ -217,7 +262,7 @@ class AbstractAnalysisQueue(object):
|
||||
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._logger.info("Analysis of entry {} finished, needed {:.2f}s".format(entry, time.time() - start_time))
|
||||
self._finished_callback(self._current, result)
|
||||
finally:
|
||||
self._current = None
|
||||
@@ -237,7 +282,7 @@ class AbstractAnalysisQueue(object):
|
||||
"""
|
||||
return None
|
||||
|
||||
def _do_abort(self):
|
||||
def _do_abort(self, reenqueue=True):
|
||||
"""
|
||||
Aborts analysis of the current entry. Needs to be overridden by sub classes.
|
||||
"""
|
||||
@@ -264,34 +309,95 @@ class GcodeAnalysisQueue(AbstractAnalysisQueue):
|
||||
* The extruded volume in cm³
|
||||
"""
|
||||
|
||||
def __init__(self, finished_callback):
|
||||
AbstractAnalysisQueue.__init__(self, finished_callback)
|
||||
|
||||
self._aborted = False
|
||||
self._reenqueue = False
|
||||
|
||||
def _do_analysis(self, high_priority=False):
|
||||
import sarge
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
try:
|
||||
def throttle():
|
||||
throttle = settings().getFloat(["gcodeAnalysis", "throttle_highprio"]) if high_priority \
|
||||
else settings().getFloat(["gcodeAnalysis", "throttle_normalprio"])
|
||||
throttle_lines = settings().getInt(["gcodeAnalysis", "throttle_lines"])
|
||||
max_extruders = settings().getInt(["gcodeAnalysis", "maxExtruders"])
|
||||
g90_extruder = settings().getBoolean(["feature", "g90InfluencesExtruder"])
|
||||
speedx = self._current.printer_profile["axes"]["x"]["speed"]
|
||||
speedy = self._current.printer_profile["axes"]["y"]["speed"]
|
||||
offsets = self._current.printer_profile["extruder"]["offsets"]
|
||||
|
||||
command = [sys.executable, "-m", "octoprint", "analysis", "gcode",
|
||||
"--speed-x={}".format(speedx), "--speed-y={}".format(speedy),
|
||||
"--max-t={}".format(max_extruders), "--throttle={}".format(throttle),
|
||||
"--throttle-lines={}".format(throttle_lines)]
|
||||
for offset in offsets[1:]:
|
||||
command += ["--offset", str(offset[0]), str(offset[1])]
|
||||
if g90_extruder:
|
||||
command += ["--g90-extruder"]
|
||||
command.append(self._current.absolute_path)
|
||||
|
||||
self._logger.info("Invoking analysis command: {}".format(" ".join(command)))
|
||||
|
||||
self._aborted = False
|
||||
p = sarge.run(command, async=True, stdout=sarge.Capture())
|
||||
|
||||
while len(p.commands) == 0:
|
||||
# somewhat ugly... we can't use wait_events because
|
||||
# the events might not be all set if an exception
|
||||
# by sarge is triggered within the async process
|
||||
# thread
|
||||
time.sleep(0.01)
|
||||
|
||||
throttle_callback = throttle
|
||||
if high_priority:
|
||||
throttle_callback = None
|
||||
# by now we should have a command, let's wait for its
|
||||
# process to have been prepared
|
||||
p.commands[0].process_ready.wait()
|
||||
|
||||
self._gcode = gcodeInterpreter.gcode()
|
||||
self._gcode.load(self._current.absolute_path, self._current.printer_profile, throttle=throttle_callback)
|
||||
if not p.commands[0].process:
|
||||
# the process might have been set to None in case of any exception
|
||||
raise RuntimeError(u"Error while trying to run command {}".format(" ".join(command)))
|
||||
|
||||
try:
|
||||
# let's wait for stuff to finish
|
||||
while p.returncode is None:
|
||||
if self._aborted:
|
||||
# oh, we shall abort, let's do so!
|
||||
p.commands[0].terminate()
|
||||
raise AnalysisAborted(reenqueue=self._reenqueue)
|
||||
|
||||
# else continue
|
||||
p.commands[0].poll()
|
||||
finally:
|
||||
p.close()
|
||||
|
||||
output = p.stdout.text
|
||||
self._logger.debug("Got output: {!r}".format(output))
|
||||
|
||||
if not "RESULTS:" in output:
|
||||
raise RuntimeError("No analysis result found")
|
||||
|
||||
_, output = output.split("RESULTS:")
|
||||
analysis = yaml.safe_load(output)
|
||||
|
||||
result = dict()
|
||||
result["printingArea"] = self._gcode.printing_area
|
||||
result["dimensions"] = self._gcode.dimensions
|
||||
if self._gcode.totalMoveTimeMinute:
|
||||
result["estimatedPrintTime"] = self._gcode.totalMoveTimeMinute * 60
|
||||
if self._gcode.extrusionAmount:
|
||||
result["printingArea"] = analysis["printing_area"]
|
||||
result["dimensions"] = analysis["dimensions"]
|
||||
if analysis["total_time"]:
|
||||
result["estimatedPrintTime"] = analysis["total_time"] * 60
|
||||
if analysis["extrusion_length"]:
|
||||
result["filament"] = dict()
|
||||
for i in range(len(self._gcode.extrusionAmount)):
|
||||
for i in range(len(analysis["extrusion_length"])):
|
||||
result["filament"]["tool%d" % i] = {
|
||||
"length": self._gcode.extrusionAmount[i],
|
||||
"volume": self._gcode.extrusionVolume[i]
|
||||
"length": analysis["extrusion_length"][i],
|
||||
"volume": analysis["extrusion_volume"][i]
|
||||
}
|
||||
return result
|
||||
finally:
|
||||
self._gcode = None
|
||||
|
||||
def _do_abort(self):
|
||||
if self._gcode:
|
||||
self._gcode.abort()
|
||||
def _do_abort(self, reenqueue=True):
|
||||
self._aborted = True
|
||||
self._reenqueue = reenqueue
|
||||
Loaded 100 of 398 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user