[tryton-debian-vcs] tryton-proteus branch upstream updated. upstream/3.4.2-1-g73c3b8f

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 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-proteus.git;a=commitdiff;h=upstream/3.4.2-1-g73c3b8f

commit 73c3b8f6b747fbad8fabc525b7676e135723aff3
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Mar 31 14:30:52 2015 +0200

    Adding upstream version 3.4.3.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index 259efaf..712f9a8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.4.3 - 2015-03-30
+* Bug fixes (see mercurial logs for details)
+
 Version 3.4.2 - 2015-02-16
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 18ecd40..1e5d728 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: proteus
-Version: 3.4.2
+Version: 3.4.3
 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 18ecd40..1e5d728 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.4.2
+Version: 3.4.3
 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 59ef22d..3c95c68 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.4.2"
+__version__ = "3.4.3"
 __all__ = ['Model', 'Wizard', 'Report']
 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