import cleanup stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 23 Feb 2010 09:53:01 +0100
branchstable
changeset 4653 ca11228a5268
parent 4652 7c41eea7fc30
child 4655 573a6451b424
import cleanup
utils.py
--- a/utils.py	Tue Feb 23 09:52:38 2010 +0100
+++ b/utils.py	Tue Feb 23 09:53:01 2010 +0100
@@ -7,27 +7,33 @@
 """
 __docformat__ = "restructuredtext en"
 
-from logilab.mtconverter import xml_escape
-
-import locale
 import sys
 import decimal
 import datetime
-from md5 import md5
-from time import time
-from random import randint, seed
+import random
+
+from logilab.mtconverter import xml_escape
+from logilab.common.deprecation import deprecated
 
 # initialize random seed from current time
-seed()
+random.seed()
 
 if sys.version_info[:2] < (2, 5):
+
+    from time import time
+    from md5 import md5
+    from random import randint
+
     def make_uid(key):
         """forge a unique identifier
         not that unique on win32"""
         msg = str(key) + "%.10f" % time() + str(randint(0, 1000000))
         return md5(msg).hexdigest()
+
 else:
+
     from uuid import uuid4
+
     def make_uid(key):
         # remove dash, generated uid are used as identifier sometimes (sql table
         # names at least)