예제 #1
0
    def test05_RegistrySaveReadFromProject(self):
        """ test saving and restoring current exporter in project"""
        e = FolderExporter()
        e.folder = '/my_folder'
        EXPORTER_REGISTRY.writeToProject(e)

        restored = EXPORTER_REGISTRY.createFromProject()
        self.assertEqual(type(restored), FolderExporter)
        self.assertEqual(restored.exportDirectory(), '/my_folder')

        # try with a non-folder exporter
        f = FtpExporter()
        EXPORTER_REGISTRY.writeToProject(f)
        restored = EXPORTER_REGISTRY.createFromProject()
        self.assertEqual(type(restored), FtpExporter)
예제 #2
0
 def saveParameters(self):
     """
     Saves current dialog state to project
     """
     WRITER_REGISTRY.saveWriterToProject(self.createWriter())
     EXPORTER_REGISTRY.writeToProject(self.exporter)