[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pyamf-commits
Subject:    [pyamf-commits] r1637 - in pyamf/branches/gae-key-307/pyamf: .
From:       commits () pyamf ! org (SVN commit logs for PyAMF)
Date:       2008-08-31 18:57:11
Message-ID: 20080831185711.315F2884114 () mail ! collab ! eu
[Download RAW message or body]

Author: nick
Date: 2008-08-31 20:57:11 +0200 (Sun, 31 Aug 2008)
New Revision: 1637

Modified:
   pyamf/branches/gae-key-307/pyamf/__init__.py
   pyamf/branches/gae-key-307/pyamf/adapters/_google_appengine_ext_db.py
Log:
Improve code readability (slightly)

Modified: pyamf/branches/gae-key-307/pyamf/__init__.py
===================================================================
--- pyamf/branches/gae-key-307/pyamf/__init__.py	2008-08-31 18:53:23 UTC (rev 1636)
+++ pyamf/branches/gae-key-307/pyamf/__init__.py	2008-08-31 18:57:11 UTC (rev 1637)
@@ -251,17 +251,18 @@
             # check to see if a tag in the list is about to be clobbered if so,
             # raise a warning
             for y in tags:
-                if y in self:
-                    if x != y:
-                        import warnings
+                if y not in self:
+                    continue
 
-                        warnings.warn(
-                            "Previously defined tag %s superceded by %s" % (
-                                y, x))
+                if x != y:
+                    import warnings
 
-                    list.pop(self, self.index(y))
-                    break
+                    warnings.warn(
+                        "Previously defined tag %s superceded by %s" % (y, x))
 
+                list.pop(self, self.index(y))
+                break
+
         list.append(self, x)
 
     def __contains__(self, other):

Modified: pyamf/branches/gae-key-307/pyamf/adapters/_google_appengine_ext_db.py
===================================================================
--- pyamf/branches/gae-key-307/pyamf/adapters/_google_appengine_ext_db.py	2008-08-31 \
                18:53:23 UTC (rev 1636)
+++ pyamf/branches/gae-key-307/pyamf/adapters/_google_appengine_ext_db.py	2008-08-31 \
18:57:11 UTC (rev 1637) @@ -66,8 +66,11 @@
         obj._key = str(obj.key())
     except:
         obj._key = None
+
     self.writeObject(obj, *args, **kwargs)
+
     del obj._key
+
     if remove:
         self.context.class_aliases[obj.__class__] = None
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic