[Zope-Checkins] SVN: Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/utils.py Sync changes from CVS. Moved some imports to top of file.

Stefan H. Holek stefan at epy.co.at
Wed Mar 30 04:42:47 EST 2005


Log message for revision 29727:
  Sync changes from CVS. Moved some imports to top of file.
  

Changed:
  U   Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/utils.py

-=-
Modified: Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/utils.py
===================================================================
--- Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/utils.py	2005-03-30 07:11:22 UTC (rev 29726)
+++ Zope/branches/five-integration/lib/python/Testing/ZopeTestCase/utils.py	2005-03-30 09:42:46 UTC (rev 29727)
@@ -18,8 +18,13 @@
 $Id: utils.py,v 1.21 2005/02/11 09:00:21 shh42 Exp $
 """
 
+import os
+import sys
+import time
+import random
 import transaction
 
+
 def setupCoreSessions(app=None):
     '''Sets up the session_data_manager e.a.'''
     from Acquisition import aq_base
@@ -30,7 +35,7 @@
 
     if not hasattr(app, 'temp_folder'):
         from Products.TemporaryFolder.TemporaryFolder import MountedTemporaryFolder
-        tf = MountedTemporaryFolder('temp_folder','Temporary Folder')
+        tf = MountedTemporaryFolder('temp_folder', 'Temporary Folder')
         app._setObject('temp_folder', tf)
         commit = 1
 
@@ -90,8 +95,6 @@
             transaction.commit()
 
 
-import os, time
-
 def importObjectFromFile(container, filename, quiet=0):
     '''Imports an object from a (.zexp) file into the given container.'''
     from ZopeLite import _print
@@ -109,7 +112,6 @@
     '''Starts an HTTP ZServer thread.'''
     global _Z2HOST, _Z2PORT
     if _Z2HOST is None:
-        import random
         _Z2HOST = '127.0.0.1'
         _Z2PORT = random.choice(range(55000, 55500))
         from ZServer import setNumberOfThreads
@@ -122,8 +124,6 @@
     return _Z2HOST, _Z2PORT
 
 
-import sys
-
 def makerequest(app, stdout=sys.stdout):
     '''Wraps the app into a fresh REQUEST.'''
     from ZPublisher.BaseRequest import RequestContainer



More information about the Zope-Checkins mailing list