Esempio n. 1
0
 def save_workspace_to_file(self, filename, remember_uri=True):
     from pycam.Flow.parser import dump_yaml
     if remember_uri:
         self.last_workspace_uri = pycam.Utils.URIHandler(filename)
         self.settings.emit_event("notify-file-opened", filename)
     log.info("Storing workspace in file: %s", filename)
     try:
         with open_file_context(filename, "w", True) as out_file:
             dump_yaml(target=out_file)
     except OSError as exc:
         log.error("Failed to store workspace in file '%s': %s", filename,
                   exc)
Esempio n. 2
0
 def __init__(self):
     """ create a representation of the current state of all collections """
     self.timestamp = datetime.datetime.now()
     self.dump = dump_yaml()