Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
add model solution
Commit Description:
add model solution
from browser import window
def wrap ( func ):
# Transforms a function f into another function that prints a
# traceback in case of exception
def f ( * args , ** kw ):
try :
return func ( * args , ** kw )
except Exception as exc :
msg = '{0.info} \n {0.__name__}: {0.args[0]}' . format ( exc )
import sys
sys . stderr . write ( msg )
return f
clear_interval = window . clearInterval
clear_timeout = window . clearTimeout
def set_interval ( func , interval ):
return window . setInterval ( wrap ( func ), interval )
def set_timeout ( func , interval ):
return int ( window . setTimeout ( wrap ( func ), interval ))
def request_animation_frame ( func ):
return int ( window . requestAnimationFrame ( func ))
def cancel_animation_frame ( int_id ):
window . cancelAnimationFrame ( int_id )
def set_loop_timeout ( x ):
# set a variable used to stop loops that last more than x seconds
assert isinstance ( x , int )
__BRYTHON__ . loop_timeout = x
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings