Changeset 191

Show
Ignore:
Timestamp:
Mon Nov 28 11:16:34 2005
Author:
limodou
Message:

增加在config.ini中配置default.DEBUG=0的设置可以关掉调试信息的生成。同时改正了到处生成debug.txt, error.txt生成的问题

Files:

Legend:

Unmodified
Added
Removed
Modified
  • newedit/trunk/NewEdit.py

    r162 r191  
    32 32 import os.path  
    33 33 from modules import common  
    34   from modules import Mixin  
    35 34 from modules import Debug  
    36 35 from modules import i18n  
     
    46 45 os.chdir(workpath)  
    47 46  
      47 ini = dict4ini.DictIni(os.path.join(workpath, 'config.ini'))  
      48 if not ini.default.get('DEBUG', True):  
      49     Debug.DEBUG = False  
      50  
      51 Debug.debug = Debug.Debug(os.path.join(workpath, 'debug.txt'))  
      52 Debug.error = Debug.Debug(os.path.join(workpath, 'error.txt'))  
      53  
    48 54 #install i18n package  
    49 55 i18n = i18n.I18n('./lang', keyfunc='tr')  
    50   ini = dict4ini.DictIni(os.path.join(workpath, 'config.ini'))  
      56 #ini = dict4ini.DictIni(os.path.join(workpath, 'config.ini'))  
    50 56 if ini.language.get('default', None) is not None:  
    51 57     i18n.install(ini.language.default)  
    52 58  
      59 from modules import Mixin  
      60  
    53 61 #import mixins  
    54 62 try:  
    117 125         Globals.userpath = self.userpath  
    118 126         Globals.app = self  
    119    
    120           Debug.debug = Debug.Debug(os.path.join(self.userpath, 'debug.txt'))  
    121           Debug.error = Debug.Debug(os.path.join(self.userpath, 'error.txt'))  
    122 127  
    123 128         #-----------------------------------------------------------------------------  
  • newedit/trunk/ChangeLog.txt

    r190 r191  
    1 1 $Rev$  
      2 [2005/11/28]  
      3 Mixin.py Debug.py NewEdit.py    ÔöŒÓÔÚconfig.iniÖÐÅäÖÃdefault.DEBUG=0µÄÉèÖÿÉÒԹصôµ÷ÊÔÐÅÏ¢µÄÉú³É¡£Í¬Ê±žÄÕýÁ˵œŽŠÉú³Édebug.txt, error.txtÉú³ÉµÄÎÊÌâ  
      4  
    2 5 [2005/11/27]  
    3 6 mShare.py ShareWindow.py  
  • newedit/trunk/modules/Mixin.py

    r154 r191  
    23 23  
    24 24 import types  
    25   from Debug import debug  
    26 25  
    27 26 __mixinset__ = {}   #used to collect all mixins and plugins  
     
    37 36  
    38 37     def initmixin(self):  
      38         from Debug import debug  
    39 39         debug.info('[Mixin] Dealing class [%s]' % self.__class__.__name__)  
    40 40         if self.__class__.__name__ == 'Mixin':  #don't dealing Mixin class itself  
    153 153  
    154 154 def printMixin():  
      155     from Debug import debug  
    155 156     debug.info("[Mixin] Printing mixin set...")  
    156 157     for name, value in __mixinset__.items():  
  • newedit/trunk/modules/Debug.py

    r164 r191  
    77 77             self.filename = filename  
    78 78  
    79   debug = Debug()  
    80   error = Debug(os.path.abspath('error.txt'))  
      79 debug = None  
      80 error = None  
    81 81  
    82 82 if __name__ == '__main__':  
      83     debug = Debug()  
      84     error = Debug(os.path.abspath('error.txt'))  
    83 85     debug.log('log')  
    84 86     debug.info('info')