Gina Häußge
deee737660
🐛 Raise no exception in case of missing wheel metadata
...
That's normal for plugins that were installed as eggs instead of wheels
and we don't want to raise the error in this case. If we also don't find
egg metadata we'll log a warning anyhow.
Any other exceptions will be raised though.
2019-02-06 18:36:00 +01:00
Gina Häußge
8425c7b973
Merge branch 'py23' of github.com:smurfix/OctoPrint into pr/3032
2019-02-06 18:13:57 +01:00
Gina Häußge
1e42db040d
📝 docs: some rewording re dev environment
2019-02-06 18:12:44 +01:00
Matthias Urlichs
e2d4b64510
superfluous "import io"
2019-02-06 17:29:19 +01:00
Gina Häußge
61136edeea
✅ Add tox.ini
2019-02-06 17:19:28 +01:00
Gina Häußge
7614ef40d3
🐛 Fix repeatability of doctests under py2
2019-02-06 17:07:50 +01:00
Gina Häußge
935639a51a
🐛 Fix json file writing
...
Apparently json.dump produces mixed bytes/unicode content. So now we use
json.dumps wrapped in to_bytes and that's it.
2019-02-06 16:51:54 +01:00
Gina Häußge
ec689e3939
🐛 Fix versioneer
2019-02-06 16:35:32 +01:00
Gina Häußge
fd8788dd34
♻ More error resilience for encoding issues in config.yaml
...
Normally I'd say, broken files are broken files, but since in case of an
encoding error in config.yaml the server won't come up anymore we are
erring on the side of caution here and running with errors="replace"
2019-02-06 16:06:56 +01:00
Gina Häußge
32a8646135
♻ codecs.open -> io.open
...
The general consensus regarding codecs.open appears to be that it's only
left in Python 3 for backwards compatibility (which I find kind funny
but I digress...) and that io.open should be used instead for Py2.6+
since it's available and behaving the same in both versions. So that's
what we do here.
2019-02-06 16:05:09 +01:00
Gina Häußge
09cc7cf5f7
🐛 Fix unicode vs bytes issues for atomic_write
...
NamedTemporaryFile doesn't support the encoding parameter under py2.
However, without it specifying text mode defaults to ascii, causing some
issues especially with config files containing utf-8.
By swapping NamedTemporaryFile for mkstemp and a custom io.open call
(parameterized according to the open mode) we can support a proper
encoding aware atomic_write.
2019-02-06 16:03:32 +01:00
Gina Häußge
496e9f0ec4
✅ Add unit test for pip caller initialization
2019-02-06 13:11:03 +01:00
Gina Häußge
18b2ecd64c
🐛 Fix unicode vs bytes issues in PipCaller
...
* environment for subprocess needs native str (at least under win)
* when reading a text file we should also be writing one inside the
test balloon
2019-02-06 12:53:23 +01:00
Gina Häußge
cc6f61c62e
🐛 discovery: fix unicode vs bytes issues in SSDP
2019-02-06 12:00:16 +01:00
Matthias Urlichs
de149613cb
Run flake8 tests only once
2019-02-05 18:13:44 +01:00
Matthias Urlichs
a7ca374955
Fix additional flake8 nits
2019-02-05 17:54:09 +01:00
Matthias Urlichs
d7d3272905
Merge errors fixed
2019-02-05 17:43:31 +01:00
Matthias Urlichs
9eb29a8ce0
found another unnecessary list-ification
2019-02-05 17:41:30 +01:00
Matthias Urlichs
bf16bd1180
Merge py23 from devel
2019-02-05 17:36:07 +01:00
Matthias Urlichs
7b5315383b
Add wildcard import for compatibility
2019-02-05 17:35:25 +01:00
Matthias Urlichs
72729ad418
fix speling an move to docstring
2019-02-05 17:34:57 +01:00
Matthias Urlichs
e6f902cbe7
add logging
2019-02-05 17:34:45 +01:00
Matthias Urlichs
9b14f32279
take PY3 from existing declaration
2019-02-05 17:34:27 +01:00
Matthias Urlichs
7ad4d75588
fixed merge errors
2019-02-05 17:34:15 +01:00
Gina Häußge
5a623b486c
✅ Adding flake8 to CI
2019-02-05 17:28:44 +01:00
Gina Häußge
920283cf87
Merge branch 'devel' into pr/3032
...
# Conflicts:
# src/octoprint/access/groups.py
# src/octoprint/static/css/octoprint.css
2019-02-05 17:08:24 +01:00
Gina Häußge
becd16b892
🐛 Fix a test
2019-02-05 16:08:40 +01:00
Gina Häußge
f59c1ce804
⬆ Upgrade Flask-Login dependency
...
It used to be 0.3.0+, some merge in the past must have broken that.
2019-02-05 15:58:15 +01:00
Gina Häußge
c71972c0f8
♻ Explicitly add admin group to plugin permissions
...
Admin only access by default for these was implied by not having them
added to one of the three major default groups, making it explicit is
more clear though.
2019-02-05 15:58:15 +01:00
Gina Häußge
47a9a40ec9
✨ permissions: Groups can now have subgroups
...
That way we can easily provide a Read Only group that allows read-only
access and which can then be added to the Guest group by users who
desire anonymous read-only access, similar to disabling the forcelogin
plugin in 1.3.10+
2019-02-05 15:58:15 +01:00
Matthias Urlichs
5c1fffc3d0
comm: more str vs. bytes (esp. baudrate detect)
2019-02-05 14:30:23 +01:00
Matthias Urlichs
fe090cc6cc
Virtual printer: str vs. bytes
2019-02-05 14:29:27 +01:00
Matthias Urlichs
ab3c4ab66c
Don't compare with None
2019-02-05 14:29:04 +01:00
Matthias Urlichs
1d6b7244b5
Bah. That glob-import-removal was overzealous.
2019-02-04 21:33:35 +01:00
Matthias Urlichs
ea17566aba
some more unused variables
2019-02-04 21:13:19 +01:00
Matthias Urlichs
315ed57916
Another missing import
2019-02-04 21:12:20 +01:00
Matthias Urlichs
1014582b4b
removed wildcard imports
2019-02-04 21:10:11 +01:00
Matthias Urlichs
cf77053901
missing imports
2019-02-04 21:10:04 +01:00
Matthias Urlichs
f040482b18
don't assign to an unused variable
2019-02-04 21:09:27 +01:00
Matthias Urlichs
523fadd930
Don't shadow globals
2019-02-04 21:08:32 +01:00
Matthias Urlichs
97d0fbd2c9
Don't compare with bool values
2019-02-04 21:07:53 +01:00
Matthias Urlichs
3b820f6848
Scoping error: py3 deletes exceptions after their except: block
2019-02-04 21:02:32 +01:00
Matthias Urlichs
e8b9f385b4
"has_key" is deprecated
2019-02-04 20:54:54 +01:00
Matthias Urlichs
95bc1006a0
Fix undefined "autologin_as" and "local_networks"
2019-02-04 20:49:49 +01:00
Matthias Urlichs
14ef17163f
Don't compare with None
2019-02-04 20:44:57 +01:00
Matthias Urlichs
9a1bd8af87
These are numbers so unicode() is not necessary
2019-02-04 20:35:00 +01:00
Matthias Urlichs
a292a12c4a
The lastline buffer has bytes
...
This reduces required work because we only need to convert back when
resending
2019-02-04 20:35:00 +01:00
Matthias Urlichs
200a3ef4eb
replaced a bunch of map() with generator expressions
2019-02-04 20:35:00 +01:00
Matthias Urlichs
88582beb55
grammar ;-)
2019-02-04 20:29:22 +01:00
Matthias Urlichs
6d7c8bbda6
More backslashes
2019-02-04 20:13:06 +01:00