dabo Commit
Revision 4169
Date: 2008-06-20 09:41:06 -0700 (Fri, 20 Jun 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4169
Changed:
U trunk/dabo/__init__.py
U trunk/dabo/dConstants.py
U trunk/dabo/settings.py
Log:
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.
Diff:
Modified: trunk/dabo/__init__.py
===================================================================
--- trunk/dabo/__init__.py 2008-06-20 15:23:01 UTC (rev 4168)
+++ trunk/dabo/__init__.py 2008-06-20 16:41:06 UTC (rev 4169)
@@ -129,12 +129,20 @@
dLocalize.install("dabo")
+# Import global settings (do this first, as other imports may rely on it):
+from settings import *
+
# Instantiate the logger object, which will send messages to user-overridable
# locations. Do this before any other imports.
from dabo.lib.logger import Log
infoLog = Log()
infoLog.Caption = "Dabo Info Log"
-infoLog.LogObject = sys.stdout
+if verboseLogging:
+ infoLog.LogObject = sys.stdout
+else:
+ class NullWrite(object):
+ def write(self, txt): pass
+ infoLog.LogObject = NullWrite()
errorLog = Log()
errorLog.Caption = "Dabo Error Log"
errorLog.LogObject = sys.stderr
@@ -148,9 +156,6 @@
dbActivityLog.Caption = "Database Activity Log"
dbActivityLog.LogObject = None
-# Import global settings (do this first, as other imports may rely on it):
-from settings import *
-
from __version__ import version
import dColors
import dEvents
Modified: trunk/dabo/dConstants.py
===================================================================
--- trunk/dabo/dConstants.py 2008-06-20 15:23:01 UTC (rev 4168)
+++ trunk/dabo/dConstants.py 2008-06-20 16:41:06 UTC (rev 4169)
@@ -28,6 +28,8 @@
DLG_OK = 0
DLG_CANCEL = -1
+DLG_YES = 2
+DLG_NO = -2
# Flag to indicate that field validation was skipped
BIZ_DEFAULT_FIELD_VALID = "Dabo default field validation".split(" ")
Modified: trunk/dabo/settings.py
===================================================================
--- trunk/dabo/settings.py 2008-06-20 15:23:01 UTC (rev 4168)
+++ trunk/dabo/settings.py 2008-06-20 16:41:06 UTC (rev 4169)
@@ -23,6 +23,9 @@
### Settings - begin
+# Do we write info-level messages to stdout?
+verboseLogging = False
+
# Event logging is turned off globally by default for performance reasons.
# Set to True (and also set LogEvents on the object(s)) to get logging.
eventLogging = False
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]