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))
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
def __len__(self): size=0 JS(""" for (var i in self.__object) size++; """) return INT(size)
def __len__(self): size = 0 JS(""" for (var i in @{{self}}.__object) @{{size}}++; """) return INT(size)