Fix code-style

This commit is contained in:
Diego Prado Gesto 2018-07-03 12:06:06 +02:00
parent e983a9a9e7
commit 762a1b1bfd
13 changed files with 47 additions and 33 deletions

View file

@ -244,8 +244,9 @@ class CuraContainerStack(ContainerStack):
#
# \throws InvalidContainerStackError Raised when no definition can be found for the stack.
@override(ContainerStack)
def deserialize(self, contents: str, file_name: Optional[str] = None) -> None:
super().deserialize(contents, file_name)
def deserialize(self, serialized: str, file_name: Optional[str] = None) -> str:
# update the serialized data first
serialized = super().deserialize(serialized, file_name)
new_containers = self._containers.copy()
while len(new_containers) < len(_ContainerIndexes.IndexTypeMap):
@ -253,10 +254,11 @@ class CuraContainerStack(ContainerStack):
# Validate and ensure the list of containers matches with what we expect
for index, type_name in _ContainerIndexes.IndexTypeMap.items():
container = None
try:
container = new_containers[index]
except IndexError:
container = None
pass
if type_name == "definition":
if not container or not isinstance(container, DefinitionContainer):
@ -283,6 +285,9 @@ class CuraContainerStack(ContainerStack):
from cura.Settings.CuraStackBuilder import CuraStackBuilder
CuraStackBuilder.createDefinitionChangesContainer(self, self.getId() + "_settings")
## TODO; Deserialize the containers.
return serialized
## protected:
# Helper to make sure we emit a PyQt signal on container changes.