14863 Commits

Author SHA1 Message Date
Ghostkeeper
a401c1d64f
Disambiguate between list of metadatas and metadata
Because MyPy doesn't allow a variable to change its type later.

Contributes to issue CURA-5330.
2018-06-15 17:03:04 +02:00
Ghostkeeper
79c6b2dad8
Use CuraApplication instead of Application
Because UM.Application doesn't have any getPrintJobInformation function or anything like that.

Contributes to issue CURA-5330.
2018-06-15 16:55:30 +02:00
Ghostkeeper
e717abf499
Fix typing related to Network Printing
Contributes to issue CURA-5330.
2018-06-15 16:53:45 +02:00
Ghostkeeper
b07db74011
Fix more typing errors
It never ends.

Contributes to issue CURA-5330.
2018-06-15 15:44:29 +02:00
Ghostkeeper
cfd0bde6b1
Use CuraApplication instead of Application
Because UM.Application has no function getMultiBuildPlateModel.

Contributes to issue CURA-5330.
2018-06-15 15:32:44 +02:00
Ghostkeeper
797d05947c
Fix type errors
Contributes to issue CURA-5330.
2018-06-15 15:20:41 +02:00
Ghostkeeper
9821793b46
Don't override boundingbox of SceneNode
Whatever was intended here, it didn't work. Because when a method is called it is called on the class of the object. Methods are not attributes of instances but attributes of the class. The attribute of the class was never changed, so this had no effect.

Contributes to issue CURA-5330.
2018-06-15 15:16:55 +02:00
Ghostkeeper
10f22f9c25
Cast result of getPluginObject to the plug-in type it implements
We know for sure what the type of that plug-in is, only we can't import that type because it's a plug-in. We can (and did) import the plug-in type object MeshWriter though.

Contributes to issue CURA-5330.
2018-06-15 15:09:19 +02:00
Ghostkeeper
e957f7b650
Fix typing errors
Contributes to issue CURA-5330.
2018-06-15 15:07:08 +02:00
Ghostkeeper
2b33a1f1b6
Fix broken import with DefinitionContainerInterface
And the ensuing type error that can then be found.

Contributes to issue CURA-5330.
2018-06-15 14:31:29 +02:00
Ghostkeeper
0d52b03716
Fix the wrong types in this class
These mistakes were found by MyPy.

Contributes to issue CURA-5330.
2018-06-15 14:25:25 +02:00
Ghostkeeper
4c3d28709b
Add typing for all functions and fields
Lots of typing so that MyPy can then check whether the functions are safe to call.

Contributes to issue CURA-5330.
2018-06-15 14:07:33 +02:00
Ghostkeeper
8256788ed8
Use CuraApplication instead of Application
Because we need to call getExtruderManager which is only in CuraApplication.

Contributes to issue CURA-5330.
2018-06-15 13:40:43 +02:00
Ghostkeeper
a021820031
Fix call to getIdAtPosition
I fixed the typing in the wrong way here. Sorry.

Contributes to issue CURA-5330.
2018-06-15 13:34:39 +02:00
Ghostkeeper
7a33a8f212
Always import CuraVersion
I don't know why there was this check around it because it is always necessary to start the application.

Contributes to issue CURA-5330.
2018-06-15 13:28:55 +02:00
Ghostkeeper
1789a8f33e
Fix type of SelectionPass
Contributes to issue CURA-5330.
2018-06-15 13:20:20 +02:00
Ghostkeeper
fe43219e34
Fix minor type mistakes
Contributes to issue CURA-5330.
2018-06-15 13:14:56 +02:00
Ghostkeeper
75e5a185d9
Don't unnecessarily cast to a set
The InstanceContainer version of getAllKeys was first casting to a list but I removed that, because everywhere where we were using it we were casting it directly to a set.

Contributes to issue CURA-5330.
2018-06-15 13:07:55 +02:00
Ghostkeeper
b9727a33c6
Fix type of QtRenderer
Because we're calling getWindowSize on it so it must be the QtRenderer, not the Renderer.

Contributes to issue CURA-5330.
2018-06-15 11:38:11 +02:00
Ghostkeeper
ab32d64c01
Add types for ShaderPrograms
Otherwise it'll think that this variable can only have None in it.

Contributes to issue CURA-5330.
2018-06-15 11:34:35 +02:00
Ghostkeeper
7d98167383
Ignore type errors arising from misinterpretation of DepthFirstIterator type
MyPy requests that this needs to have a __next__ function, but actually Python calls the __iter__ function first and then calls the __next__ function on the result of that. MyPy is wrong here.

Contributes to issue CURA-5330.
2018-06-15 11:30:49 +02:00
Ghostkeeper
105f6d4271
Fix type of self._shader
MyPy was thinking that this variable has type None, which is nonsense because no variable should always have type None.

Contributes to issue CURA-5330.
2018-06-15 11:25:16 +02:00
Ghostkeeper
eda0d34fd9
Call from QtApplication instead of Application
Because we're using createQmlComponent which is only in QtApplication.

Contributes to issue CURA-5330.
2018-06-15 11:21:59 +02:00
Ghostkeeper
6e663ac6f5
Don't call getMachineManager on Uranium's application
It is a function of CuraApplication.

Contributes to issue CURA-5330.
2018-06-15 11:15:31 +02:00
Ghostkeeper
c3d4d5eba7
Ignore MyPy errors caused by DepthFirstIterator not being detected as iterator
MyPy is wrong in this case.

Contributes to issue CURA-5330.
2018-06-15 11:02:15 +02:00
Ghostkeeper
4418cf3aac
Prevent accessing private _instances variable
We can get at this via the getProperty function.

Contributes to issue CURA-5330.
2018-06-15 10:59:41 +02:00
Ghostkeeper
01a645e726
Use only CuraApplication
It was complaining that getMachineManager doesn't exist, because that is in CuraApplication instead of UM.Application. I removed all references to UM.Application so that the imports are a bit simpler.

Contributes to issue CURA-5330.
2018-06-15 10:28:07 +02:00
Diego Prado Gesto
b309e93767 CURA-5330 Fix typing in the VersionUpgrade plugin 2018-06-14 16:54:22 +02:00
Diego Prado Gesto
dc4556647a CURA-5330 Fix code style in XmlMaterialProfile plugin 2018-06-14 16:49:26 +02:00
Diego Prado Gesto
a184fad8ee CURA-5330 Add typing to the USBPrinting plugin 2018-06-14 15:57:30 +02:00
Diego Prado Gesto
7eba868574 CURA-5330 Fix typing and code style in the UM3NetworkPrinting plugin 2018-06-14 15:41:12 +02:00
Ghostkeeper
b331736cb2
Let _findInstanceContainerDefinitionId work with DefinitionContainerInterface
But where it needs the .id field it needs to ignore this type because this works with getattr weirdness.

Contributes to issue CURA-5330.
2018-06-14 09:58:16 +02:00
Ghostkeeper
eac3c759cd
Cast each container in their stack to actual types
We know for sure that these containers have those types. We'll accept the risk here that this assumption was wrong.

Contributes to issue CURA-5330.
2018-06-14 09:58:07 +02:00
Diego Prado Gesto
eb65a11e18 CURA-5330 Fix code style and typing in Toolbox plugin 2018-06-13 18:22:27 +02:00
Diego Prado Gesto
0a21ce44b0 CURA-5330 Fix code style and typing in GCodeReader plugin 2018-06-13 17:36:04 +02:00
Diego Prado Gesto
51888d86fe CURA-5330 Fix typing check 2018-06-13 17:13:33 +02:00
Ghostkeeper
5bf553c63c
Merge branch 'mypy_fixes' of ssh://github.com/Ultimaker/Cura into mypy_fixes 2018-06-13 17:03:31 +02:00
Diego Prado Gesto
eca23e5b5d CURA-5330 Fix typing in 3MFReader plugin 2018-06-13 16:48:08 +02:00
Diego Prado Gesto
f2768fd761 CURA-5330 Fix typing in the Backups 2018-06-13 16:35:48 +02:00
Diego Prado Gesto
f700a39547 CURA-5330 Fix type checking in ContainerNodes 2018-06-13 16:10:11 +02:00
Diego Prado Gesto
803d945fb6 CURA-5330 Add assertions when the networkmanager is not None after creating it. 2018-06-13 13:35:17 +02:00
Diego Prado Gesto
d03b0e610b CURA-5330 Fix typing in the PreviewPass 2018-06-13 11:56:53 +02:00
Diego Prado Gesto
554a3fd908 Merge branch 'master' into mypy_fixes
Conflicts:
cura/Backups/Backup.py
cura/Settings/ExtruderManager.py
cura/Settings/MachineManager.py
2018-06-13 11:53:02 +02:00
Diego Prado Gesto
3a00ddb01d Merge branch 'master' of github.com:Ultimaker/Cura 2018-06-13 11:33:20 +02:00
Diego Prado Gesto
981eed313c FindNodePlacement should find a placement for the node, but not creating
a new node.
2018-06-13 11:28:20 +02:00
Lipu Fei
439ea79c60 Add message for unable to slice due to disabled extruders
CURA-5456
2018-06-13 11:09:20 +02:00
Diego Prado Gesto
f1b0c6238f CURA-5330 Add return type to some constructors 2018-06-13 11:01:30 +02:00
Diego Prado Gesto
6e364f0895 CURA-5330 Fix typing and code-style in the ContainerNode and all the
related children, and QualityGroup and its children.
Also fix the related calls in the managers.
2018-06-13 10:55:57 +02:00
Lipu Fei
b0b4f78cf2 Revert "Update SettingOverrideDecorator upon extruder enabled/disabled"
CURA-5456

This reverts commit 7a6e7112765c386c7d1ac1ac52fce132b67240ba.
2018-06-13 10:34:01 +02:00
Lipu Fei
880e098031 Revert "Fix for code style checks"
CURA-5456

This reverts commit cc11e0a2425f0f5a6cb71005cdee1c92cd6736c2.
2018-06-13 10:33:55 +02:00