def __read_history(self):
     f = open(self.__history_file, 'r')
     hist = set()
     for filename in f:
         filename = filename.strip()
         if os.path.exists(filename):
             hist.add(filename)
     f.close()
     for filename in hist:
         p = project.Project()
         persistency.load_model_from_ini(filename, p)
         p.__model_ini_filename__ = filename
         self.proj_group.add_model(p)
     self.__write_history()
 def response(dialog, resp):
     chooser.hide()
     fn = dialog.get_filename()
     chooser.destroy()
     if resp != gtk.RESPONSE_ACCEPT:
         return
     p = project.Project()
     if not fn.endswith('.pida'):
         fn = '%s.pida' % fn
     p.__model_ini_filename__ = fn
     self.proj_group.add_model(p)
     p.general__name = os.path.basename(fn).split('.')[0]
     self.proj_group.set_current(p)
     self.__write_history()
     self.cmd_edit()
 def cmd_add_project(self, project_file):
     p = project.Project()
     m = persistency.load_model_from_ini(project_file, p)
     m.__model_ini_filename__ = project_file
     self.proj_group.add_model(m)
     self.__write_history()