コード例 #1
0
    def NewMVContext(self, parent, name):
        def _Error(message):
            dlg = wx.MessageDialog(self._view.GetParent(), message, "Error!",
                                   wx.OK | wx.ICON_INFORMATION)
            dlg.ShowModal()
            dlg.Destroy()
            return None

        if name in [child.name for child in parent.children]:
            return _Error(
                "Can't create new many-valued context, file '{0}' already exists"
                .format(name))
        new_path = os.path.join(parent.path, name)
        try:
            fca.write_mv_txt(fca.ManyValuedContext(), new_path)
        except:
            #TODO: Error handler
            return _Error(
                "Can't create new many-valued context, something wrong")

        new_item = WorkspaceItem(name,
                                 new_path,
                                 False,
                                 parent,
                                 type="Many-valued context")
        self.SaveWorkspace()
        return new_item
コード例 #2
0
ファイル: workspacemodel.py プロジェクト: jupp/meud-wx
 def NewMVContext(self, parent, name):
     
     def _Error(message):
         dlg = wx.MessageDialog(self._view.GetParent(), message,
                         "Error!",
                         wx.OK | wx.ICON_INFORMATION
                         )
         dlg.ShowModal()
         dlg.Destroy()
         return None
     
     if name in [child.name for child in parent.children]:
         return _Error("Can't create new many-valued context, file '{0}' already exists".format(name))
     new_path = os.path.join(parent.path, name)
     try:
         fca.write_mv_txt(fca.ManyValuedContext(), new_path)
     except:
         #TODO: Error handler
         return _Error("Can't create new many-valued context, something wrong")
         
     new_item = WorkspaceItem(name, new_path, False, parent, type="Many-valued context")
     self.SaveWorkspace()
     return new_item
コード例 #3
0
ファイル: contextgrid.py プロジェクト: jupp/meud-wx
 def SaveAs(self, path):
     fca.write_mv_txt(self.context, path)
     self._item = self._model.FileSaveAs(path, self._view)
コード例 #4
0
ファイル: contextgrid.py プロジェクト: jupp/meud-wx
 def Save(self):
     self._model.DoSaved(self._item)
     fca.write_mv_txt(self.context, self.path)
コード例 #5
0
 def SaveAs(self, path):
     fca.write_mv_txt(self.context, path)
     self._item = self._model.FileSaveAs(path, self._view)
コード例 #6
0
 def Save(self):
     self._model.DoSaved(self._item)
     fca.write_mv_txt(self.context, self.path)