Changeset 4169

Show
Ignore:
Timestamp:
06/20/08 09:41:06 (2 months ago)
Author:
ed
Message:

Changed the default for output to not print all the infoLog messages to stdout. Instead, infoLog messages are ignored unless the dabo.verboseLogging setting is set to False. The errorLog still prints to stderr, of course.

Added a couple of constants that are returned by dStandardButtonDialog.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/__init__.py

    r4092 r4169  
    130130 
    131131 
     132# Import global settings (do this first, as other imports may rely on it): 
     133from settings import * 
     134 
    132135# Instantiate the logger object, which will send messages to user-overridable 
    133136# locations. Do this before any other imports. 
     
    135138infoLog = Log() 
    136139infoLog.Caption = "Dabo Info Log" 
    137 infoLog.LogObject = sys.stdout 
     140if verboseLogging: 
     141    infoLog.LogObject = sys.stdout 
     142else: 
     143    class NullWrite(object): 
     144        def write(self, txt): pass 
     145    infoLog.LogObject = NullWrite() 
    138146errorLog = Log() 
    139147errorLog.Caption = "Dabo Error Log" 
     
    148156dbActivityLog.Caption = "Database Activity Log" 
    149157dbActivityLog.LogObject = None 
    150  
    151 # Import global settings (do this first, as other imports may rely on it): 
    152 from settings import * 
    153158 
    154159from __version__ import version 
  • trunk/dabo/dConstants.py

    r3054 r4169  
    2929DLG_OK = 0 
    3030DLG_CANCEL = -1 
     31DLG_YES = 2 
     32DLG_NO = -2 
    3133 
    3234# Flag to indicate that field validation was skipped 
  • trunk/dabo/settings.py

    r4022 r4169  
    2323 
    2424### Settings - begin 
     25 
     26# Do we write info-level messages to stdout? 
     27verboseLogging = False 
    2528 
    2629# Event logging is turned off globally by default for performance reasons.