incubator-nuvem-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r1094179 - in /incubator/nuvem/trunk/nuvem-parallel: ./ nuvem/
Date Sun, 17 Apr 2011 18:18:44 GMT
Author: jsdelfino
Date: Sun Apr 17 18:18:43 2011
New Revision: 1094179

URL: http://svn.apache.org/viewvc?rev=1094179&view=rev
Log:
Add a few more list processing and math / computing components. Minor improvements to list,
text and date components to make them a bit more robust.

Added:
    incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/insert.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/cons.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/lookup.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/names.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/search.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/second.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/values.py
      - copied, changed from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
Removed:
    incubator/nuvem/trunk/nuvem-parallel/nuvem/cons.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/find.py
Modified:
    incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/delete.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/get.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/now.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/param.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/post.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/put.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py
    incubator/nuvem/trunk/nuvem-parallel/test.py

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, a, b):
-    return a.get(r) + b.get(r)
+    va = a.get(r)
+    vb = b.get(r)
+    return (() if va is None else va) + (() if vb is None else vb)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/assoc.py Sun Apr 17 18:18:43 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r, a, b):
-    return a.get(r) + b.get(r)
+def get(r, v, prop):
+    return ("'" + prop.eval(), v.get(r))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py Sun Apr 17 18:18:43 2011
@@ -15,6 +15,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r, a, b):
-    return a.get(r) + b.get(r)
+def get(r, x):
+    from math import cos
+    return cos(float(x.get(r)))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/delete.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/delete.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/delete.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/delete.py Sun Apr 17 18:18:43 2011
@@ -24,5 +24,5 @@ def get(r, coll, id):
         return True
 
     idv = id.get(r)
-    return coll.delete(idv if isList(idv) else (idv,))
+    return coll.delete(() if idv is None else idv if isList(idv) else (idv,))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/equals.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, a, b):
-    return a.get(r) == b.get(r)
+    va = a.get(r)
+    vb = b.get(r)
+    return (() if va is None else va) == (() if vb is None else vb)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/filter_.py Sun Apr 17 18:18:43 2011
@@ -19,7 +19,8 @@ def get(r, item, cond, l):
     iv = item.get(r)
 
     def cfun(i):
-        return cond.get(r + ((iv, i),))
+        return cond.get(((iv, i),) + r)
 
-    return tuple(filter(cfun, l.get(r)))
+    vl = l.get(r)
+    return tuple(filter(cfun, () if vl is None else vl))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,10 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[0]
+    lv = l.get(r)
+    if lv is None:
+        return lv
+    if len(lv) == 0:
+        return None
+    return lv[0]
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py Sun Apr 17 18:18:43 2011
@@ -32,9 +32,15 @@ def get(r, fmt, args):
             return True
         return False
 
+    def trimq(x):
+        if not isinstance(x, basestring):
+            return x
+        return x[1:] if x[0:1] == "'" else x
+
     l = args.get(r)
-    la = filter(lambda x: not isAssoc(x), l)
-    ka = dict(map(lambda x: (x[0][1:], x[1]), filter(lambda x: isAssoc(x), l)))
+    lv = () if l is None else l
+    la = map(trimq, filter(lambda x: not isAssoc(x), lv))
+    ka = dict(map(lambda x: (x[0][1:], x[1]), filter(lambda x: isAssoc(x), lv)))
 
     return fmt.get(r).format(*la, **ka)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/get.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/get.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/get.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/get.py Sun Apr 17 18:18:43 2011
@@ -24,5 +24,8 @@ def get(r, coll, id):
         return True
 
     idv = id.get(r)
-    return coll.get(idv if isList(idv) else (idv,))
+    res = coll.get(() if idv is None else idv if isList(idv) else (idv,))
+    from sys import stderr
+    print >> stderr, 'get result', res
+    return res
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/insert.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/cons.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/insert.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/insert.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/cons.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/cons.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/insert.py Sun Apr 17 18:18:43 2011
@@ -16,8 +16,7 @@
 #  under the License.
 
 def get(r, first, rest):
-    rst = rest.get(r)
-    if rst is None:
-        return (first.get(r),)
-    return (first.get(r),) + rst
+    vf = first.get(r)
+    vr = rest.get(r)
+    return (vf,) + (() if vr is None else vr)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,6 @@
 #  under the License.
 
 def get(r, i, l):
-    return l.get(r)[int(i.get(r))]
+    lv = l.get(r)
+    return (() if lv is None else lv)[int(i.get(r))]
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,10 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[0]
+    lv = l.get(r)
+    if lv is None:
+        return lv
+    if len(lv) == 0:
+        return None
+    return lv[len(lv) - 1]
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/lookup.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/lookup.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/lookup.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/lookup.py Sun Apr 17 18:18:43 2011
@@ -15,7 +15,8 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r, fmt, args):
+# Return a list of name value pairs that match a name
+def get(r, n, l):
     def isList(v):
         if getattr(v, '__iter__', False) == False:
             return False
@@ -24,17 +25,31 @@ def get(r, fmt, args):
         return True
 
     def isAssoc(v):
-        if not isList(v):
-            return False
-        if len(v) != 2:
-            return False
-        if isinstance(v[0], basestring) and v[0][0:1] == "'":
-            return True
-        return False
-
-    l = args.get(r)
-    la = filter(lambda x: not isAssoc(x), l)
-    ka = dict(map(lambda x: (x[0][1:], x[1]), filter(lambda x: isAssoc(x), l)))
+        return isList(v) and len(v) == 2 and isinstance(v[0], basestring) and v[0][0:1] ==
"'"
+
+    def lookup(nv, lv):
+        if lv == ():
+            return ()
+
+        # Check if list element is a name value pair assoc
+        a = lv[0]
+        if not isAssoc(a):
+            return lookup(nv, lv[1:])
+
+        # Got a match, return it and lookup rest of the list
+        an = "'" + a[0][2:] if a[0][0:2] == "'@" else a[0]
+        if an == nv:
+            return (a,) + lookup(nv, lv[1:])
+
+        # No match, lookup rest of the list
+        return lookup(nv, lv[1:])
+
+    def qsymbol(x):
+        if not isinstance(x, basestring):
+            return x
+        return x if x[0:1] == "'" else "'" + x
 
-    return fmt.get(r).format(*la, **ka)
+    nv = n.get(r)
+    lv = l.get(r)
+    return lookup(qsymbol(nv), () if lv is None else lv)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/map_.py Sun Apr 17 18:18:43 2011
@@ -19,7 +19,8 @@ def get(r, item, transform, l):
     iv = item.get(r)
 
     def tfun(i):
-        return transform.get(r + ((iv, i),))
+        return transform.get(((iv, i),) + r)
 
-    return tuple(map(tfun, l.get(r)))
+    lv = l.get(r)
+    return tuple(map(tfun, () if lv is None else lv))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,5 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[0]
+    return max(l.get(r))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,5 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[0]
+    return min(l.get(r))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/names.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/names.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/names.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/names.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,8 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[0]
+    lv = l.get(r)
+    if lv is None:
+        return lv
+    return tuple(map(lambda p: p[0], lv))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/now.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/now.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/now.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/now.py Sun Apr 17 18:18:43 2011
@@ -15,7 +15,10 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r):
+def get(r, f):
     from datetime import datetime
-    return datetime.now().ctime()
+    fv = f.get(r)
+    if fv is None:
+        return datetime.now().ctime()
+    return datetime.now().strftime(fv)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/param.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/param.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/param.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/param.py Sun Apr 17 18:18:43 2011
@@ -15,7 +15,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r, n, prop):
+def get(r, name, params):
     def lookup(nv, lv):
         if lv == ():
             return None
@@ -24,5 +24,5 @@ def get(r, n, prop):
             return a[1]
         return lookup(nv, lv[1:])
 
-    return lookup(n.get(r), prop.eval())
+    return lookup("'" + name.eval(), params.eval())
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py Sun Apr 17 18:18:43 2011
@@ -18,6 +18,7 @@
 import re
 
 def get(r, expr, s):
-    m = re.search(expr.get(r), s.get(r))
+    sv = s.get(r)
+    m = re.search(expr.get(r), sv)
     return () if m is None else m.groups()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/post.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/post.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/post.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/post.py Sun Apr 17 18:18:43 2011
@@ -24,5 +24,5 @@ def get(r, coll, id, val):
         return True
 
     idv = id.get(r)
-    return coll.post(idv if isList(idv) else (idv,), val.get(r))
+    return coll.post(() if idv is None else idv if isList(idv) else (idv,), val.get(r))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/put.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/put.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/put.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/put.py Sun Apr 17 18:18:43 2011
@@ -24,5 +24,5 @@ def get(r, coll, id, val):
         return True
 
     idv = id.get(r)
-    return coll.put(idv if isList(idv) else (idv,), val.get(r))
+    return coll.put(() if idv is None else idv if isList(idv) else (idv,), val.get(r))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py Sun Apr 17 18:18:43 2011
@@ -15,6 +15,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r, a, b):
-    return a.get(r) + b.get(r)
+def get(r):
+    from random import random
+    return random()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/reduce_.py Sun Apr 17 18:18:43 2011
@@ -15,12 +15,13 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r, item, accum, transform, l):
+def get(r, item, accum, transform, init, l):
     iv = item.get(r)
     av = accum.get(r)
 
     def tfun(a, i):
-        return transform.get(r + ((av, a), (iv, i)))
+        return transform.get(((av, a), (iv, i)) + r)
 
-    return reduce(tfun, l.get(r))
+    lv = l.get(r)
+    return reduce(tfun, () if lv is None else lv, init.get(r))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py Sun Apr 17 18:18:43 2011
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r, a, b):
-    return a.get(r) + b.get(r)
+def get(r, n, x):
+    return round(float(x.get(r)), int(n.get(r)))
 

Added: incubator/nuvem/trunk/nuvem-parallel/nuvem/search.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/search.py?rev=1094179&view=auto
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/search.py (added)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/search.py Sun Apr 17 18:18:43 2011
@@ -0,0 +1,74 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#    
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+# Return a list of name value pairs that match a name
+# Search through nested lists of name value pairs
+def get(r, p, l):
+    def isList(v):
+        if getattr(v, '__iter__', False) == False:
+            return False
+        if isinstance(v, basestring) or isinstance(v, dict):
+            return False
+        return True
+
+    def isAssoc(v):
+        return isList(v) and len(v) == 2 and isinstance(v[0], basestring) and v[0][0:1] ==
"'"
+
+    def lookup(pv, lv):
+        if lv == ():
+            return ()
+        if isAssoc(lv):
+            lv = (lv,)
+
+        # Check if list element is a name value pair assoc
+        a = lv[0]
+        if not isAssoc(a):
+            # Lookup children if any and rest of list
+            if isList(a):
+                return lookup(pv, a) + lookup(pv, lv[1:])
+            return lookup(pv, lv[1:])
+
+        # Path segment match
+        an = "'" + a[0][2:] if a[0][0:2] == "'@" else a[0]
+        if an == pv[0]:
+            # Found leaf, return it and lookup rest of the list
+            if len(pv) == 1:
+                return (a,) + lookup(pv, lv[1:])
+            # Continue to lookup children if any plus rest of the list
+            if isList(a[1]):
+                return lookup(pv[1:], a[1]) + lookup(pv, lv[1:])
+            return lookup(pv, lv[1:])
+
+        # No match, lookup any children and rest of the list
+        if (isList(a[1])):
+            return lookup(pv, a[1]) + lookup(pv, lv[1:])
+        return lookup(pv, lv[1:])
+
+    def qsymbol(x):
+        if not isinstance(x, basestring):
+            return x
+        return x if x[0:1] == "'" else "'" + x
+
+    # Support path as a list or a dot separated string
+    lv = l.get(r)
+    pv = p.get(r)
+    if (isList(pv)):
+        return lookup(map(qsymbol, pv), () if lv is None else lv)
+
+    spv = map(qsymbol, qsymbol(pv)[1:].split('.'))
+    return lookup(spv, () if lv is None else lv)
+

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/second.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/second.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/second.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/second.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,10 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[0]
+    lv = l.get(r)
+    if lv is None:
+        return lv
+    if len(lv) < 2:
+        return None
+    return lv[1]
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,8 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[0]
+    from random import shuffle
+    rl = list(l.get(r))
+    shuffle(rl)
+    return tuple(rl)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py Sun Apr 17 18:18:43 2011
@@ -15,6 +15,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r, a, b):
-    return a.get(r) + b.get(r)
+def get(r, x):
+    from math import sin
+    return sin(float(x.get(r)))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,5 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[0]
+    return sum(l.get(r))
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py Sun Apr 17 18:18:43 2011
@@ -15,7 +15,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r, fmt, args):
+def get(r, address, args):
     def isList(v):
         if getattr(v, '__iter__', False) == False:
             return False
@@ -33,8 +33,9 @@ def get(r, fmt, args):
         return False
 
     l = args.get(r)
-    la = filter(lambda x: not isAssoc(x), l)
-    ka = dict(map(lambda x: (x[0][1:], x[1]), filter(lambda x: isAssoc(x), l)))
+    lv = () if l is None else l
+    la = map(lambda x: str(x), filter(lambda x: not isAssoc(x), lv))
+    ka = map(lambda x: '='.join((x[0][1:], str(x[1]))), filter(lambda x: isAssoc(x), lv))
 
-    return fmt.get(r).format(*la, **ka)
+    return address.get(r) + '/'.join(la) + ('?' if len(ka) != 0 else '') + '&'.join(ka)
 

Copied: incubator/nuvem/trunk/nuvem-parallel/nuvem/values.py (from r1094178, incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py)
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/values.py?p2=incubator/nuvem/trunk/nuvem-parallel/nuvem/values.py&p1=incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py&r1=1094178&r2=1094179&rev=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/values.py Sun Apr 17 18:18:43 2011
@@ -16,5 +16,8 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[0]
+    lv = l.get(r)
+    if lv is None:
+        return lv
+    return tuple(map(lambda p: p[1], lv))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/test.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/test.py?rev=1094179&r1=1094178&r2=1094179&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/test.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/test.py Sun Apr 17 18:18:43 2011
@@ -29,7 +29,9 @@ from nuvem import number
 from nuvem import text
 from nuvem import name
 from nuvem import nothing
+from nuvem import assoc
 from nuvem import pair
+from nuvem import call
 from nuvem import if_
 from nuvem import and_
 from nuvem import or_
@@ -37,15 +39,20 @@ from nuvem import not_
 from nuvem import equals
 from nuvem import lesser
 from nuvem import greater
-from nuvem import cons
 from nuvem import list_
 from nuvem import empty
 from nuvem import first
+from nuvem import second
 from nuvem import rest
+from nuvem import insert
 from nuvem import append
 from nuvem import itemnb
-from nuvem import find
+from nuvem import names
+from nuvem import values
+from nuvem import lookup
+from nuvem import search
 from nuvem import reverse
+from nuvem import shuffle_
 from nuvem import range_
 from nuvem import map_
 from nuvem import valueof
@@ -55,6 +62,13 @@ from nuvem import add
 from nuvem import subtract
 from nuvem import multiply
 from nuvem import divide
+from nuvem import random_
+from nuvem import sin_
+from nuvem import cos_
+from nuvem import round_
+from nuvem import sum_
+from nuvem import min_
+from nuvem import max_
 from nuvem import host
 from nuvem import path
 from nuvem import params
@@ -62,6 +76,7 @@ from nuvem import param
 from nuvem import user
 from nuvem import realm
 from nuvem import email
+from nuvem import url
 from nuvem import contains
 from nuvem import split
 from nuvem import join
@@ -80,10 +95,11 @@ def testValues():
     assert number.get((), mkprop('value', lambda: 1)) == 1
     assert text.get((), mkprop('value', lambda: 'abc')) == 'abc'
     assert name.get((), mkprop('value', lambda: 'abc')) == "'abc"
-    assert pair.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'def')) == ('abc',
'def')
+    assert assoc.get((), mkref('value', lambda r: 'def'), mkprop('key', lambda: 'abc')) ==
("'abc", 'def')
     return True
 
 def testLogic():
+    assert call.get((), mkref('name', lambda r: 'abc'), mkref('proxy', lambda c, r: (c, r)))
== ('abc', ())
     assert if_.get((), mkref('cond', lambda r: True), mkref('then', lambda r: 'abc'), mkref('els',
lambda r: 'def')) == 'abc'
     assert if_.get((), mkref('cond', lambda r: False), mkref('then', lambda r: 'abc'), mkref('els',
lambda r: 'def')) == 'def'
     assert and_.get((), mkref('a', lambda r: False), mkref('b', lambda r: True)) == False
@@ -101,26 +117,33 @@ def testLogic():
     return True
 
 def testLists():
+    assert pair.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'def')) == ('abc',
'def')
     assert list_.get((), mkref('item', lambda r: None)) == ()
     assert list_.get((), mkref('item', lambda r: 'abc'), mkref('item', lambda r: None)) ==
('abc',)
     assert list_.get((), mkref('item', lambda r: 'abc'), mkref('item', lambda r: 'def'),
mkref('item', lambda r: None)) == ('abc', 'def')
-    assert cons.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: None)) ==
('abc',)
-    assert cons.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: ())) ==
('abc',)
-    assert cons.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: ('def',)))
== ('abc', 'def')
-    assert cons.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: ('def',
'ghi'))) == ('abc', 'def', 'ghi')
+    assert insert.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: None))
== ('abc',)
+    assert insert.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: ())) ==
('abc',)
+    assert insert.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: ('def',)))
== ('abc', 'def')
+    assert insert.get((), mkref('first', lambda r: 'abc'), mkref('rest', lambda r: ('def',
'ghi'))) == ('abc', 'def', 'ghi')
     assert empty.get(()) == ()
     assert first.get((), mkref('l', lambda r: ('abc', 'def'))) == 'abc'
+    assert second.get((), mkref('l', lambda r: ('abc', 'def'))) == 'def'
     assert rest.get((), mkref('l', lambda r: ('abc', 'def', 'ghi'))) == ('def', 'ghi')
     assert rest.get((), mkref('l', lambda r: ('abc',))) == ()
     assert append.get((), mkref('l', lambda r: ('abc', 'def')), mkref('b', lambda r: ('ghi',)))
== ('abc', 'def', 'ghi')
     assert itemnb.get((), mkref('i', lambda r: 1), mkref('l', lambda r: ('abc', 'def', 'ghi')))
== 'def'
-    assert find.get((), mkref('n', lambda r: "'d"), mkref('l', lambda r: (("'a", 'abc'),
("'d", 'def'), ("'g", 'ghi')))) == 'def'
+    assert names.get((), mkref('l', lambda r: (("'a", 'abc'), ("'d", 'def'), ("'g", 'ghi'),
("'d", 'def2')))) == ("'a", "'d", "'g", "'d")
+    assert values.get((), mkref('l', lambda r: (("'a", 'abc'), ("'d", 'def'), ("'g", 'ghi'),
("'d", 'def2')))) == ('abc', 'def', 'ghi', 'def2')
+    assert lookup.get((), mkref('n', lambda r: "'d"), mkref('l', lambda r: (("'a", 'abc'),
("'d", 'def'), ("'g", 'ghi'), ("'d", 'def2')))) == (("'d", 'def'), ("'d", 'def2'))
+    assert search.get((), mkref('n', lambda r: "'d.x"), mkref('l', lambda r: (("'a", 'abc'),
("'d", (("'x", 'def'), ("'y", "yyy"))), ("'g", 'ghi'), ("'d", (("'y", 'yyy'), ("'x", 'def2'))))))
== (("'x", 'def'), ("'x", 'def2'))
+    assert search.get((), mkref('n', lambda r: ("'d", "'x")), mkref('l', lambda r: (("'a",
'abc'), ("'d", (("'x", 'def'), ("'y", "yyy"))), ("'g", 'ghi'), ("'d", (("'y", 'yyy'), ("'x",
'def2')))))) == (("'x", 'def'), ("'x", 'def2'))
     assert reverse.get((), mkref('l', lambda r: ('abc', 'def', 'ghi'))) == ('ghi', 'def',
'abc')
+    assert shuffle_.get((), mkref('l', lambda r: ('abc', 'def', 'ghi'))) != ()
     assert range_.get((), mkref('a', lambda r: '1'), mkref('b', lambda r: '4')) == (1, 2,
3)
 
     assert map_.get((), mkref('item', lambda r: "'i"), mkref('transform', lambda r: valueof.get(r,
mkprop('name', lambda: 'i')) * 2), mkref('list', lambda r: (1, 2, 3))) == (2, 4, 6)
     assert filter_.get((), mkref('item', lambda r: "'i"), mkref('cond', lambda r: valueof.get(r,
mkprop('name', lambda: 'i')) % 2 == 0), mkref('list', lambda r: (1, 2, 3, 4))) == (2, 4)
-    assert reduce_.get((), mkref('item', lambda r: "'i"), mkref('accum', lambda r: "'a"),
mkref('transform', lambda r: valueof.get(r, mkprop('name', lambda: 'a')) + valueof.get(r,
mkprop('name', lambda: 'i'))), mkref('list', lambda r: (1, 2, 3, 4))) == 10
+    assert reduce_.get((), mkref('item', lambda r: "'i"), mkref('accum', lambda r: "'a"),
mkref('transform', lambda r: valueof.get(r, mkprop('name', lambda: 'a')) + valueof.get(r,
mkprop('name', lambda: 'i'))), mkref('init', lambda r: 0), mkref('list', lambda r: (1, 2,
3, 4))) == 10
     return True
 
 def testMath():
@@ -128,16 +151,27 @@ def testMath():
     assert subtract.get((), mkref('a', lambda r: 3), mkref('b', lambda r: 2)) == 1
     assert multiply.get((), mkref('a', lambda r: 2), mkref('b', lambda r: 3)) == 6
     assert divide.get((), mkref('a', lambda r: 3), mkref('b', lambda r: 2)) == 1.5
+    r1 = random_.get(())
+    assert r1 >= 0 and r1 <= 1
+    r2 = random_.get(())
+    assert r2 >= 0 and r2 <= 1 and r2 != r1
+    assert sin_.get((), mkref('x', lambda r: 0.0)) == 0.0
+    assert cos_.get((), mkref('x', lambda r: 0.0)) == 1.0
+    assert round_.get((), mkref('d', lambda r: 2), mkref('x', lambda r: 2.336)) == 2.34
+    assert sum_.get((), mkref('l', lambda r: (1, 2, 3))) == 6
+    assert min_.get((), mkref('l', lambda r: (2, 1, 3))) == 1
+    assert max_.get((), mkref('l', lambda r: (1, 3, 2))) == 3
     return True
 
 def testURL():
     assert host.get((), mkprop('host', lambda: 'localhost')) == 'localhost'
     assert path.get((), mkprop('path', lambda: ('abc', 'def'))) == ('abc', 'def')
     assert params.get((), mkprop('params', lambda: (("'a", 'abc'), ("'d", 'def')))) == (("'a",
'abc'), ("'d", 'def'))
-    assert param.get((), mkref('n', lambda r: "'d"), mkprop('params', lambda: (("'a", 'abc'),
("'d", 'def'), ("'g", 'ghi')))) == 'def'
+    assert param.get((), mkprop('n', lambda: "d"), mkprop('params', lambda: (("'a", 'abc'),
("'d", 'def'), ("'g", 'ghi')))) == 'def'
     assert user.get((), mkprop('user', lambda: 'joe')) == 'joe'
     assert realm.get((), mkprop('realm', lambda: 'localhost')) == 'localhost'
     assert email.get((), mkprop('email', lambda: 'joe@localhost')) == 'joe@localhost'
+    assert url.get((), mkref('address', lambda r: 'http://localhost/'), mkref('args', lambda
r: ('test', 'path', ("'a", 1), ("'b", '2')))) == 'http://localhost/test/path?a=1&b=2'
     return True
 
 def testText():



Mime
View raw message