incubator-nuvem-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r1154294 - in /incubator/nuvem/trunk/nuvem-parallel: ./ nuvem/
Date Fri, 05 Aug 2011 16:24:14 GMT
Author: jsdelfino
Date: Fri Aug  5 16:24:12 2011
New Revision: 1154294

URL: http://svn.apache.org/viewvc?rev=1154294&view=rev
Log:
Implement type checks, checks for None values and automatic type conversions when necessary.
Add a few more test cases.

Modified:
    incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/call.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/eval_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/exec_.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/gmap.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/htbutton.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/htcheck.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/htimg.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/htlink.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/htstyle.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/pixels.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/select.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py
    incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py
    incubator/nuvem/trunk/nuvem-parallel/test.py

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/add.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, a, b):
-    return float(a.get(r)) + float(b.get(r))
+    va = a.get(r)
+    vb = b.get(r)
+    return float(0 if va is None else va) + float(0 if vb is None else vb)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/and_.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, a, b):
-    return a.get(r) and b.get(r)
+    va = a.get(r)
+    vb = b.get(r)
+    return (False if va is None else bool(va)) and (False if vb is None else bool(vb))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/append.py Fri Aug  5 16:24:12 2011
@@ -16,7 +16,16 @@
 #  under the License.
 
 def get(r, a, b):
+    def isList(v):
+        if getattr(v, '__iter__', False) == False:
+            return False
+        if isinstance(v, basestring) or isinstance(v, dict):
+            return False
+        return True
+
     va = a.get(r)
+    la = () if va is None else va if isList(va) else (va,)
     vb = b.get(r)
-    return (() if va is None else va) + (() if vb is None else vb)
+    lb = () if vb is None else vb if isList(vb) else (vb,)
+    return la + lb
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/call.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/call.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/call.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/call.py Fri Aug  5 16:24:12 2011
@@ -17,5 +17,5 @@
 
 def get(r, name, proxy):
     nv = name.get(r)
-    return proxy.get(nv if nv[0:1] == "'" else "'" + nv, r)
+    return proxy.get("'start" if nv is None else nv if nv[0:1] == "'" else "'" + nv, r)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/contains.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, sub, s):
-    return s.get(r).find(sub.get(r)) != -1
+    vsub = sub.get(r)
+    vs = s.get(r)
+    return ('' if vs is None else str(vs)).find('' if vsub is None else str(vsub)) != -1
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/cos_.py Fri Aug  5 16:24:12 2011
@@ -17,5 +17,6 @@
 
 def get(r, x):
     from math import cos
-    return cos(float(x.get(r)))
+    vx = x.get(r)
+    return cos(float(0.0 if vx is None else vx))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/divide.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, a, b):
-    return float(a.get(r)) / float(b.get(r))
+    va = a.get(r)
+    vb = b.get(r)
+    return float(0 if va is None else va) / float(1 if vb is None else vb)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/eval_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/eval_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/eval_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/eval_.py Fri Aug  5 16:24:12 2011
@@ -17,4 +17,4 @@
 
 def get(r, py, ref):
     pye = py.get(r)
-    return eval(pye if isinstance(pye, basestring) else pye[1][0])
+    return eval('' if pye is None else pye if isinstance(pye, basestring) else pye[1][0])

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/exec_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/exec_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/exec_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/exec_.py Fri Aug  5 16:24:12 2011
@@ -18,5 +18,5 @@
 def get(r, py, ref):
     val = None
     pys = py.get(r)
-    exec(pys if isinstance(pys, basestring) else pys[1][0])
+    exec('' if pys is None else pys if isinstance(pys, basestring) else pys[1][0])
     return val

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/first.py Fri Aug  5 16:24:12 2011
@@ -18,7 +18,7 @@
 def get(r, l):
     lv = l.get(r)
     if lv is None:
-        return lv
+        return None
     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=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/format_.py Fri Aug  5 16:24:12 2011
@@ -42,5 +42,6 @@ def get(r, fmt, args):
     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)
+    vfmt = fmt.get(r)
+    return ('' if vfmt is None else str(vfmt)).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=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/get.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/get.py Fri Aug  5 16:24:12 2011
@@ -25,7 +25,5 @@ def get(r, coll, id):
 
     idv = id.get(r)
     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
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/gmap.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/gmap.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/gmap.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/gmap.py Fri Aug  5 16:24:12 2011
@@ -21,15 +21,16 @@ def get(r, markers, s):
 
     def ismarker(m):
         from sys import stderr
-        print >> stderr, "####", m
         return m[1] is not None
 
     def marker(m):
-        # expecting (label, (color, loc))
+        # expecting (label or icon url, (color, loc))
         label = m[0][1:]
-        color = m[1][0]
+        deco = m[1][0]
         loc = string.join(map(str, m[1][1:3]), ',')
-        return ("'markers", 'color:{0}|label:{1}|{2}'.format(color, label, loc))
+        if deco.find(':') == -1:
+            return ("'markers", 'color:{0}|label:{1}|{2}'.format(deco, label, loc))
+        return ("'markers", 'icon:{0}|{1}'.format(deco, loc))
     
     mv = markers.get(r)
     return s.get((("'size", '320x320'), ("'maptype", 'roadmap'), ("'sensor", 'true')) + tuple(map(marker,
filter(ismarker, () if mv is None else mv))))

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/htbutton.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/htbutton.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/htbutton.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/htbutton.py Fri Aug  5 16:24:12 2011
@@ -46,5 +46,5 @@ def get(r, value):
         batts = string.join(map(lambda x: x[0][1:] + '="' + x[1] + '"', filter(lambda x:
x[0] != "'id", l)), ' ')
         return '<SPAN {0} class="button"><INPUT type="button" {1} class="graybutton"/></SPAN>'.format(satts,
batts)
 
-    return mkbutton(v) if isList(v) and not isAssoc(v) else mkbutton((v,))
+    return mkbutton(()) if v is None else mkbutton(v) if isList(v) and not isAssoc(v) else
mkbutton((v,))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/htcheck.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/htcheck.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/htcheck.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/htcheck.py Fri Aug  5 16:24:12 2011
@@ -47,5 +47,5 @@ def get(r, value):
         text = filter(lambda x: x[0] == "'value", l)[0][1]
         return '<SPAN {0} class="checkbox"><INPUT type="checkbox" {1}/><SPAN>{2}</SPAN></SPAN>'.format(satts,
catts, text)
 
-    return mkcheck(v) if isList(v) and not isAssoc(v) else mkcheck((v,))
+    return mkcheck(()) if v is None else mkcheck(v) if isList(v) and not isAssoc(v) else
mkcheck((v,))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/htimg.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/htimg.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/htimg.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/htimg.py Fri Aug  5 16:24:12 2011
@@ -43,8 +43,8 @@ def get(r, value):
         if len(l) == 0:
             return ''
         satts = string.join(map(lambda x: x[0][1:] + '="' + x[1] + '"', filter(lambda x:
x[0] == "'id", l)), ' ')
-        iatts = string.join(map(lambda x: x[0][1:] + '="' + x[1] + '"', filter(lambda x:
x[0] != "'id", l)), ' ')
+        iatts = string.join(map(lambda x: ('style' if x[0] == "'htstyle" else x[0][1:]) +
'="' + x[1] + '"', filter(lambda x: x[0] != "'id", l)), ' ')
         return '<SPAN {0} class="img"><IMG {1}/></SPAN>'.format(satts,
iatts)
 
-    return mkimg(v) if isList(v) and not isAssoc(v) else mkimg((v,))
+    return mkimg(()) if v is None else mkimg(v) if isList(v) and not isAssoc(v) else mkimg((v,))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/htlink.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/htlink.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/htlink.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/htlink.py Fri Aug  5 16:24:12 2011
@@ -47,5 +47,5 @@ def get(r, value):
         text = filter(lambda x: x[0] == "'value", l)[0][1]
         return '<SPAN {0} class="link"><A {1}><SPAN>{2}</SPAN></A></SPAN>'.format(satts,
hatts, text)
 
-    return mklink(v) if isList(v) and not isAssoc(v) else mklink((v,))
+    return mklink(()) if v is None else mklink(v) if isList(v) and not isAssoc(v) else mklink((v,))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/htstyle.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/htstyle.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/htstyle.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/htstyle.py Fri Aug  5 16:24:12 2011
@@ -36,8 +36,12 @@ def get(r, value):
             return True
         return False
 
+    if v is None:
+        return ("'htstyle", '')
+
     if isList(v):
-        return ("'style", string.join(map(lambda x: (x[0][1:] + ': ' + str(x[1]) + ';') if
isAssoc(x) else x, v), ' '))
+        lv = (v,) if isAssoc(v) else v
+        return ("'htstyle", string.join(map(lambda x: (x[0][1:] + ': ' + str(x[1]) + ';')
if isAssoc(x) else (str(x) + ';'), lv), ' '))
 
-    return ("'style", v)
+    return ("'htstyle", v + ';')
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/if_.py Fri Aug  5 16:24:12 2011
@@ -16,7 +16,8 @@
 #  under the License.
 
 def get(r, cond, then, els):
-    if cond.get(r):
+    vc = cond.get(r)
+    if vc:
         return then.get(r)
     else:
         return els.get(r)

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/itemnb.py Fri Aug  5 16:24:12 2011
@@ -17,5 +17,6 @@
 
 def get(r, i, l):
     lv = l.get(r)
-    return (() if lv is None else lv)[int(i.get(r))]
+    vi = i.get(r)
+    return (() if lv is None else lv)[0 if vi is None else int(vi)]
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/join.py Fri Aug  5 16:24:12 2011
@@ -19,5 +19,6 @@ import string
 
 def get(r, sep, l):
     s = sep.get(r)
-    return string.join(l.get(r), '' if s is None else s)
+    lv = l.get(r)
+    return string.join(() if lv is None else lv, '' if s is None else s)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/last.py Fri Aug  5 16:24:12 2011
@@ -18,7 +18,7 @@
 def get(r, l):
     lv = l.get(r)
     if lv is None:
-        return lv
+        return None
     if len(lv) == 0:
         return None
     return lv[len(lv) - 1]

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/lowercase.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,6 @@
 #  under the License.
 
 def get(r, s):
-    return s.get(r).lower()
+    vs = s.get(r)
+    return ('' if vs is None else str(vs)).lower()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/max_.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,6 @@
 #  under the License.
 
 def get(r, l):
-    return max(l.get(r))
+    lv = l.get(r)
+    return max(() if lv is None else lv)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/min_.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,6 @@
 #  under the License.
 
 def get(r, l):
-    return min(l.get(r))
+    lv = l.get(r)
+    return min(() if lv is None else lv)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/multiply.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, a, b):
-    return float(a.get(r)) * float(b.get(r))
+    va = a.get(r)
+    vb = b.get(r)
+    return float(0 if va is None else va) * float(0 if vb is None else vb)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/or_.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, a, b):
-    return a.get(r) or b.get(r)
+    va = a.get(r)
+    vb = b.get(r)
+    return (False if va is None else bool(va)) or (False if vb is None else bool(vb))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/parse.py Fri Aug  5 16:24:12 2011
@@ -18,7 +18,8 @@
 import re
 
 def get(r, expr, s):
+    ev = expr.get(r)
     sv = s.get(r)
-    m = re.search(expr.get(r), sv)
+    m = re.search('' if ev is None else ev, '' if sv is None else sv)
     return () if m is None else m.groups()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/pixels.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/pixels.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/pixels.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/pixels.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,6 @@
 #  under the License.
 
 def get(r, n):
-    return '{0:g}px'.format(n.get(r))
+    vn = n.get(r)
+    return '{0:g}px'.format(round(0 if vn is None else float(vn), 0))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/random_.py Fri Aug  5 16:24:12 2011
@@ -15,7 +15,19 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(r):
-    from random import random
-    return random()
+def get(r, m):
+    import random
+    mv = m.get(r)
+
+    def isList(v):
+        if getattr(v, '__iter__', False) == False:
+            return False
+        if isinstance(v, basestring) or isinstance(v, dict):
+            return False
+        return True
+
+    if isList(mv):
+        return random.choice(mv)
+
+    return random.random() * (1.0 if mv is None else mv)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/range_.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, a, b):
-    return tuple(range(int(a.get(r)), int(b.get(r))))
+    va = a.get(r)
+    vb = b.get(r)
+    return tuple(range(int(0 if va is None else va), int(0 if vb is None else vb)))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/replace.py Fri Aug  5 16:24:12 2011
@@ -16,6 +16,8 @@
 #  under the License.
 
 def get(r, fr, to, s):
-    t = to.get(r)
-    return s.get(r).replace(fr.get(r), '' if t is None else t)
+    vfr = fr.get(r)
+    vto = to.get(r)
+    vs = s.get(r)
+    return ('' if vs is None else str(vs)).replace('' if vfr is None else str(vfr), '' if
vto is None else str(vto))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/rest.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,8 @@
 #  under the License.
 
 def get(r, l):
-    return l.get(r)[1:]
+    vl = l.get(r)
+    if vl is None:
+        return ()
+    return vl[1:]
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/reverse.py Fri Aug  5 16:24:12 2011
@@ -16,7 +16,10 @@
 #  under the License.
 
 def get(r, l):
-    rl = list(l.get(r))
+    vl = l.get(r)
+    if vl is None:
+        return ()
+    rl = list(vl)
     rl.reverse()
     return tuple(rl)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/round_.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, n, x):
-    return round(float(x.get(r)), int(n.get(r)))
+    vx = x.get(r)
+    vn = n.get(r)
+    return round(float(0 if vx is None else vx), int(0 if vn is None else vn))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/select.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/select.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/select.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/select.py Fri Aug  5 16:24:12 2011
@@ -53,8 +53,8 @@ def get(r, p, l):
 
         # 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:])
+            return lookup(pv, a[1]) + lookup(pv, a[2:]) + lookup(pv, lv[1:])
+        return lookup(pv, a[2:]) + lookup(pv, lv[1:])
 
     def qsymbol(x):
         if not isinstance(x, basestring):

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/shuffle_.py Fri Aug  5 16:24:12 2011
@@ -17,7 +17,10 @@
 
 def get(r, l):
     from random import shuffle
-    rl = list(l.get(r))
+    vl = l.get(r)
+    if vl is None:
+        return ()
+    rl = list(vl)
     shuffle(rl)
     return tuple(rl)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/sin_.py Fri Aug  5 16:24:12 2011
@@ -17,5 +17,6 @@
 
 def get(r, x):
     from math import sin
-    return sin(float(x.get(r)))
+    vx = x.get(r)
+    return sin(float(0 if vx is None else vx))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/split.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, sep, s):
-    return tuple(s.get(r).split(sep.get(r)))
+    vsep = sep.get(r)
+    vs = s.get(r)
+    return tuple(('' if vs is None else str(vs)).split('' if vsep is None else str(vsep)))
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/subtract.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,7 @@
 #  under the License.
 
 def get(r, a, b):
-    return float(a.get(r)) - float(b.get(r))
+    va = a.get(r)
+    vb = b.get(r)
+    return float(0 if va is None else va) - float(0 if vb is None else vb)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/sum_.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,6 @@
 #  under the License.
 
 def get(r, l):
-    return sum(l.get(r))
+    vl = l.get(r)
+    return sum(() if vl is None else vl)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/uppercase.py Fri Aug  5 16:24:12 2011
@@ -16,5 +16,6 @@
 #  under the License.
 
 def get(r, s):
-    return s.get(r).upper()
+    vs = s.get(r)
+    return ('' if vs is None else str(vs)).upper()
 

Modified: incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/nuvem/url.py Fri Aug  5 16:24:12 2011
@@ -37,5 +37,6 @@ def get(r, address, args):
     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 address.get(r) + '/'.join(la) + ('?' if len(ka) != 0 else '') + '&'.join(ka)
+    va = address.get(r)
+    return ('' if va is None else str(va)) + '/'.join(la) + ('?' if len(ka) != 0 else '')
+ '&'.join(ka)
 

Modified: incubator/nuvem/trunk/nuvem-parallel/test.py
URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/nuvem-parallel/test.py?rev=1154294&r1=1154293&r2=1154294&view=diff
==============================================================================
--- incubator/nuvem/trunk/nuvem-parallel/test.py (original)
+++ incubator/nuvem/trunk/nuvem-parallel/test.py Fri Aug  5 16:24:12 2011
@@ -31,7 +31,9 @@ from nuvem import comment
 from nuvem import name
 from nuvem import nothing
 from nuvem import item
+from nuvem import single
 from nuvem import pair
+from nuvem import triple
 from nuvem import call
 from nuvem import if_
 from nuvem import and_
@@ -64,9 +66,13 @@ from nuvem import subtract
 from nuvem import multiply
 from nuvem import divide
 from nuvem import random_
+from nuvem import randoms
 from nuvem import sin_
 from nuvem import cos_
 from nuvem import round_
+from nuvem import floor_
+from nuvem import ceil_
+from nuvem import mod
 from nuvem import sum_
 from nuvem import min_
 from nuvem import max_
@@ -89,11 +95,17 @@ from nuvem import format_
 from nuvem import parse
 from nuvem import htattrs
 from nuvem import htimg
+from nuvem import htinline
 from nuvem import htlink
 from nuvem import htbutton
 from nuvem import htcheck
 from nuvem import htstyle
 from nuvem import pixels
+from nuvem import left
+from nuvem import top
+from nuvem import transform
+from nuvem import transition
+from nuvem import frames
 from nuvem import eval_
 from nuvem import exec_
 
@@ -128,7 +140,9 @@ def testLogic():
     return True
 
 def testLists():
+    assert single.get((), mkref('x', lambda r: 'abc')) == ('abc',)
     assert pair.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'def')) == ('abc',
'def')
+    assert triple.get((), mkref('a', lambda r: 'abc'), mkref('b', lambda r: 'def'), mkref('c',
lambda r: 'ghi')) == ('abc', 'def', 'ghi')
     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')
@@ -142,6 +156,8 @@ def testLists():
     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 append.get((), mkref('l', lambda r: 'abc'), mkref('b', lambda r: ('def', 'ghi')))
== ('abc', 'def', 'ghi')
+    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 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')
@@ -172,13 +188,26 @@ 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
+    r1 = random_.get((), mkref('m', lambda r: 2))
+    assert r1 >= 0 and r1 <= 2
+    r2 = random_.get((), mkref('m', lambda r: 2))
+    assert r2 >= 0 and r2 <= 2 and r2 != r1
+    r3 = random_.get((), mkref('m', lambda r: ('a', 'b')))
+    assert r3 == 'a' or r3 == 'b'
+    r4 = randoms.get((), mkref('n', lambda r: 5.0), mkref('m', lambda r: 2))
+    assert len(r4) == 5
+    assert r4[0] >= 0 and r4[0] <= 2
+    assert r4[1] >= 0 and r4[1] <= 2 and r4[1] != r4[0]
+    r5 = randoms.get((), mkref('n', lambda r: 5.0), mkref('m', lambda r: ('a', 'b')))
+    assert len(r5) == 5
+    assert r5[0] == 'a' or r5[0] == 'b'
+    assert r5[1] == 'a' or r5[1] == 'b'
     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 floor_.get((), mkref('x', lambda r: 2.336)) == 2.0
+    assert ceil_.get((), mkref('x', lambda r: 2.336)) == 3.0
+    assert mod.get((), mkref('n', lambda r: 10), mkref('x', lambda r: 12)) == 2.0
     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
@@ -217,6 +246,7 @@ def testAnimation():
     assert htimg.get((), mkref('value', lambda r: ('i1', 'http://abc.png'))) == '<SPAN
id="i1" class="img"><IMG src="http://abc.png"/></SPAN>'
     assert htimg.get((), mkref('value', lambda r: ("'htattrs", (("'id", 'i1'), ("'src", 'http://abc.png'),
("'x", 'X'))))) == '<SPAN id="i1" class="img"><IMG src="http://abc.png" x="X"/></SPAN>'
     assert htimg.get((), mkref('value', lambda r: (("'htattrs", (("'id", 'i1'), ("'src",
'http://abc.png'), ("'x", 'X'))),))) == '<SPAN id="i1" class="img"><IMG src="http://abc.png"
x="X"/></SPAN>'
+    assert htinline.get((), mkref('value', lambda r: ('image/png', ('a', 'b')))) == 'data:image/png;base64,YWI=\n'
     assert htlink.get((), mkref('value', lambda r: ('http://abc'))) == '<SPAN id="http://abc"
class="link"><A href="http://abc"><SPAN>http://abc</SPAN></A></SPAN>'
     assert htlink.get((), mkref('value', lambda r: ('http://abc', 'abc'))) == '<SPAN id="http://abc"
class="link"><A href="http://abc"><SPAN>abc</SPAN></A></SPAN>'
     assert htlink.get((), mkref('value', lambda r: ('h1', 'http://abc', 'abc'))) == '<SPAN
id="h1" class="link"><A href="http://abc"><SPAN>abc</SPAN></A></SPAN>'
@@ -230,9 +260,15 @@ def testAnimation():
     assert htcheck.get((), mkref('value', lambda r: ('c1', 'abc'))) == '<SPAN id="c1"
class="checkbox"><INPUT type="checkbox" value="abc"/><SPAN>abc</SPAN></SPAN>'
     assert htcheck.get((), mkref('value', lambda r: ("'htattrs", (("'id", 'c1'), ("'value",
'abc'), ("'x", 'X'))))) == '<SPAN id="c1" class="checkbox"><INPUT type="checkbox"
value="abc" x="X"/><SPAN>abc</SPAN></SPAN>'
     assert htcheck.get((), mkref('value', lambda r: (("'htattrs", (("'id", 'c1'), ("'value",
'abc'), ("'x", 'X'))),))) == '<SPAN id="c1" class="checkbox"><INPUT type="checkbox"
value="abc" x="X"/><SPAN>abc</SPAN></SPAN>'
-    assert htstyle.get((), mkref('value', lambda r: (("'width", '320px'), ("'height", '460px'))))
== ("'style", 'width: 320px; height: 460px;')
-    assert htstyle.get((), mkref('value', lambda r: ('width: 320px;', ("'height", '460px'))))
== ("'style", 'width: 320px; height: 460px;')
-    assert pixels.get((), mkref('value', lambda r: 320.0)) == '320px'
+    assert htstyle.get((), mkref('value', lambda r: (("'width", '320px'), ("'height", '460px'))))
== ("'htstyle", 'width: 320px; height: 460px;')
+    assert htstyle.get((), mkref('value', lambda r: ('width: 320px', ("'height", '460px'))))
== ("'htstyle", 'width: 320px; height: 460px;')
+    assert pixels.get((), mkref('value', lambda r: 320.1)) == '320px'
+    assert left.get((), mkref('value', lambda r: 320.1)) == 'left: 320px'
+    assert top.get((), mkref('value', lambda r: 320.1)) == 'top: 320px'
+    assert transform.get((), mkref('x', lambda r: 320.1), mkref('y', lambda r: 480.2), mkref('d',
lambda r: 90.3)) == 'position: absolute; -webkit-transform: translate3d(320px,480px,0px) rotate(90deg);
-moz-transform: translate(320px,480px) rotate(90deg); -ms-transform: translate(320px,480px)
rotate(90deg); transform: translate(320px,480px) rotate(90deg)'
+    assert transition.get((), mkref('value', lambda r: 320.1)) == '-webkit-transition: all
0.3201s'
+    kf = ((0, ('left: 0px', 'top: 0px')), (50, ('left: 10px', 'top: 10px')), (100, (("'left",
'20px'), 'top: 20px')))
+    assert frames.get((), mkref('msec', lambda r: 2000), mkref('loop', lambda r: True), mkref('content',
lambda r: kf)) == 'position: absolute; -webkit-animation: {id} 2s ease 0 infinite normal;
-moz-animation: {id} 2s ease 0 infinite normal; <style> @-webkit-keyframes {id} { 0%
{ left: 0px; top: 0px; } 50% { left: 10px; top: 10px; } 100% { left: 20px; top: 20px; } }
@-moz-keyframes {id} { 0% { left: 0px; top: 0px; } 50% { left: 10px; top: 10px; } 100% { left:
20px; top: 20px; } } </style>'
     return True
 
 def testEval():



Mime
View raw message