[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/ Replaced deprecated 'whrandom' with 'random' in zope.security.examples

Tres Seaver tseaver at palladion.com
Tue Nov 22 11:13:00 EST 2005


Log message for revision 40322:
  Replaced deprecated 'whrandom' with 'random' in zope.security.examples 
  
  o See http://www.zope.org/Collectors/Zope/1892.
  
  Also updated changelog with release dates.
  
  

Changed:
  U   Zope3/branches/ZopeX3-3.0/doc/CHANGES.txt
  U   Zope3/branches/ZopeX3-3.0/src/zope/security/examples/sandbox.py
  U   Zope3/branches/ZopeX3-3.0/src/zope/security/examples/sandbox_security.py

-=-
Modified: Zope3/branches/ZopeX3-3.0/doc/CHANGES.txt
===================================================================
--- Zope3/branches/ZopeX3-3.0/doc/CHANGES.txt	2005-11-22 16:12:02 UTC (rev 40321)
+++ Zope3/branches/ZopeX3-3.0/doc/CHANGES.txt	2005-11-22 16:12:59 UTC (rev 40322)
@@ -6,20 +6,25 @@
 
   For information on future releases, see ROADMAP.txt.
 
-  Zope X3.0.2
+  Zope X3 3.0.2 (unreleased)
 
     Bug Fixes
 
-      - ...
+      - Replace deprecated 'whrandom' with 'random' in zope.security.examples
+        (see http://www.zope.org/Collectors/Zope/1892).
 
+      - Make undo prefixes unicode-safe.
+
     Much thanks to everyone who contributed to this release:
 
-      ...
+      - Dmitry Vasiliev
 
+      - Tres Seaver
+
       Note: If you are not listed and contributed, please add yourself. This
       note will be deleted before the release.
 
-  Zope X3.0.1
+  Zope X3 3.0.1 (2005/07/27)
 
     Bug Fixes
 
@@ -84,7 +89,7 @@
 
   ------------------------------------------------------------------
 
-  Zope X3.0.0
+  Zope X3 3.0.0 (2004/11/07)
 
     New features
 

Modified: Zope3/branches/ZopeX3-3.0/src/zope/security/examples/sandbox.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/security/examples/sandbox.py	2005-11-22 16:12:02 UTC (rev 40321)
+++ Zope3/branches/ZopeX3-3.0/src/zope/security/examples/sandbox.py	2005-11-22 16:12:59 UTC (rev 40322)
@@ -15,7 +15,7 @@
 
 $Id$
 """
-import time, whrandom
+import time, random
 
 from zope.interface import Interface, implements
 
@@ -263,7 +263,7 @@
 
 def WanderLust(agent):
     """ is agent ready to move """
-    if int(whrandom.random()*100) <= 30:
+    if int(random.random()*100) <= 30:
         return 1
 
 def GreenerPastures(agent):
@@ -271,7 +271,7 @@
     global _homes
     possible_homes = _homes.keys()
     possible_homes.remove(agent.getHome().getId())
-    return _homes.get(whrandom.choice(possible_homes))
+    return _homes.get(random.choice(possible_homes))
 
 
 # boot strap initial setup.

Modified: Zope3/branches/ZopeX3-3.0/src/zope/security/examples/sandbox_security.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/security/examples/sandbox_security.py	2005-11-22 16:12:02 UTC (rev 40321)
+++ Zope3/branches/ZopeX3-3.0/src/zope/security/examples/sandbox_security.py	2005-11-22 16:12:59 UTC (rev 40322)
@@ -185,11 +185,11 @@
 
     def GreenerPastures(agent):
         """ where do they want to go today """
-        import whrandom
+        import random
         _homes = sandbox._homes
         possible_homes = _homes.keys()
         possible_homes.remove(agent.getHome().getId())
-        new_home =  _homes.get(whrandom.choice(possible_homes))
+        new_home =  _homes.get(random.choice(possible_homes))
         return checker.selectChecker(new_home).proxy(new_home)
 
     sandbox.GreenerPastures = GreenerPastures



More information about the Zope3-Checkins mailing list