inpos 2018-08-15 11:11:17 +03:00
parent cd9ce87394
commit 025b5f745e
1 changed files with 9 additions and 2 deletions

View File

@ -7,16 +7,23 @@ import cherrypy
THEME = 'gray' THEME = 'gray'
@cherrypy.expose @cherrypy.expose
class ExtJS(object): class ExtJS:
_cp_config = { _cp_config = {
'tools.staticdir.on': True, 'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(os.path.dirname(__file__), 'static/','ext-4.2.1'), 'tools.staticdir.dir': os.path.join(os.path.dirname(__file__), 'static','ext-4.2.1'),
}
@cherrypy.expose
class ExtJSUploadWidget:
_cp_config = {
'tools.staticdir.on': True,
'tools.staticdir.dir': os.path.join(os.path.dirname(__file__), 'static','extjs-upload-widget', 'lib', 'upload'),
} }
class ExtApplication(cp.Application): class ExtApplication(cp.Application):
def __init__(self, title=''): def __init__(self, title=''):
super(ExtApplication, self).__init__(title) super(ExtApplication, self).__init__(title)
self.ext_421 = ExtJS() self.ext_421 = ExtJS()
self.extjs_upload_widget = ExtJSUploadWidget()
def index(self, *args, **kwargs): def index(self, *args, **kwargs):
f = open(os.path.join(os.path.dirname(__file__), 'app.html')).read() f = open(os.path.join(os.path.dirname(__file__), 'app.html')).read()