Esempio n. 1
0
    def onEditor(self, ev, checkPyFile=True):
        import sys,os, __main__
        try:
            #mod = os.path.basename( filenames )
            mod = self.fn_or_fns
            if checkPyFile:
                mod = os.path.splitext( mod )[0]
                mod += '.py'
                if not os.path.isfile(mod):
                    r= wx.MessageBox("do you want to start editing a new .py-file ?", 
                                     "py file not found !", 
                                     style=wx.CENTER|wx.YES_NO|wx.CANCEL|wx.ICON_EXCLAMATION)
                    if r != wx.YES:
                        return

            from Priithon.all import Y
            Y.editor(mod)
            self.pyshell.addHistory("Y.editor( %s )"%mod)
        except:
            if NO_SPECIAL_GUI_EXCEPT:
                raise
            import sys
            e = sys.exc_info()
            wx.MessageBox("Error on starting Y.editor: %s - %s" %\
                              (str(e[0]), str(e[1]) ),
                          "Error  !?",
                          style=wx.ICON_ERROR)
Esempio n. 2
0
    def onEditor(self, ev, checkPyFile=True):
        import sys,os, __main__
        try:
            #mod = os.path.basename( filenames )
            mod = self.fn_or_fns
            if checkPyFile:
                mod = os.path.splitext( mod )[0]
                mod += '.py'
                if not os.path.isfile(mod):
                    r= wx.MessageBox("do you want to start editing a new .py-file ?", 
                                     "py file not found !", 
                                     style=wx.CENTER|wx.YES_NO|wx.CANCEL|wx.ICON_EXCLAMATION)
                    if r != wx.YES:
                        return

            from Priithon.all import Y
            Y.editor(mod)
            self.pyshell.addHistory("Y.editor( %s )"%mod)
        except:
            if NO_SPECIAL_GUI_EXCEPT:
                raise
            import sys
            e = sys.exc_info()
            wx.MessageBox("Error on starting Y.editor: %s - %s" %\
                              (str(e[0]), str(e[1]) ),
                          "Error  !?",
                          style=wx.ICON_ERROR)
Esempio n. 3
0
 def OnEditor(self, evt=None):
     from Priithon.all import Y
     Y.editor()
Esempio n. 4
0
 def OnEditor(self, evt=None):
     from Priithon.all import Y
     Y.editor()