dabo Commit
Revision 5959
Date: 2010-08-22 13:18:49 -0700 (Sun, 22 Aug 2010)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5959

Changed:
U   trunk/ide/ClassDesigner.py
U   trunk/ide/ClassDesignerComponents.py
U   trunk/ide/ClassDesignerEditor.py
U   trunk/ide/ClassDesignerPropSheet.py
U   trunk/ide/CxnEditor.py
U   trunk/ide/Editor.py
U   trunk/ide/wizards/AppWizard/AppWizard.py
U   trunk/ide/wizards/AppWizard/spec-main.py.txt

Log:
Converted all the old log calls to use the new style of logging.



Diff:
Modified: trunk/ide/ClassDesigner.py
===================================================================
--- trunk/ide/ClassDesigner.py  2010-08-22 20:17:38 UTC (rev 5958)
+++ trunk/ide/ClassDesigner.py  2010-08-22 20:18:49 UTC (rev 5959)
@@ -495,9 +495,9 @@
 
 
        def onEditUndo(self, evt):
-               dabo.infoLog.write(_("Not implemented yet"))
+               dabo.log.info(_("Not implemented yet"))
        def onEditRedo(self, evt):
-               dabo.infoLog.write(_("Not implemented yet"))
+               dabo.log.info(_("Not implemented yet"))
 
 
        def _importClassXML(self, pth):
@@ -1230,7 +1230,7 @@
                                cls = eval(clsname)
                        except ValueError:
                                # Should never happen, so if it does, log it!
-                               dabo.errorLog.write("Invalid wizard page class: 
%s" % nm)
+                               dabo.log.error("Invalid wizard page class: %s" 
% nm)
                                dabo.ui.stop("Invalid wizard page class: %s" % 
nm)
                                pgDct["fullname"] = nm
                                cls = dabo.ui.__dict__[nm]
@@ -2244,7 +2244,7 @@
                try:
                        del self._classPropDict[obj][prop]
                except StandardError, e:
-                       dabo.errorLog.write(_("Could not delete custom property 
'%(prop)s': %(e)s")
+                       dabo.log.error(_("Could not delete custom property 
'%(prop)s': %(e)s")
                                        % locals())
 
 
@@ -2479,7 +2479,7 @@
                                try:
                                        ret = lps[0]
                                except:
-                                       dabo.errorLog.write(_("Problem adding 
to a page: no ClassDesigner information."))
+                                       dabo.log.error(_("Problem adding to a 
page: no ClassDesigner information."))
                        else:
                                ret = obj.mainPanel
                return ret
@@ -2715,7 +2715,7 @@
                        szit = pnl.ControllingSizerItem
                        if szit is None:
                                # Something is wrong; write it to the log and 
return
-                               dabo.errorLog.write(_("Attempted to add an 
object of class %(cls)s to parent %(pnl)s, but parent has no sizer 
information.")
+                               dabo.log.error(_("Attempted to add an object of 
class %(cls)s to parent %(pnl)s, but parent has no sizer information.")
                                                % locals())
                                return
 
@@ -3311,7 +3311,7 @@
                                                                        if 
cd["attributes"]["classID"] == kidID][0]
                                                        
self.setCustomChanges(kid, kidDct)
                                                except StandardError, e:
-                                                       
dabo.errorLog.write(_("Error locating sizer: %s") % e)
+                                                       dabo.log.error(_("Error 
locating sizer: %s") % e)
                else:
                        if obj.Sizer:
                                childList = dct["children"]
@@ -3321,7 +3321,7 @@
                                                        if 
cd["attributes"]["classID"] == szID][0]
                                        self.setCustomChanges(obj.Sizer, szDct)
                                except StandardError, e:
-                                       dabo.errorLog.write(_("Error locating 
sizer: %s") % e)
+                                       dabo.log.error(_("Error locating sizer: 
%s") % e)
                        else:
                                if obj.Children:
                                        childList = dct["children"]
@@ -3334,7 +3334,7 @@
                                                                        if 
cd["attributes"]["classID"] == kidID][0]
                                                        
self.setCustomChanges(kid, kidDct)
                                                except StandardError, e:
-                                                       
dabo.errorLog.write(_("Error locating child object: %s") % e)
+                                                       dabo.log.error(_("Error 
locating child object: %s") % e)
 
 
        def onNewBox(self, evt):

Modified: trunk/ide/ClassDesignerComponents.py
===================================================================
--- trunk/ide/ClassDesignerComponents.py        2010-08-22 20:17:38 UTC (rev 
5958)
+++ trunk/ide/ClassDesignerComponents.py        2010-08-22 20:18:49 UTC (rev 
5959)
@@ -460,7 +460,7 @@
                                        try:
                                                sz = self.Sizer
                                        except AttributeError:
-                                               dabo.errorLog.write(_("No sizer 
information available for %s") % self)
+                                               dabo.log.error(_("No sizer 
information available for %s") % self)
                                                sz = None
                if sz:
                        szDict = None
@@ -1633,7 +1633,7 @@
        def switchObjects(self, obj1, obj2):
                """Swaps the location of the two objects."""
                if not obj1 or not obj2:
-                       dabo.errorLog.write(_("Cannot swap with non-existent 
object."))
+                       dabo.log.error(_("Cannot swap with non-existent 
object."))
                        return
                row1, col1 = self.getGridPos(obj1)
                row2, col2 = self.getGridPos(obj2)

Modified: trunk/ide/ClassDesignerEditor.py
===================================================================
--- trunk/ide/ClassDesignerEditor.py    2010-08-22 20:17:38 UTC (rev 5958)
+++ trunk/ide/ClassDesignerEditor.py    2010-08-22 20:18:49 UTC (rev 5959)
@@ -44,7 +44,7 @@
                obj = self.Form.getEditedObject()
                if not obj:
                        # Should never happen!
-                       dabo.ErrorLog.write(_("Bad object ref returned to 
_makeContainingClassIntoSelf()"))
+                       dabo.log.error(_("Bad object ref returned to 
_makeContainingClassIntoSelf()"))
                        return None
                try:
                        args = "dabo.ui.%s" % 
ustr(obj.BaseClass).split("'")[1].split(".")[-1]
@@ -67,7 +67,7 @@
                                exec imp in self._namespaces
                        except SyntaxError, e:
                                # Record the error so that the developer knows 
there is a problem.
-                               dabo.errorLog.write(_("Compilation error found 
in import code: %s") % e)
+                               dabo.log.error(_("Compilation error found in 
import code: %s") % e)
                        except ImportError:
                                # Ignore because it is not a code problem and 
will show up on runtime.
                                pass
@@ -543,7 +543,7 @@
                                        chc.append("%s %s" % ("-"*lev, 
obj.Name))
                                        keylist.append(obj)
                                except:
-                                       dabo.errorLog.write(_("Could not add to 
hierarchy: %s") % obj)
+                                       dabo.log.error(_("Could not add to 
hierarchy: %s") % obj)
                        self.ddObject.Choices = chc
                        self.ddObject.Keys = keylist
                        try:

Modified: trunk/ide/ClassDesignerPropSheet.py
===================================================================
--- trunk/ide/ClassDesignerPropSheet.py 2010-08-22 20:17:38 UTC (rev 5958)
+++ trunk/ide/ClassDesignerPropSheet.py 2010-08-22 20:18:49 UTC (rev 5959)
@@ -726,7 +726,7 @@
                                        # skip the below errorLog entry for 
ReportDesigner
                                        pass
                                else:
-                                       dabo.errorLog.write(_("Property Grid 
out of sync for property '%s' of object '%'") %
+                                       dabo.log.error(_("Property Grid out of 
sync for property '%s' of object '%'") %
                                                        (self.getValue(row, 0), 
self.Application.Selection[0]))
                                continue
                        if not isinstance(pd, dict):

Modified: trunk/ide/CxnEditor.py
===================================================================
--- trunk/ide/CxnEditor.py      2010-08-22 20:17:38 UTC (rev 5958)
+++ trunk/ide/CxnEditor.py      2010-08-22 20:18:49 UTC (rev 5959)
@@ -428,7 +428,7 @@
                if self.connFile:
                        # Make sure that the passed file exists!
                        if not os.path.exists(self.connFile):
-                               dabo.errorLog.write("The connection file '%s' 
does not exist." % self.connFile)
+                               dabo.log.error("The connection file '%s' does 
not exist." % self.connFile)
                                self.connFile = None
 
                if self.connFile is None:

Modified: trunk/ide/Editor.py
===================================================================
--- trunk/ide/Editor.py 2010-08-22 20:17:38 UTC (rev 5958)
+++ trunk/ide/Editor.py 2010-08-22 20:18:49 UTC (rev 5959)
@@ -258,7 +258,7 @@
                if pgs:
                        pg = pgs[0]
                else:
-                       dabo.errorLog.write(_("No matching page for %s") % cap)
+                       dabo.log.error(_("No matching page for %s") % cap)
                        return
                self.SelectedPage = pg
                pg.editor.setFocus()
@@ -553,7 +553,7 @@
        def onDocumentationHint(self, evt):
                # Eventually, a separate IDE window can optionally display help 
contents
                # for the object. For now, just print the longdoc to the 
infolog.
-               dabo.infoLog.write(_("Documentation Hint received:\n\n%s") % 
evt.EventData["longDoc"])
+               dabo.log.info(_("Documentation Hint received:\n\n%s") % 
evt.EventData["longDoc"])
 
 
        def onTitleChanged(self, evt):
@@ -800,7 +800,7 @@
                        target = self.pgfEditor.editFile(pth, True)
                except StandardError, e:
                        if justReportErrors:
-                               dabo.errorLog.write(_("Could not open file: 
%s") % e)
+                               dabo.log.error(_("Could not open file: %s") % e)
                                target = None
                        else:
                                raise

Modified: trunk/ide/wizards/AppWizard/AppWizard.py
===================================================================
--- trunk/ide/wizards/AppWizard/AppWizard.py    2010-08-22 20:17:38 UTC (rev 
5958)
+++ trunk/ide/wizards/AppWizard/AppWizard.py    2010-08-22 20:18:49 UTC (rev 
5959)
@@ -958,7 +958,7 @@
                                        "type": "%(fieldType)s"
                                        }
                else:
-                       dabo.errorLog.write("No control class found for field 
'%(fieldName)s'.")
+                       dabo.log.error("No control class found for field 
'%(fieldName)s'.")
                        lbl.release()
                        opList.release()
 """

Modified: trunk/ide/wizards/AppWizard/spec-main.py.txt
===================================================================
--- trunk/ide/wizards/AppWizard/spec-main.py.txt        2010-08-22 20:17:38 UTC 
(rev 5958)
+++ trunk/ide/wizards/AppWizard/spec-main.py.txt        2010-08-22 20:18:49 UTC 
(rev 5959)
@@ -25,12 +25,6 @@
 app.biz = biz
 app.ui = ui
 
-# If we are running frozen, let's reroute the errorLog:
-if hasattr(sys, "frozen"):
-       dabo.errorLog.Caption = ""
-       dabo.errorLog.LogObject = open(os.path.join(app.HomeDirectory,
-                       "error.log"), "a")
-
 # Make it easy to find any images or other files you put in the resources
 # directory.
 sys.path.append(os.path.join(app.HomeDirectory, "resources"))



_______________________________________________
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]

Reply via email to