diff --git a/plugins/CuraProfileReader/__init__.py b/plugins/CuraProfileReader/__init__.py index 16a24f116d..bfaa16ed5e 100644 --- a/plugins/CuraProfileReader/__init__.py +++ b/plugins/CuraProfileReader/__init__.py @@ -20,7 +20,7 @@ def getMetaData(): "extension": "curaprofile", "description": catalog.i18nc("@item:inlistbox", "Cura Profile") } - ] + ] } def register(app): diff --git a/plugins/CuraProfileWriter/CuraProfileWriter.py b/plugins/CuraProfileWriter/CuraProfileWriter.py new file mode 100644 index 0000000000..61e9fff47d --- /dev/null +++ b/plugins/CuraProfileWriter/CuraProfileWriter.py @@ -0,0 +1,19 @@ +# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2013 David Braam +# Uranium is released under the terms of the AGPLv3 or higher. + +from UM.Settings.Profile import Profile +from UM.Settings.ProfileWriter import ProfileWriter + +## Writes profiles to Cura's own profile format with config files. +class CuraProfileWriter(ProfileWriter): + ## Writes a profile to the specified stream. + # + # \param stream \type{IOStream} The stream to write the profile to. + # \param profile \type{Profile} The profile to write to that stream. + # \return \code True \endcode if the writing was successful, or \code + # False \endcode if it wasn't. + def write(self, stream, profile): + serialised = profile.serialise() + stream.write(serialised) + return True diff --git a/plugins/CuraProfileWriter/__init__.py b/plugins/CuraProfileWriter/__init__.py new file mode 100644 index 0000000000..ad8e6efe2e --- /dev/null +++ b/plugins/CuraProfileWriter/__init__.py @@ -0,0 +1,27 @@ +# Copyright (c) 2015 Ultimaker B.V. +# Uranium is released under the terms of the AGPLv3 or higher. + +from . import CuraProfileWriter + +from UM.i18n import i18nCatalog +catalog = i18nCatalog("uranium") + +def getMetaData(): + return { + "plugin": { + "name": catalog.i18nc("@label", "Cura Profile Writer"), + "author": "Ultimaker", + "version": "1.0", + "description": catalog.i18nc("@info:whatsthis", "Provides support for exporting Cura profiles."), + "api": 2 + }, + "profile_writer": [ + { + "extension": "curaprofile", + "description": catalog.i18nc("@item:inlistbox", "Cura Profile") + } + ] + } + +def register(app): + return { "profile_writer": CuraProfileWriter.CuraProfileWriter() }