commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/designer/src DataSourceEditor.py


From: Jason Cater
Subject: gnue/designer/src DataSourceEditor.py
Date: Thu, 17 Jan 2002 19:11:53 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/01/17 19:11:53

Modified files:
        designer/src   : DataSourceEditor.py 

Log message:
        cleaned up datasource display of numeric types

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/DataSourceEditor.py.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: gnue/designer/src/DataSourceEditor.py
diff -c gnue/designer/src/DataSourceEditor.py:1.13 
gnue/designer/src/DataSourceEditor.py:1.14
*** gnue/designer/src/DataSourceEditor.py:1.13  Thu Jan 17 18:13:55 2002
--- gnue/designer/src/DataSourceEditor.py       Thu Jan 17 19:11:53 2002
***************
*** 27,33 ****
  # NOTES:
  #
  
! import sys, os, cPickle
  from wxPython.wx import *
  from gnue.common import GDebug, GConfig, GDataSource
  import RuntimeSettings
--- 27,33 ----
  # NOTES:
  #
  
! import sys, os, cPickle, traceback, StringIO
  from wxPython.wx import *
  from gnue.common import GDebug, GConfig, GDataSource
  import RuntimeSettings
***************
*** 570,585 ****
             hasattr(field, 'nativetype') and field.nativetype or '(unknown)')
          self.list.SetStringItem(index, SCH_REQ,
             field.required and "Yes" or "No")
!         self.list.SetStringItem(index, SCH_SIZE,
!            hasattr(field, 'length') and ("%s"%field.length) or '-')
          self.list.SetItemData(index, index)
          self.schemaMap.append(field)
          index += 1
  
     except:
-      # TODO: actually filter connection errors
-      pass
  
  
    def onSetCurrentObject(self, object, controller):
      if isinstance(object, GDataSource.GDataSource):
--- 570,595 ----
             hasattr(field, 'nativetype') and field.nativetype or '(unknown)')
          self.list.SetStringItem(index, SCH_REQ,
             field.required and "Yes" or "No")
!         if hasattr(field,'length'):
!           if hasattr(field,'precision') and field.precision > 0:
!             self.list.SetStringItem(index, SCH_SIZE, "%s;%s" % (
!                   field.length, field.precision))
!           else:
!             self.list.SetStringItem(index, SCH_SIZE, "%s" % field.length)
!         else:
!           self.list.SetStringItem(index, SCH_SIZE,'-')
          self.list.SetItemData(index, index)
          self.schemaMap.append(field)
          index += 1
  
     except:
  
+      buffer = StringIO.StringIO()
+      traceback.print_exc(file=buffer)
+ 
+      GDebug.printMesg(5,"Exception when retrieving schema (last 5 lines):")
+      GDebug.printMesg(5,"%s"%buffer.getvalue())
+      buffer.close()
  
    def onSetCurrentObject(self, object, controller):
      if isinstance(object, GDataSource.GDataSource):



reply via email to

[Prev in Thread] Current Thread [Next in Thread]