Using UM.Platform and correcting something minor

Since we already have UM.Platform, I think it is worth to get constancy into our code and use UM.Platform for our detection.
Additionally, I corrected the head of the file, because I think I shall mention Cura and not Uranium. I guess the plugin was moved to Cura, so this was missed.
This commit is contained in:
Thomas Karl Pietrowski 2017-01-11 19:08:46 +01:00 committed by GitHub
parent 47be957f38
commit 5891709800

View file

@ -1,7 +1,7 @@
# Copyright (c) 2015 Ultimaker B.V. # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher. # Cura is released under the terms of the AGPLv3 or higher.
import platform from UM.Platform import Platform
from UM.i18n import i18nCatalog from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura") catalog = i18nCatalog("cura")
@ -18,15 +18,15 @@ def getMetaData():
} }
def register(app): def register(app):
if platform.system() == "Windows": if Platform.isWindows():
from . import WindowsRemovableDrivePlugin from . import WindowsRemovableDrivePlugin
return { "output_device": WindowsRemovableDrivePlugin.WindowsRemovableDrivePlugin() } return { "output_device": WindowsRemovableDrivePlugin.WindowsRemovableDrivePlugin() }
elif platform.system() == "Darwin": elif Platform.isOSX():
from . import OSXRemovableDrivePlugin from . import OSXRemovableDrivePlugin
return { "output_device": OSXRemovableDrivePlugin.OSXRemovableDrivePlugin() } return { "output_device": OSXRemovableDrivePlugin.OSXRemovableDrivePlugin() }
elif platform.system() == "Linux": elif Platform.isLinux():
from . import LinuxRemovableDrivePlugin from . import LinuxRemovableDrivePlugin
return { "output_device": LinuxRemovableDrivePlugin.LinuxRemovableDrivePlugin() } return { "output_device": LinuxRemovableDrivePlugin.LinuxRemovableDrivePlugin() }
else: else:
Logger.log("e", "Unsupported system %s, no removable device hotplugging support available.", platform.system()) Logger.log("e", "Unsupported system, thus no removable device hotplugging support available.")
return { } return { }