# HG changeset patch # User Sylvain Thénault <sylvain.thenault@logilab.fr> # Date 1265357747 -3600 # Fri Feb 05 09:15:47 2010 +0100 # Node ID c39da0ebf38afab941758fe7fc9ddfab7a9ae2c3 # Parent b19683747d74486d06f4950fb3c418568b0e5acf drop mx datetime usage diff --git a/__init__.py b/__init__.py --- a/__init__.py +++ b/__init__.py @@ -1,7 +1,7 @@ """RQL library (implementation independant). :copyright: - 2001-2009 `LOGILAB S.A. <http://www.logilab.fr>`_ (Paris, FRANCE), + 2001-2010 `LOGILAB S.A. <http://www.logilab.fr>`_ (Paris, FRANCE), all rights reserved. :contact: diff --git a/nodes.py b/nodes.py --- a/nodes.py +++ b/nodes.py @@ -3,7 +3,7 @@ This module defines all the nodes we can find in a RQL Syntax tree, except root nodes, defined in the `stmts` module. -:copyright: 2003-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +:copyright: 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr :license: General Public License version 2 - http://www.gnu.org/licenses """ @@ -23,12 +23,6 @@ 'String', 'Substitute', 'etype')) -# keep using mx DateTime by default for bw compat -def use_py_datetime(): - global KEYWORD_MAP - KEYWORD_MAP = {'NOW' : datetime.now, - 'TODAY': date.today} - ETYPE_PYOBJ_MAP = { bool: 'Boolean', int: 'Int', long: 'Int', @@ -42,21 +36,14 @@ timedelta: 'Interval', } - -try: - from mx.DateTime import DateTimeType, DateTimeDeltaType, today, now - KEYWORD_MAP = {'NOW' : now, - 'TODAY': today} - ETYPE_PYOBJ_MAP[DateTimeType] = 'Datetime' - ETYPE_PYOBJ_MAP[DateTimeDeltaType] = 'Datetime' -except: - use_py_datetime() +KEYWORD_MAP = {'NOW' : datetime.now, + 'TODAY': date.today} def etype_from_pyobj(value): """guess yams type from python value""" # note: - # * Password is not selectable so no problem) - # * use type(value) and not value.__class__ since mx instances have no + # * Password is not selectable so no problem + # * use type(value) and not value.__class__ since C instances may have no # __class__ attribute return ETYPE_PYOBJ_MAP[type(value)]