# HG changeset patch # User Sylvain Thénault # Date 1268069496 -3600 # Node ID 41a78fb4107cd8f3a30d186e679f613763fca780 # Parent 98c7760b7e9ac625e258a5da4f99d2815ec874ad 3.7 depends on python >= 2.5 diff -r 98c7760b7e9a -r 41a78fb4107c __pkginfo__.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', diff -r 98c7760b7e9a -r 41a78fb4107c debian/control --- 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 , Aurélien Campéas , Nicolas Chauvat -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 diff -r 98c7760b7e9a -r 41a78fb4107c selectors.py --- 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. diff -r 98c7760b7e9a -r 41a78fb4107c utils.py --- 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):