Fix typing

This commit is contained in:
Lipu Fei 2019-03-21 09:13:00 +01:00
parent 9e92a186ec
commit cf5fd1c355
2 changed files with 11 additions and 5 deletions

View file

@ -1,11 +1,13 @@
# Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional
from PyQt5.QtCore import pyqtProperty, QObject
class MaterialOutputModel(QObject):
def __init__(self, guid: str, type: str, color: str, brand: str, name: str, parent = None) -> None:
def __init__(self, guid: Optional[str], type: str, color: str, brand: str, name: str, parent = None) -> None:
super().__init__(parent)
self._guid = guid
self._type = type
@ -15,7 +17,7 @@ class MaterialOutputModel(QObject):
@pyqtProperty(str, constant = True)
def guid(self) -> str:
return self._guid
return self._guid if self._guid else ""
@pyqtProperty(str, constant = True)
def type(self) -> str: