3.7 depends on python >= 2.5
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 08 Mar 2010 18:31:36 +0100
changeset 4833 41a78fb4107c
parent 4832 98c7760b7e9a
child 4834 b718626a0e60
3.7 depends on python >= 2.5
__pkginfo__.py
debian/control
selectors.py
utils.py
--- a/__pkginfo__.py	Mon Mar 08 18:08:24 2010 +0100
+++ b/__pkginfo__.py	Mon Mar 08 18:31:36 2010 +0100
@@ -30,7 +30,7 @@
 
 web = 'http://www.cubicweb.org'
 ftp = 'ftp://ftp.logilab.org/pub/cubicweb'
-pyversions = ['2.4', '2.5']
+pyversions = ['2.5', '2.6']
 
 classifiers = [
            'Environment :: Web Environment',
--- a/debian/control	Mon Mar 08 18:08:24 2010 +0100
+++ b/debian/control	Mon Mar 08 18:31:36 2010 +0100
@@ -7,10 +7,10 @@
            Adrien Di Mascio <Adrien.DiMascio@logilab.fr>,
            Aurélien Campéas <aurelien.campeas@logilab.fr>,
            Nicolas Chauvat <nicolas.chauvat@logilab.fr>
-Build-Depends: debhelper (>= 5), python-dev (>=2.4), python-central (>= 0.5)
+Build-Depends: debhelper (>= 5), python-dev (>=2.5), python-central (>= 0.5)
 Standards-Version: 3.8.0
 Homepage: http://www.cubicweb.org
-XS-Python-Version: >= 2.4, << 2.6
+XS-Python-Version: >= 2.5, << 2.6
 
 Package: cubicweb
 Architecture: all
--- a/selectors.py	Mon Mar 08 18:08:24 2010 +0100
+++ b/selectors.py	Mon Mar 08 18:31:36 2010 +0100
@@ -23,17 +23,15 @@
 You can log the selectors involved for *calendar* by replacing the line
 above by::
 
-    # in Python2.5
     from cubicweb.selectors import traced_selection
     with traced_selection():
         self.view('calendar', myrset)
 
-    # in Python2.4
-    from cubicweb import selectors
-    selectors.TRACED_OIDS = ('calendar',)
-    self.view('calendar', myrset)
-    selectors.TRACED_OIDS = ()
+With python 2.5, think to add:
 
+    from __future__ import with_statement
+
+at the top of your module.
 
 :organization: Logilab
 :copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
--- a/utils.py	Mon Mar 08 18:08:24 2010 +0100
+++ b/utils.py	Mon Mar 08 18:31:36 2010 +0100
@@ -11,6 +11,7 @@
 import decimal
 import datetime
 import random
+from uuid import uuid4
 
 from logilab.mtconverter import xml_escape
 from logilab.common.deprecation import deprecated
@@ -18,28 +19,10 @@
 # initialize random seed from current time
 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
-        XXX not that unique on win32
-        """
-        key = str(key)
-        msg = key + "%.10f" % time() + str(randint(0, 1000000))
-        return key + 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)
-        return str(key) + str(uuid4()).replace('-', '')
+def make_uid(key):
+    # remove dash, generated uid are used as identifier sometimes (sql table
+    # names at least)
+    return str(key) + str(uuid4()).replace('-', '')
 
 
 def dump_class(cls, clsname):