mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Codestyle & documentation
CURA-537
This commit is contained in:
parent
efd14421cc
commit
9009fb9d3d
4 changed files with 36 additions and 23 deletions
|
@ -6,6 +6,7 @@ from UM.Logger import Logger
|
|||
from UM.SaveFile import SaveFile
|
||||
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 file path.
|
||||
|
@ -17,7 +18,7 @@ class CuraProfileWriter(ProfileWriter):
|
|||
def write(self, path, profile):
|
||||
serialised = profile.serialise()
|
||||
try:
|
||||
with SaveFile(path, "wt", -1, "utf-8") as f: #Open the specified file.
|
||||
with SaveFile(path, "wt", -1, "utf-8") as f: # Open the specified file.
|
||||
f.write(serialised)
|
||||
except Exception as e:
|
||||
Logger.log("e", "Failed to write profile to %s: %s", path, str(e))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue