mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fixes for SliceInfo
This commit is contained in:
parent
d0c68f8e94
commit
cfae634061
1 changed files with 5 additions and 4 deletions
|
@ -16,7 +16,7 @@ from UM.i18n import i18nCatalog
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.PluginRegistry import PluginRegistry
|
from UM.PluginRegistry import PluginRegistry
|
||||||
from UM.Qt.Duration import DurationFormat
|
from UM.Qt.Duration import DurationFormat
|
||||||
|
from typing import cast
|
||||||
from .SliceInfoJob import SliceInfoJob
|
from .SliceInfoJob import SliceInfoJob
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,7 +81,8 @@ class SliceInfo(QObject, Extension):
|
||||||
@pyqtSlot(result = str)
|
@pyqtSlot(result = str)
|
||||||
def getExampleData(self) -> str:
|
def getExampleData(self) -> str:
|
||||||
if self._example_data_content is None:
|
if self._example_data_content is None:
|
||||||
file_path = os.path.join(PluginRegistry.getInstance().getPluginPath(self.getPluginId()), "example_data.json")
|
file_path = os.path.join(cast(str, PluginRegistry.getInstance().getPluginPath(self.getPluginId())), "example_data.json")
|
||||||
|
if file_path:
|
||||||
with open(file_path, "r", encoding = "utf-8") as f:
|
with open(file_path, "r", encoding = "utf-8") as f:
|
||||||
self._example_data_content = f.read()
|
self._example_data_content = f.read()
|
||||||
return self._example_data_content
|
return self._example_data_content
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue