Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /newedit/src/, /newedit/src/lang/, /newedit/src/mixins/, /newedit/src/modules/, /newedit/src/tools/

newedit
Discussion topic

Back to topic list

CVS update: /newedit/src/, /newedit/src/lang/, /newedit/src/mixins/, /newedit/src/modules/, /newedit/src/tools/

Reply

Author limodou
Full name limodou
Date 2004-12-23 07:41:58 PST
Message User: limodou
Date: 04/12/23 07:41:58

Added:
 /newedit/src/mixins/
  InterpreterDialog.py

Modified:
 /newedit/src/
  ChangeLog.txt
 /newedit/src/lang/
  newedit_cn.mo
 /newedit/src/mixins/
  Import.py, MyPanel.py, PrefDialog.py, ShellDialog.py, mEditorCtrl.py,
  mPyRun.py, mRun.py, mShellRun.py
 /newedit/src/modules/
  Entry.py
 /newedit/src/tools/
  files.txt, newedit_cn.po

Log:
 add interpreter option

File Changes:

Directory: /newedit/src/
========================

File [changed]: ChangeLog.txt
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/ChangeLo​g.txt?r1=1.123&r​2=1.124
Delta lines: +5 -0
-------------------
--- ChangeLog.txt 27 Nov 2004 15:52:08 -0000 1.123
+++ ChangeLog.txt 23 Dec 2004 15:41:57 -0000 1.124
@@ -1,3 +1,8 @@
+[2004/12/23]
+InterpreterDialog.py mPyRun.py mRun.py
+ Ôö¼ÓÉèÖýâÊÍÆ÷¹¦ÄÜ£¬​¿ÉÒÔÔÚÔËÐÐʱִÐÐҪʹ​ÓõĽâÊÍÆ÷£¬Í¬Ê±¿ÉÒÔ​ÉèÖÃÊÇ·ñʹÓÃÊäÈëÊä³ö​Öض¨Ïò
+
+mShellRun.py ÐÞÕýÖ´ÐÐÍⲿ²Ëµ¥Ê±Ê¹​ÓÃos.startfile()
 [2004/11/27]
 SnippetClass.py SnippetWindow.py
                 ÐÞÕýµ±snippet²»´æÔÚÊ​±´´½¨Â·¾¶µÄ´¦Àí

Directory: /newedit/src/lang/
=============================

File [changed]: newedit_cn.mo
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/lang/new​edit_cn.mo?rev=1.42​&content-type=tex​t/vnd.viewcvs-markup​
Directory: /newedit/src/mixins/
===============================

File [changed]: Import.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/I​mport.py?r1=1.65​&r2=1.66
Delta lines: +64 -36
---------------------
--- Import.py 27 Nov 2004 15:52:08 -0000 1.65
+++ Import.py 23 Dec 2004 15:41:58 -0000 1.66
@@ -20,7 +20,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: Import.py,v 1.65 2004/11/27 15:52:08 limodou Exp $
+# $Id: Import.py,v 1.66 2004/12/23 15:41:58 limodou Exp $
 
 
 #----------------------- mPreference.py ------------------
@@ -292,7 +292,6 @@
         dlg.SetFilterIndex(g​etFilterIndex(win))
         if (dlg.ShowModal() == wx.ID_OK):
             filename = dlg.GetPath()
- print filename
             dlg.Destroy()
 
             #check if the filename has been openned, if openned then fail
@@ -3007,6 +3006,7 @@
 import wx
 import locale
 import types
+import os
 
 
 def init(win):
@@ -3028,8 +3028,11 @@
     win.writeposition = 0
 Mixin.setPlugin('mes​sagewindow', 'init', init)
 
-def RunCommand(win, command, guiflag=False):
+def RunCommand(win, command, guiflag=False, redirect=True):
     """replace $file = current document filename"""
+ if redirect:
+ win.createMessageWindow()
+
     win.panel.showPage(t​r('Message'))
 
     win.messagewindow.SetText('')
@@ -3051,6 +3054,8 @@
         dlg = wx.MessageDialog(win, tr("There are some problems when running the program!\nPlease run it in shell.") ,
             "Stop running", wx.OK | wx.ICON_INFORMATION)
         dlg.ShowModal()
+ else:
+ os.system(command)
 Mixin.setMixin('mainframe', 'RunCommand', RunCommand)
 
 def OnIdle(win, event):
@@ -3088,7 +3093,7 @@
                 text = text.encode(locale.g​etdefaultlocale()[1]​)
             win.outputstream.write(text + '\n')
             win.GotoPos(win.GetLength())
- if (keycode == wx.WXK_UP):
+ if keycode == wx.WXK_UP:
             l = len(win.CommandArray)
             if (len(win.CommandArray) > 0):
                 if (win.CommandArrayPos + 1) < l:
@@ -3098,8 +3103,8 @@
                     win.CommandArrayPos = win.CommandArrayPos + 1
                     win.ReplaceTarget(wi​n.CommandArray[win.C​ommandArrayPos])
 
- elif (keycode == wx.WXK_DOWN):
- if (len(win.CommandArray) > 0):
+ elif keycode == wx.WXK_DOWN:
+ if len(win.CommandArray) > 0:
                 win.GotoPos(win.editpoint)
                 win.SetTargetStart(w​in.editpoint)
                 win.SetTargetEnd(win​.GetLength())
@@ -3140,6 +3145,7 @@
         text = win.messagewindow.er​rorstream.read()
         appendtext(win.messagewindow, text)
 
+ if win.messagewindow.process:
     win.messagewindow.pr​ocess.Destroy()
     win.messagewindow.process = None
     win.messagewindow.pid = -1
@@ -3521,8 +3527,25 @@
 from modules import Mixin
 import wx
 import os.path
+import sys
 from modules import common
 
+def init(pref):
+ pref.python_interpreter = [('default', sys.executable)]
+ pref.default_interpreter = 'default'
+Mixin.setPlugin('preference', 'init', init)
+
+def OnSetInterpreter(win, event):
+ from InterpreterDialog import InterpreterDialog
+ dlg = InterpreterDialog(win, win.pref)
+ dlg.ShowModal()
+Mixin.setMixin('prefdialog', 'OnSetInterpreter', OnSetInterpreter)
+
+preflist = [
+ ('Python', 150, 'button', 'python_interpreter', tr('Setup python interpreter'), 'OnSetInterpreter'),
+]
+Mixin.setMixin('preference', 'preflist', preflist)
+
 menulist = [('IDM_PYTHON', #parent menu id
         [
             (120, '', '-', wx.ITEM_SEPARATOR, None, ''),
@@ -3535,10 +3558,12 @@
 
 def init(win):
     win.args = ''
+ win.redirect = True
 Mixin.setPlugin('editor', 'init', init)
 
 def OnPythonRun(win, event):
- win.createMessageWindow()
+ interpreters = dict(win.pref.python​_interpreter)
+ interpreter = interpreters[win.pre​f.default_interprete​r]
 
     if win.document.isModified() or win.document.filename == '':
         d = wx.MessageDialog(win, tr("The file has not been saved, and it would not be run.\nWould you like to save the file?"), tr("Run"), wx.YES_NO | wx.ICON_QUESTION)
@@ -3552,25 +3577,28 @@
     args = args.replace('$file', win.document.filename)
     ext = os.path.splitext(win​.document.filename)[​1].lower()
     if ext == '.pyw':
- command = 'pythonw -u "%s" %s' % (win.document.filename, args)
+ command = interpreter + 'w -u "%s" %s' % (win.document.filename, args)
         guiflag = True
     else:
- command = 'python -u "%s" %s' % (win.document.filename, args)
+ command = interpreter + ' -u "%s" %s' % (win.document.filename, args)
         guiflag = False
     #chanage current path to filename's dirname
     path = os.path.dirname(win.​document.filename)
     os.chdir(common.enco​de_string(path))
 
- win.RunCommand(command, guiflag)
+ win.RunCommand(command, guiflag, redirect=win.document.redirect)
 Mixin.setMixin('mainframe', 'OnPythonRun', OnPythonRun)
 
 def OnPythonSetArgs(win, event):
- from modules import Entry
+ from InterpreterDialog import PythonArgsDialog
 
- dlg = Entry.MyTextEntry(win, tr("Command Line Arguments"), tr("Enter the command line arguments:\n$file will be replaced by current document filename\n$path will be replaced by current document filename's directory"), win.document.args)
+ dlg = PythonArgsDialog(win, win.pref, tr('Set Python Arguments'),
+ tr("Enter the command line arguments:\n$file will be replaced by current document filename\n$path will be replaced by current document filename's directory"),
+ win.document.args, win.document.redirect)
     answer = dlg.ShowModal()
     if answer == wx.ID_OK:
         win.document.args = dlg.GetValue()
+ win.document.redirect = dlg.GetRedirect()
 Mixin.setMixin('mainframe', 'OnPythonSetArgs', OnPythonSetArgs)
 
 def OnPythonEnd(win, event):
@@ -3693,7 +3721,7 @@
     command = win.pref.shells[index][1]
     command = command.replace('$path', os.path.dirname(win.​document.filename))
     command = command.replace('$file', win.document.filename)
- win.RunCommand(command)
+ os.startfile(command)
 Mixin.setMixin('mainframe', 'OnShellItems', OnShellItems)
 
 

File [added]: InterpreterDialog.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/I​nterpreterDialog.py?​rev=1.1&content-​type=text/vnd.viewcv​s-markup
Added lines: 0
--------------

File [changed]: MyPanel.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/M​yPanel.py?r1=1.6​&r2=1.7
Delta lines: +4 -4
-------------------
--- MyPanel.py 14 Oct 2004 03:27:12 -0000 1.6
+++ MyPanel.py 23 Dec 2004 15:41:58 -0000 1.7
@@ -19,7 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: MyPanel.py,v 1.6 2004/10/14 03:27:12 limodou Exp $
+# $Id: MyPanel.py,v 1.7 2004/12/23 15:41:58 limodou Exp $
 #
 # This file's code is mostly copy from DrPython. Thanks to Daniel Pozmanter
 
@@ -283,7 +283,7 @@
         elif name == 'bottom':
             notebook = self.bottombook
             if not self.bottombook:
- self.bottombook = Notebook(self.bottom, self, name)
+ self.bottombook = Notebook(self.bottom, self, name, style=wx.NB_BOTTOM)
             return self.bottombook
 
     def addPage(self, panelname, page, name):
@@ -321,10 +321,10 @@
 ]
     imagelist = {}
 
- def __init__(self, parent, panel, side):
+ def __init__(self, parent, panel, side, style=0):
         self.initmixin()
 
- wx.Notebook.__init__(self, parent, -1)
+ wx.Notebook.__init__(self, parent, -1, style=style)
         self.parent = parent
         self.panel = panel
         self.side = side

File [changed]: PrefDialog.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/P​refDialog.py?r1=1.2​&r2=1.3
Delta lines: +16 -9
--------------------
--- PrefDialog.py 14 Oct 2004 03:27:12 -0000 1.2
+++ PrefDialog.py 23 Dec 2004 15:41:58 -0000 1.3
@@ -19,7 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: PrefDialog.py,v 1.2 2004/10/14 03:27:12 limodou Exp $
+# $Id: PrefDialog.py,v 1.3 2004/12/23 15:41:58 limodou Exp $
 
 import wx
 import Preference
@@ -41,17 +41,17 @@
         self.box1 = wx.BoxSizer(wx.VERTICAL)
         self.notebook = wx.Notebook(self, -1)
         self.addPages(self.notebook)
- self.box1.Add(self.notebook, 1, wx.EXPAND|wx.ALL, 5)
+ self.box1.Add(self.notebook, 1, wx.EXPAND|wx.ALL, 3)
 
         self.box2 = wx.BoxSizer(wx.HORIZONTAL)
 
- self.btnok = wx.Button(self, wx.ID_OK, tr("OK"), size=(60, 20))
+ self.btnok = wx.Button(self, wx.ID_OK, tr("OK"), size=(60, 22))
         self.btnok.SetDefault()
- self.box2.Add(self.btnok, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
- self.btncancel = wx.Button(self, wx.ID_CANCEL, tr("Cancel"), size=(60, 20))
- self.box2.Add(self.btncancel, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
+ self.box2.Add(self.btnok, 0, wx.ALIGN_CENTRE|wx.ALL, 3)
+ self.btncancel = wx.Button(self, wx.ID_CANCEL, tr("Cancel"), size=(60, 22))
+ self.box2.Add(self.btncancel, 0, wx.ALIGN_CENTRE|wx.ALL, 3)
 
- self.box1.Add(self.box2, 0, wx.ALIGN_CENTER|wx.ALL, 5)
+ self.box1.Add(self.box2, 0, wx.ALIGN_CENTER|wx.ALL, 3)
 
         self.SetSizer(self.box1)
         self.SetAutoLayout(True)
@@ -81,7 +81,7 @@
             self.addItem(page, kind, prefname, prefvalue, message, extern)
 
     def addItem(self, page, kind, prefname, prefvalue, message, extern):
- if self.execplugin(self, page, type, prefname, prefvalue, message, extern):
+ if self.execplugin("additem", self, page, type, prefname, prefvalue, message, extern):
             return
         if kind == 'check':
             obj = wx.CheckBox(page, -1, message)
@@ -90,7 +90,7 @@
         elif kind == 'num':
             obj = wx.BoxSizer(wx.HORIZONTAL)
             obj.Add(wx.StaticText(page, -1, message), 0, wx.ALIGN_CENTER_VERT​ICAL|wx.RIGHT, 10)
- nc = wx.SpinCtrl(page, min=1, max=100000, size=(60, 20))
+ nc = wx.SpinCtrl(page, min=1, max=100000, size=(60, 22))
             nc.SetValue(prefvalue)
             obj.Add(nc, 0)
             self.items[prefname] = (nc, nc.GetValue)
@@ -111,6 +111,13 @@
             tc = wx.TextCtrl(page, -1, prefvalue)
             obj.Add(tc, 0)
             self.items[prefname] = (tc, tc.GetValue)
+ elif kind == 'button':
+ #message is button's label
+ #extern is button event handler function
+ button_id = wx.NewId()
+ obj = wx.Button(page, button_id, message)
+ func = getattr(self, extern)
+ wx.EVT_BUTTON(obj, button_id, func)
         page.box.Add(obj, 0, wx.LEFT|wx.TOP|wx.RIGHT, 5)
 
     def getObj(self, name):

File [changed]: ShellDialog.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/S​hellDialog.py?r1=1.4​&r2=1.5
Delta lines: +8 -11
--------------------
--- ShellDialog.py 14 Oct 2004 03:27:12 -0000 1.4
+++ ShellDialog.py 23 Dec 2004 15:41:58 -0000 1.5
@@ -19,17 +19,14 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: ShellDialog.py,v 1.4 2004/10/14 03:27:12 limodou Exp $
+# $Id: ShellDialog.py,v 1.5 2004/12/23 15:41:58 limodou Exp $
 
 __doc__ = 'run shell command'
 
 from modules import Mixin
 import wx
-from modules import makemenu
 import sys
 import os.path
-import wx.lib.dialogs
-import traceback
 from modules import Entry
 
 class ShellDialog(wx.Dialog):
@@ -56,20 +53,20 @@
         self.ID_ADD = wx.NewId()
         self.ID_REMOVE = wx.NewId()
         self.ID_MODIFY = wx.NewId()
- self.btnUp = wx.Button(self, self.ID_UP, tr("Up"), size=(60, 20))
+ self.btnUp = wx.Button(self, self.ID_UP, tr("Up"), size=(60, 22))
         box2.Add(self.btnUp, 0, 0, 5)
- self.btnDown = wx.Button(self, self.ID_DOWN, tr("Down"), size=(60, 20))
+ self.btnDown = wx.Button(self, self.ID_DOWN, tr("Down"), size=(60, 22))
         box2.Add(self.btnDown, 0, 0, 5)
- self.btnAdd = wx.Button(self, self.ID_ADD, tr("Add"), size=(60, 20))
+ self.btnAdd = wx.Button(self, self.ID_ADD, tr("Add"), size=(60, 22))
         box2.Add(self.btnAdd, 0, 0, 5)
- self.btnModify = wx.Button(self, self.ID_MODIFY, tr("Modify"), size=(60, 20))
+ self.btnModify = wx.Button(self, self.ID_MODIFY, tr("Modify"), size=(60, 22))
         box2.Add(self.btnModify, 0, 0, 5)
- self.btnRemove = wx.Button(self, self.ID_REMOVE, tr("Remove"), size=(60, 20))
+ self.btnRemove = wx.Button(self, self.ID_REMOVE, tr("Remove"), size=(60, 22))
         box2.Add(self.btnRemove, 0, 0, 5)
- self.btnOK = wx.Button(self, wx.ID_OK, tr("OK"), size=(60, 20))
+ self.btnOK = wx.Button(self, wx.ID_OK, tr("OK"), size=(60, 22))
         self.btnOK.SetDefault()
         box2.Add(self.btnOK, 0, 0, 5)
- self.btnCancel = wx.Button(self, wx.ID_CANCEL, tr("Cancel"), size=(60, 20))
+ self.btnCancel = wx.Button(self, wx.ID_CANCEL, tr("Cancel"), size=(60, 22))
         box2.Add(self.btnCancel, 0, 0, 5)
         box.Add(box2, 0, wx.ALIGN_CENTER|wx.ALL, 5)
 

File [changed]: mEditorCtrl.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/m​EditorCtrl.py?r1=1.9​&r2=1.10
Delta lines: +1 -2
-------------------
--- mEditorCtrl.py 12 Nov 2004 15:10:24 -0000 1.9
+++ mEditorCtrl.py 23 Dec 2004 15:41:58 -0000 1.10
@@ -19,7 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: mEditorCtrl.py,v 1.9 2004/11/12 15:10:24 limodou Exp $
+# $Id: mEditorCtrl.py,v 1.10 2004/12/23 15:41:58 limodou Exp $
 
 from modules import Mixin
 import wx
@@ -202,7 +202,6 @@
         dlg.SetFilterIndex(g​etFilterIndex(win))
         if (dlg.ShowModal() == wx.ID_OK):
             filename = dlg.GetPath()
- print filename
             dlg.Destroy()
 
             #check if the filename has been openned, if openned then fail

File [changed]: mPyRun.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/m​PyRun.py?r1=1.5&​r2=1.6
Delta lines: +29 -7
--------------------
--- mPyRun.py 10 Nov 2004 01:00:19 -0000 1.5
+++ mPyRun.py 23 Dec 2004 15:41:58 -0000 1.6
@@ -19,13 +19,30 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: mPyRun.py,v 1.5 2004/11/10 01:00:19 limodou Exp $
+# $Id: mPyRun.py,v 1.6 2004/12/23 15:41:58 limodou Exp $
 
 from modules import Mixin
 import wx
 import os.path
+import sys
 from modules import common
 
+def init(pref):
+ pref.python_interpreter = [('default', sys.executable)]
+ pref.default_interpreter = 'default'
+Mixin.setPlugin('preference', 'init', init)
+
+def OnSetInterpreter(win, event):
+ from InterpreterDialog import InterpreterDialog
+ dlg = InterpreterDialog(win, win.pref)
+ dlg.ShowModal()
+Mixin.setMixin('prefdialog', 'OnSetInterpreter', OnSetInterpreter)
+
+preflist = [
+ ('Python', 150, 'button', 'python_interpreter', tr('Setup python interpreter'), 'OnSetInterpreter'),
+]
+Mixin.setMixin('preference', 'preflist', preflist)
+
 menulist = [('IDM_PYTHON', #parent menu id
         [
             (120, '', '-', wx.ITEM_SEPARATOR, None, ''),
@@ -38,10 +55,12 @@
 
 def init(win):
     win.args = ''
+ win.redirect = True
 Mixin.setPlugin('editor', 'init', init)
 
 def OnPythonRun(win, event):
- win.createMessageWindow()
+ interpreters = dict(win.pref.python​_interpreter)
+ interpreter = interpreters[win.pre​f.default_interprete​r]
 
     if win.document.isModified() or win.document.filename == '':
         d = wx.MessageDialog(win, tr("The file has not been saved, and it would not be run.\nWould you like to save the file?"), tr("Run"), wx.YES_NO | wx.ICON_QUESTION)
@@ -55,25 +74,28 @@
     args = args.replace('$file', win.document.filename)
     ext = os.path.splitext(win​.document.filename)[​1].lower()
     if ext == '.pyw':
- command = 'pythonw -u "%s" %s' % (win.document.filename, args)
+ command = interpreter + 'w -u "%s" %s' % (win.document.filename, args)
         guiflag = True
     else:
- command = 'python -u "%s" %s' % (win.document.filename, args)
+ command = interpreter + ' -u "%s" %s' % (win.document.filename, args)
         guiflag = False
     #chanage current path to filename's dirname
     path = os.path.dirname(win.​document.filename)
     os.chdir(common.enco​de_string(path))
 
- win.RunCommand(command, guiflag)
+ win.RunCommand(command, guiflag, redirect=win.document.redirect)
 Mixin.setMixin('mainframe', 'OnPythonRun', OnPythonRun)
 
 def OnPythonSetArgs(win, event):
- from modules import Entry
+ from InterpreterDialog import PythonArgsDialog
 
- dlg = Entry.MyTextEntry(win, tr("Command Line Arguments"), tr("Enter the command line arguments:\n$file will be replaced by current document filename\n$path will be replaced by current document filename's directory"), win.document.args)
+ dlg = PythonArgsDialog(win, win.pref, tr('Set Python Arguments'),
+ tr("Enter the command line arguments:\n$file will be replaced by current document filename\n$path will be replaced by current document filename's directory"),
+ win.document.args, win.document.redirect)
     answer = dlg.ShowModal()
     if answer == wx.ID_OK:
         win.document.args = dlg.GetValue()
+ win.document.redirect = dlg.GetRedirect()
 Mixin.setMixin('mainframe', 'OnPythonSetArgs', OnPythonSetArgs)
 
 def OnPythonEnd(win, event):

File [changed]: mRun.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/m​Run.py?r1=1.5&r2​=1.6
Delta lines: +37 -30
---------------------
--- mRun.py 10 Nov 2004 01:00:19 -0000 1.5
+++ mRun.py 23 Dec 2004 15:41:58 -0000 1.6
@@ -19,12 +19,13 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: mRun.py,v 1.5 2004/11/10 01:00:19 limodou Exp $
+# $Id: mRun.py,v 1.6 2004/12/23 15:41:58 limodou Exp $
 
 from modules import Mixin
 import wx
 import locale
 import types
+import os
 
 
 def init(win):
@@ -46,8 +47,11 @@
     win.writeposition = 0
 Mixin.setPlugin('mes​sagewindow', 'init', init)
 
-def RunCommand(win, command, guiflag=False):
+def RunCommand(win, command, guiflag=False, redirect=True):
     """replace $file = current document filename"""
+ if redirect:
+ win.createMessageWindow()
+
     win.panel.showPage(t​r('Message'))
 
     win.messagewindow.SetText('')
@@ -69,6 +73,8 @@
         dlg = wx.MessageDialog(win, tr("There are some problems when running the program!\nPlease run it in shell.") ,
             "Stop running", wx.OK | wx.ICON_INFORMATION)
         dlg.ShowModal()
+ else:
+ os.system(command)
 Mixin.setMixin('mainframe', 'RunCommand', RunCommand)
 
 def OnIdle(win, event):
@@ -106,7 +112,7 @@
                 text = text.encode(locale.g​etdefaultlocale()[1]​)
             win.outputstream.write(text + '\n')
             win.GotoPos(win.GetLength())
- if (keycode == wx.WXK_UP):
+ if keycode == wx.WXK_UP:
             l = len(win.CommandArray)
             if (len(win.CommandArray) > 0):
                 if (win.CommandArrayPos + 1) < l:
@@ -116,8 +122,8 @@
                     win.CommandArrayPos = win.CommandArrayPos + 1
                     win.ReplaceTarget(wi​n.CommandArray[win.C​ommandArrayPos])
 
- elif (keycode == wx.WXK_DOWN):
- if (len(win.CommandArray) > 0):
+ elif keycode == wx.WXK_DOWN:
+ if len(win.CommandArray) > 0:
                 win.GotoPos(win.editpoint)
                 win.SetTargetStart(w​in.editpoint)
                 win.SetTargetEnd(win​.GetLength())
@@ -158,6 +164,7 @@
         text = win.messagewindow.er​rorstream.read()
         appendtext(win.messagewindow, text)
 
+ if win.messagewindow.process:
     win.messagewindow.pr​ocess.Destroy()
     win.messagewindow.process = None
     win.messagewindow.pid = -1

File [changed]: mShellRun.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/m​ShellRun.py?r1=1.3​&r2=1.4
Delta lines: +2 -2
-------------------
--- mShellRun.py 14 Oct 2004 03:27:12 -0000 1.3
+++ mShellRun.py 23 Dec 2004 15:41:58 -0000 1.4
@@ -19,7 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: mShellRun.py,v 1.3 2004/10/14 03:27:12 limodou Exp $
+# $Id: mShellRun.py,v 1.4 2004/12/23 15:41:58 limodou Exp $
 
 __doc__ = 'run shell command'
 
@@ -90,6 +90,6 @@
     command = win.pref.shells[index][1]
     command = command.replace('$path', os.path.dirname(win.​document.filename))
     command = command.replace('$file', win.document.filename)
- win.RunCommand(command)
+ os.startfile(command)
 Mixin.setMixin('mainframe', 'OnShellItems', OnShellItems)
 

Directory: /newedit/src/modules/
====================​============

File [changed]: Entry.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/modules/​Entry.py?r1=1.8&​r2=1.9
Delta lines: +2 -2
-------------------
--- Entry.py 14 Oct 2004 03:27:14 -0000 1.8
+++ Entry.py 23 Dec 2004 15:41:58 -0000 1.9
@@ -19,7 +19,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: Entry.py,v 1.8 2004/10/14 03:27:14 limodou Exp $
+# $Id: Entry.py,v 1.9 2004/12/23 15:41:58 limodou Exp $
 
 import wx
 
@@ -89,6 +89,6 @@
         dlg = wx.FileDialog(self, tr("Select A File"), "", "", tr("All file (*.*)|*.*"), wx.OPEN|wx.HIDE_READONLY)
         if dlg.ShowModal() == wx.ID_OK:
             filename = dlg.GetPath()
- self.text.SetValue(filename)
+ self.text.SetValue('"%s"' % filename)
 
 

Directory: /newedit/src/tools/
==============================

File [changed]: files.txt
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/tools/fi​les.txt?r1=1.24&​r2=1.25
Delta lines: +1 -0
-------------------
--- files.txt 30 Sep 2004 14:30:11 -0000 1.24
+++ files.txt 23 Dec 2004 15:41:58 -0000 1.25
@@ -88,6 +88,7 @@
 ../mixins/mRegister.py
 ../mixins/mConvert.py
 ../mixins/mAutoComplete.py
+../mixins/InterpreterDialog.py
 ../modules/Accelerator.py
 ../modules/Calltip.py
 ../modules/CheckVersion.py

File [changed]: newedit_cn.po
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/tools/ne​wedit_cn.po?r1=1.42​&r2=1.43
Delta lines: +49 -19
---------------------
--- newedit_cn.po 6 Nov 2004 06:02:53 -0000 1.42
+++ newedit_cn.po 23 Dec 2004 15:41:58 -0000 1.43
@@ -28,23 +28,23 @@
 msgid "CDATA"
 msgstr ""
 
-msgid "Can't open the path [%s]!"
-msgstr "不能打开路径 [%s]!"
+msgid "Deleting Interpreter"
+msgstr "删除解释器"
+
+msgid "Enter the interpreter path"
+msgstr "输入解释器路径"
 
 msgid "Html|*.htm;*.html;*​.shtml;*.xml;*.xslt"​
 msgstr ""
 
-msgid "Max number of recent paths:"
-msgstr "最大最近打开路径:"
+msgid "Interpreter Path"
+msgstr "解释器路径"
 
-msgid "Open Recent File"
-msgstr "打开最近文件"
+msgid "Interpreter Setting"
+msgstr "解释器设置"
 
-msgid "Open Recent Path"
-msgstr "打开最近路径"
-
-msgid "Open path"
-msgstr "打开路径"
+msgid "Modify Interpreter Path"
+msgstr "修改解释器路径"
 
 msgid "Python"
 msgstr ""
@@ -52,11 +52,23 @@
 msgid "Python|*.py;*.pyw"
 msgstr ""
 
+msgid "ReDirect input and output"
+msgstr "重定向输入和输出"
+
+msgid "Saving Interpreter Setting"
+msgstr "保存解释器设置"
+
+msgid "Select Python Interpreter:"
+msgstr "选择Python解释器:"
+
 msgid "UUID"
 msgstr ""
 
-msgid "open path"
-msgstr "打开路径"
+msgid "You cann't delete the default interpreter!"
+msgstr "你不能删除缺ç​œçš„解释器!"
+
+msgid "default"
+msgstr ""
 
 msgid ""
 "%s is currently Mixed.\n"
@@ -314,6 +326,9 @@
 msgid "Can't open the file [%s]!"
 msgstr "不能打开文件 [%s]!"
 
+msgid "Can't open the path [%s]!"
+msgstr "不能打开路径 [%s]!"
+
 msgid "Cann't open the project"
 msgstr "不能打开项目"
 
@@ -382,9 +397,6 @@
 msgid "You can select only one item"
 msgstr "你只能选中一个条目"
 
-msgid "You should install docutils module first!"
-msgstr "你应该首先安è​£…docutils模块!"​
-
 msgid "You should install textile module first!"
 msgstr "你应该首先安è​£…textile模块!"
 
@@ -746,9 +758,6 @@
 msgid "Name"
 msgstr "名称"
 
-msgid "Command Line Arguments"
-msgstr "命令行参数"
-
 msgid ""
 "Because you changed the language, \n"
 "it will be enabled at next startup."
@@ -1049,6 +1058,12 @@
 msgid "Opens new blog window."
 msgstr "打开新Blog窗口。"
 
+msgid "Open Recent File"
+msgstr "打开最近文件"
+
+msgid "Open Recent Path"
+msgstr "打开最近路径"
+
 msgid "Open Message Window"
 msgstr "打开消息窗口"
 
@@ -1058,6 +1073,12 @@
 msgid "Open Script"
 msgstr "打开脚本"
 
+msgid "Open path"
+msgstr "打开路径"
+
+msgid "open path"
+msgstr "打开路径"
+
 msgid "Open Project"
 msgstr "打开项目"
 
@@ -1277,6 +1298,9 @@
 msgid "Max number of saved items:"
 msgstr "最大保存项的数目:"
 
+msgid "Max number of recent paths:"
+msgstr "最大最近打开路径:"
+
 msgid "Max number of recent files:"
 msgstr "最近文件的最å​¤§ä¸ªæ•°ï¼š"
 
@@ -1720,6 +1744,12 @@
 
 msgid "Set python program command line arugments"
 msgstr "设置Python程序ç​š„命令行参数"
+
+msgid "Setup python interpreter"
+msgstr "设置Python解释器"
+
+msgid "Set Python Arguments"
+msgstr "设置Python运行参数"
 
 msgid "set arguments"
 msgstr "设置参数"




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@newe​dit.tigris.org
For additional commands, e-mail: cvs-help at newedit dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /newedit/src/, /newedit/src/lang/, /newedit/src/mixins/, /newedit/src/modules/, /newedit/src/tools/ limodou limodou 2004-12-23 07:41:58 PST
Messages per page: