def getEventsSunk(element):
    """
    Return which events are currently "sunk" for a given DOM node.  See
    sinkEvents() for more information.
    """
    from __pyjamas__ import INT
    return INT(JS("@{{element}}.__eventBits ? @{{element}}.__eventBits : 0"))
 def format(self, num):
     """ cheerfully ignore the number format requested
         and just return the number converted to a string
     """
     # To speedup int when not compiled with --number-classes
     # (or with --strict)
     from __pyjamas__ import INT
     return str(INT(num))
示例#3
0
def hexstr(s):
    h = '0123456789abcdef'
    r = ''
    i = None
    for x in range(16):
        i = INT(JS("s[x]"))
        r = r + h[(i >> 4) & 0xF] + h[i & 0xF]
    return r
示例#4
0
 def __len__(self):
     size=0
     JS("""
     for (var i in self.__object) size++;
     """)
     return INT(size)
示例#5
0
 def __len__(self):
     size = 0
     JS("""
     for (var i in @{{self}}.__object) @{{size}}++;
     """)
     return INT(size)