mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Cast plug-in path of self to str
Because it can't be None.
This commit is contained in:
parent
d535008e08
commit
41c840adbc
1 changed files with 3 additions and 3 deletions
|
@ -1,9 +1,9 @@
|
||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2019 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Optional, List, Dict, Any
|
from typing import cast, Optional, List, Dict, Any
|
||||||
|
|
||||||
from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
|
from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class DrivePluginExtension(QObject, Extension):
|
||||||
|
|
||||||
def showDriveWindow(self) -> None:
|
def showDriveWindow(self) -> None:
|
||||||
if not self._drive_window:
|
if not self._drive_window:
|
||||||
plugin_dir_path = CuraApplication.getInstance().getPluginRegistry().getPluginPath(self.getPluginId())
|
plugin_dir_path = cast(str, CuraApplication.getInstance().getPluginRegistry().getPluginPath(self.getPluginId())) # We know this plug-in exists because that's us, so this always returns str.
|
||||||
path = os.path.join(plugin_dir_path, "src", "qml", "main.qml")
|
path = os.path.join(plugin_dir_path, "src", "qml", "main.qml")
|
||||||
self._drive_window = CuraApplication.getInstance().createQmlComponent(path, {"CuraDrive": self})
|
self._drive_window = CuraApplication.getInstance().createQmlComponent(path, {"CuraDrive": self})
|
||||||
self.refreshBackups()
|
self.refreshBackups()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue