Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /newedit/src/, /newedit/src/mixins/

newedit
Discussion topic

Back to topic list

CVS update: /newedit/src/, /newedit/src/mixins/

Reply

Author limodou
Full name limodou
Date 2005-03-12 04:11:55 PST
Message User: limodou
Date: 05/03/12 04:11:55

Modified:
 /newedit/src/
  NewEdit.py
 /newedit/src/mixins/
  Import.py, mIcon.py, mLanguage.py

Log:
 dde open

File Changes:

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

File [changed]: NewEdit.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/NewEdit.​py?r1=1.36&r2=1.​37
Delta lines: +20 -12
---------------------
--- NewEdit.py 7 Feb 2005 13:11:01 -0000 1.36
+++ NewEdit.py 12 Mar 2005 12:11:55 -0000 1.37
@@ -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: NewEdit.py,v 1.36 2005/02/07 13:11:01 limodou Exp $
+# $Id: NewEdit.py,v 1.37 2005/03/12 12:11:55 limodou Exp $
 
 __appname__ = 'NewEdit'
 __author__ = 'limodou'
@@ -32,6 +32,14 @@
 import os.path
 import codecs
 
+#add modules path to sys.path
+workpath = os.path.dirname(os.p​ath.abspath(sys.argv​[0]))
+sys.path.insert(0, workpath)
+sys.path.insert(0, os.path.join(workpath, 'modules'))
+sys.path.insert(0, os.path.join(workpath, 'plugins'))
+curpath = os.getcwd()
+os.chdir(workpath)
+
 from modules import common
 
 def Usage():
@@ -85,10 +93,9 @@
         multiuser = True
 files = args
 
-files = [common.decode_strin​g(os.path.abspath(f)​) for f in files]
+files = [common.decode_strin​g(os.path.join(curpa​th, f)) for f in files]
 
-#change wordpath
-workpath = os.path.dirname(os.p​ath.abspath(sys.argv​[0]))
+#change workpath
 userpath = workpath
 if multiuser:
     userpath = common.getHomeDir()
@@ -104,6 +111,9 @@
 from modules import i18n
 from modules import IniFile
 
+Debug.debug = Debug.Debug(os.path.​join(userpath, 'debug.txt'))
+Debug.error = Debug.Debug(os.path.​join(userpath, 'error.txt'))
+
 #install i18n package
 i18n = i18n.I18n('newedit', './lang', unicode=True, keyfunc='tr')
 ini = IniFile.IniFile()
@@ -136,10 +146,11 @@
         return self.execplugin('init', self, files)
 
 def CheckPluginDir():
- if not os.path.exists('plugins'):
- os.mkdir('plugins')
- if not os.path.exists('plug​ins/__init__.py'):
- file('plugins/__init__.py', 'w').write("""# Programmer: limodou
+ pluginpath = os.path.join(workpath, 'plugins')
+ if not os.path.exists(pluginpath):
+ os.mkdir(pluginpath)
+ if not os.path.exists(os.pa​th.join(pluginpath, '__init__.py')):
+ file(os.path.join(plulginpath, '__init__.py'), 'w').write("""# Programmer: limodou
 # E-mail: chatme at 263 dot net
 #
 # Copyleft 2004 limodou
@@ -184,6 +195,3 @@
 app = NewEditApp(0)
 
 app.MainLoop()
-
-
-

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

File [changed]: Import.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/I​mport.py?r1=1.73​&r2=1.74
Delta lines: +7 -4
-------------------
--- Import.py 23 Feb 2005 05:23:57 -0000 1.73
+++ Import.py 12 Mar 2005 12:11:55 -0000 1.74
@@ -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.73 2005/02/23 05:23:57 limodou Exp $
+# $Id: Import.py,v 1.74 2005/03/12 12:11:55 limodou Exp $
 
 
 #----------------------- mPreference.py ------------------
@@ -708,11 +708,14 @@
 #----------------------- mIcon.py ------------------
 
 import wx
+import os
 from modules import Mixin
+from modules import common
 
+iconfile = common.unicode_abspa​th(os.path.abspath('​newedit.ico'))
 def init(win):
     icon = wx.EmptyIcon()
- icon.LoadFile('newedit.ico', wx.BITMAP_TYPE_ICO)
+ icon.LoadFile(iconfile, wx.BITMAP_TYPE_ICO)
     win.SetIcon(icon)
 Mixin.setPlugin('mainframe', 'init', init)
 
@@ -3260,7 +3263,8 @@
 from modules import IniFile
 from modules import common
 
-if os.path.exists('./la​ng/language.ini'):
+langinifile = common.unicode_abspa​th('lang/language.in​i')
+if os.path.exists(langinifile):
     menulist = [
         ('IDM_OPTION',
         [
@@ -3276,7 +3280,7 @@
     def beforeinit(win):
         win.language_ids = [win.IDM_OPTION_LANG​UAGE_ENGLISH]
         win.language_country = ['']
- create_language_menu(win, common.unicode_abspa​th('lang/language.in​i'))
+ create_language_menu(win, langinifile)
     Mixin.setPlugin('mainframe', 'beforeinit', beforeinit)
 
 def create_language_menu(win, filename):
@@ -3572,7 +3576,6 @@
             i_main = i_main[:-1]
         command = i_main + i_ext + ' -u "%s" %s' % (win.document.filename, args)
         guiflag = False
- print command
     #chanage current path to filename's dirname
     path = os.path.dirname(win.​document.filename)
     os.chdir(common.enco​de_string(path))

File [changed]: mIcon.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/m​Icon.py?r1=1.2&r​2=1.3
Delta lines: +5 -2
-------------------
--- mIcon.py 14 Oct 2004 03:27:12 -0000 1.2
+++ mIcon.py 12 Mar 2005 12:11:55 -0000 1.3
@@ -19,14 +19,17 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 #
-# $Id: mIcon.py,v 1.2 2004/10/14 03:27:12 limodou Exp $
+# $Id: mIcon.py,v 1.3 2005/03/12 12:11:55 limodou Exp $
 
 import wx
+import os
 from modules import Mixin
+from modules import common
 
+iconfile = common.unicode_abspa​th(os.path.abspath('​newedit.ico'))
 def init(win):
     icon = wx.EmptyIcon()
- icon.LoadFile('newedit.ico', wx.BITMAP_TYPE_ICO)
+ icon.LoadFile(iconfile, wx.BITMAP_TYPE_ICO)
     win.SetIcon(icon)
 Mixin.setPlugin('mainframe', 'init', init)
 

File [changed]: mLanguage.py
Url: http://newedit.tigri​s.org/source/browse/​newedit/src/mixins/m​Language.py?r1=1.3​&r2=1.4
Delta lines: +4 -3
-------------------
--- mLanguage.py 14 Oct 2004 03:27:12 -0000 1.3
+++ mLanguage.py 12 Mar 2005 12:11:55 -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: mLanguage.py,v 1.3 2004/10/14 03:27:12 limodou Exp $
+# $Id: mLanguage.py,v 1.4 2005/03/12 12:11:55 limodou Exp $
 
 from modules import Mixin
 import wx
@@ -28,7 +28,8 @@
 from modules import IniFile
 from modules import common
 
-if os.path.exists('./la​ng/language.ini'):
+langinifile = common.unicode_abspa​th('lang/language.in​i')
+if os.path.exists(langinifile):
     menulist = [
         ('IDM_OPTION',
         [
@@ -44,7 +45,7 @@
     def beforeinit(win):
         win.language_ids = [win.IDM_OPTION_LANG​UAGE_ENGLISH]
         win.language_country = ['']
- create_language_menu(win, common.unicode_abspa​th('lang/language.in​i'))
+ create_language_menu(win, langinifile)
     Mixin.setPlugin('mainframe', 'beforeinit', beforeinit)
 
 def create_language_menu(win, filename):




--------------------​--------------------​--------------------​---------
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/mixins/ limodou limodou 2005-03-12 04:11:55 PST
Messages per page: