Remove support of Python2.5 and fix py3 warnings
This commit is contained in:
1 parent
c2486a12d7
commit
a8a4d16c49
4 files changed
+29
-13
No files matched your search
@@ -1,5 +1,7 @@
|
||||
* Change license to LGPL-3
|
||||
|
||||
* 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
|
||||
|
||||
@@ -4,7 +4,7 @@ Installing proteus
|
||||
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
|
||||
|
||||
+24
-7
@@ -48,11 +48,6 @@ class Config(object):
|
||||
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 @@ class TrytondConfig(Config):
|
||||
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 @@ class TrytondConfig(Config):
|
||||
__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 @@ class XmlrpcConfig(Config):
|
||||
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)
|
||||
|
||||
@@ -10,10 +10,6 @@ major_version, minor_version, _ = proteus.__version__.split('.', 2)
|
||||
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 @@ setup(name='proteus',
|
||||
'Intended Audience :: Legal Industry',
|
||||
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Topic :: Office/Business',
|
||||
],
|
||||
license='LGPL-3',
|
||||
|
||||
Reference in new issue
Block a user