[tryton-debian-vcs] tryton-proteus branch upstream-3.2 updated. upstream/3.2.3-1-ge49090e
Mathias Behrle
tryton-debian-vcs at alioth.debian.org
Tue Mar 31 12:45:25 UTC 2015
The following commit has been merged in the upstream-3.2 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-proteus.git;a=commitdiff;h=upstream/3.2.3-1-ge49090e
commit e49090e3212e0a20ad7acc1d3b3fdcd091c7c022
Author: Mathias Behrle <mathiasb at m9s.biz>
Date: Tue Mar 31 14:31:52 2015 +0200
Adding upstream version 3.2.4.
Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>
diff --git a/CHANGELOG b/CHANGELOG
index a7221d9..578a00c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.2.4 - 2015-03-30
+* Bug fixes (see mercurial logs for details)
+
Version 3.2.3 - 2015-02-16
* Bug fixes (see mercurial logs for details)
diff --git a/PKG-INFO b/PKG-INFO
index 27eaa6c..b1e7bd1 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: proteus
-Version: 3.2.3
+Version: 3.2.4
Summary: Library to access Tryton server as a client
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/proteus.egg-info/PKG-INFO b/proteus.egg-info/PKG-INFO
index 27eaa6c..b1e7bd1 100644
--- a/proteus.egg-info/PKG-INFO
+++ b/proteus.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: proteus
-Version: 3.2.3
+Version: 3.2.4
Summary: Library to access Tryton server as a client
Home-page: http://www.tryton.org/
Author: Tryton
diff --git a/proteus/__init__.py b/proteus/__init__.py
index 5e73936..cdd7b28 100644
--- a/proteus/__init__.py
+++ b/proteus/__init__.py
@@ -3,7 +3,7 @@
'''
A library to access Tryton's models like a client.
'''
-__version__ = "3.2.3"
+__version__ = "3.2.4"
__all__ = ['Model', 'Wizard']
import sys
try:
diff --git a/proteus/pyson.py b/proteus/pyson.py
index 462fce9..9e354d9 100644
--- a/proteus/pyson.py
+++ b/proteus/pyson.py
@@ -1,7 +1,7 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
__all__ = ['PYSONEncoder', 'PYSONDecoder', 'Eval', 'Not', 'Bool', 'And', 'Or',
- 'Equal', 'Greater', 'Less', 'If', 'Get', 'In', 'Date', 'DateTime']
+ 'Equal', 'Greater', 'Less', 'If', 'Get', 'In', 'Date', 'DateTime', 'Len']
try:
import simplejson as json
except ImportError:
@@ -529,6 +529,32 @@ class DateTime(Date):
)
+class Len(PYSON):
+
+ def __init__(self, value):
+ super(Len, self).__init__()
+ if isinstance(value, PYSON):
+ assert value.types().issubset(set([dict, list, str])), \
+ 'value must be a dict or a list or a string'
+ else:
+ assert type(value) in [dict, list, str], \
+ 'value must be a dict or list or a string'
+ self._value = value
+
+ def pyson(self):
+ return {
+ '__class__': 'Len',
+ 'v': self._value,
+ }
+
+ def types(self):
+ return set([int, long])
+
+ @staticmethod
+ def eval(dct, context):
+ return len(dct['v'])
+
+
CONTEXT = {
'Eval': Eval,
'Not': Not,
@@ -543,4 +569,5 @@ CONTEXT = {
'In': In,
'Date': Date,
'DateTime': DateTime,
+ 'Len': Len,
}
--
tryton-proteus
More information about the tryton-debian-vcs
mailing list