[Zope3-checkins] SVN: Zope3/branches/3.3/ Fixed issue 676, utilities defined in Zope 3.2 weren't

Jim Fulton jim at zope.com
Mon Jul 31 13:22:49 EDT 2006


Log message for revision 69319:
  Fixed issue 676, utilities defined in Zope 3.2 weren't
  converted properly.
  

Changed:
  U   Zope3/branches/3.3/doc/CHANGES.txt
  U   Zope3/branches/3.3/src/zope/app/component/back35.py
  U   Zope3/branches/3.3/src/zope/app/component/tests/test_registration.py

-=-
Modified: Zope3/branches/3.3/doc/CHANGES.txt
===================================================================
--- Zope3/branches/3.3/doc/CHANGES.txt	2006-07-31 16:56:49 UTC (rev 69318)
+++ Zope3/branches/3.3/doc/CHANGES.txt	2006-07-31 17:22:48 UTC (rev 69319)
@@ -10,6 +10,9 @@
 
     Bugfixes
 
+      - Fixed issue 676, utilities defined in Zope 3.2 weren't
+        converted properly.
+
       - Fixed issue 675, Pluggable Authentication utilities with group
         folders weren't updated correctly to replect the new database
         format.

Modified: Zope3/branches/3.3/src/zope/app/component/back35.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/component/back35.py	2006-07-31 16:56:49 UTC (rev 69318)
+++ Zope3/branches/3.3/src/zope/app/component/back35.py	2006-07-31 17:22:48 UTC (rev 69319)
@@ -902,6 +902,14 @@
             for r in state['_registrations']:
                 if isinstance(r, UtilityRegistration):
                     self.register((), r.provided, r.name, r.component)
+                    
+                    if not [
+                        1 for rseen in registrations
+                        if rseen.provided == r.provided
+                           and rseen.component == r.component
+                        ]:
+                        self.subscribe((), r.provided, r.component)
+
                     registrations.append(r)
                 else:
                     warnings.warn(

Modified: Zope3/branches/3.3/src/zope/app/component/tests/test_registration.py
===================================================================
--- Zope3/branches/3.3/src/zope/app/component/tests/test_registration.py	2006-07-31 16:56:49 UTC (rev 69318)
+++ Zope3/branches/3.3/src/zope/app/component/tests/test_registration.py	2006-07-31 17:22:48 UTC (rev 69319)
@@ -257,7 +257,7 @@
     True
 
 The _evolve_to_generation_4 method actually converts the remaining
-data structures. It also evolves all of it's subinterfaces:
+data structures. It also evolves all of it's subsites:
 
     >>> sm1._evolve_to_generation_4()
     >>> tm2.commit()
@@ -330,7 +330,21 @@
     >>> sm3.getUtility(IFoo, '5') is sm3['default']['5']
     True
 
+getAllUtilitiesRegisteredFor should work too: :)
 
+    >>> all = list(sm3.getAllUtilitiesRegisteredFor(IFoo))
+    >>> all.remove(sm1['default']['1'])
+    >>> all.remove(sm1['default']['2'])
+    >>> all.remove(sm1['default']['3'])
+    >>> all.remove(sm2['default']['2'])
+    >>> all.remove(sm2['default']['3'])
+    >>> all.remove(sm2['default']['4'])
+    >>> all.remove(sm3['default']['3'])
+    >>> all.remove(sm3['default']['4'])
+    >>> all.remove(sm3['default']['5'])
+    >>> len(all)
+    2
+
 Cleanup:
 
     >>> db.close()



More information about the Zope3-Checkins mailing list