Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
add model solution
Commit Description:
add model solution
from browser import ajax
from . import error
class FileIO :
def __init__ ( self , data ):
self . _data = data
def read ( self ):
return self . _data
def urlopen ( url , data = None , timeout = None ):
global result
result = None
def on_complete ( req ):
global result
if req . status == 200 :
result = req
_ajax = ajax . ajax ()
_ajax . bind ( 'complete' , on_complete )
if timeout is not None :
_ajax . set_timeout ( timeout )
if data is None :
_ajax . open ( 'GET' , url , False )
_ajax . send ()
else :
_ajax . open ( 'POST' , url , False )
_ajax . send ( data )
if result is not None :
if isinstance ( result . text , str ):
return FileIO ( result . text ) #, url, {'status': result.status}
return FileIO ( result . text ()) #, url, {'status': result.status}
raise error . HTTPError ( 'file not found' )
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