Reviewers: ,
Please review this at http://codereview.tryton.org/47007/
Affected files:
M CHANGELOG
M INSTALL
M proteus/config.py
M setup.py
Index: CHANGELOG
===================================================================
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+* Drop support of Python 2.5
+
Version 2.0.0 - 2011-04-28
* Bug fixes (see mercurial logs for details)
* Manage default values of trytond configuration
Index: INSTALL
===================================================================
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@
Prerequisites
-------------
- * Python 2.5 or later (http://www.python.org/)
+ * Python 2.6 or later (http://www.python.org/)
* trytond (http://www.tryton.org/)
Installation
Index: proteus/config.py
===================================================================
--- a/proteus/config.py
+++ b/proteus/config.py
@@ -48,11 +48,6 @@
def get_proxy_methods(self, name):
raise NotImplementedError
- def __eq__(self, other):
- if isinstance(other, Config):
- return repr(self) == repr(other)
- return NotImplemented
-
class _TrytondMethod(object):
@@ -121,6 +116,7 @@
database_name = 'test_%s' % int(time.time())
self.database_name = database_name
self._user = user
+ self.config_file = config_file
register_classes()
@@ -151,10 +147,23 @@
__init__.__doc__ = object.__init__.__doc__
def __repr__(self):
- return "proteus.config.TrytondConfig('%s', '%s', '%s')" % (
- self.database_name, self._user, self.database_type)
+ return "proteus.config.TrytondConfig('%s', '%s', '%s',
config_file=%s)"\
+ % (self.database_name, self._user, self.database_type,
+ self.config_file)
__repr__.__doc__ = object.__repr__.__doc__
+ def __eq__(self, other):
+ if not isinstance(other, TrytondConfig):
+ raise NotImplemented
+ return (self.database_name == other.database_name
+ and self._user == other._user
+ and self.database_type == other.database_type
+ and self.config_file == other.config_file)
+
+ def __hash__(self):
+ return hash((self.database_name, self._user,
+ self.database_type, self.config_file))
+
def get_proxy(self, name, type='model'):
'Return Proxy class'
return TrytondProxy(name, self, type=type)
@@ -200,6 +209,14 @@
return "proteus.config.XmlrpcConfig('%s')" % self.url
__repr__.__doc__ = object.__repr__.__doc__
+ def __eq__(self, other):
+ if not isinstance(other, XmlrpcConfig):
+ raise NotImplemented
+ return self.url == other.url
+
+ def __hash__(self):
+ return hash(self.url)
+
def get_proxy(self, name, type='model'):
'Return Proxy class'
return XmlrpcProxy(name, self, type=type)
Index: setup.py
===================================================================
--- a/setup.py
+++ b/setup.py
@@ -10,10 +10,6 @@
major_version = int(major_version)
minor_version = int(minor_version)
-SIMPLEJSON = []
-if sys.version_info < (2, 6):
- SIMPLEJSON = ['simplejson']
-
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
@@ -35,7 +31,8 @@
'Intended Audience :: Legal Industry',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: OS Independent',
- 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
'Topic :: Office/Business',
],
license='GPL-3',
--
[email protected] mailing list