[gnue] r9870 - trunk/gnue-common/src/datasources

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: reinhard
Date: 2008-04-28 06:06:04 -0500 (Mon, 28 Apr 2008)
New Revision: 9870

Modified:
   trunk/gnue-common/src/datasources/readgsd.py
Log:
Fixed exception handling code.


Modified: trunk/gnue-common/src/datasources/readgsd.py
===================================================================
--- trunk/gnue-common/src/datasources/readgsd.py	2008-03-31 20:30:10 UTC (rev 9869)
+++ trunk/gnue-common/src/datasources/readgsd.py	2008-04-28 11:06:04 UTC (rev 9870)
@@ -195,6 +195,12 @@
         import their schema/data according to the command line options.
         """
 
+        self.myfunc('foo', 'bar', 1, 2, 99, three=3, four=4)
+        self.myfunc('foo', 'bar', one=1, two=2)
+        self.myfunc('foo', 'bar', two=2, one=1)
+        self.myfunc('foo', 'bar', four=4, two=2, three=3, one=1)
+        self.otherfunc()
+
         self.__check_options()
         self.__load_input_files()
 
@@ -206,7 +212,24 @@
         if proceed and self.__do_data:
             self.__import_data()
 
+    def __repr__(self):
+        return "the object"
 
+    from gnue.common.base.log import logged_f_n, deprecated_f_n
+    #@logged_f_n('gnue.foo')
+    @deprecated_f_n('gnue.depa')
+    def myfunc(self, foo, bar, one=None, two=None, *args, **kwargs):
+        print foo, bar, one, two, args, kwargs
+
+    #@logged_f_n('gnue.bar')
+    @deprecated_f_n('gnue.depb')
+    def otherfunc(self):
+        from gnue.common.base.log import stack_n
+        stack_n('gnue.freak', 'I am here')
+
+    myfunc = logged_f_n('gnue.xxx')(myfunc)
+    otherfunc = logged_f_n('gnue.yyy')(otherfunc)
+
     # -------------------------------------------------------------------------
     # Check the command line arguments
     # -------------------------------------------------------------------------
@@ -406,7 +429,7 @@
                 # Are all fields in the row defined by the table
                 if not rowfields.issubset(fields[item.tablename.lower()]):
                     raise InvalidFieldsError, (item.tablename, n,
-                            rowfields.difference(fields[item.tablename]))
+                        rowfields.difference(fields[item.tablename.lower()]))
 
         # Order the tables so the do not violate constraints
         references = {}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.