diff --git a/README b/README index df8f7c1..baf7a75 100644 --- a/README +++ b/README @@ -8,29 +8,30 @@ Typical usage often looks like this:: #!/usr/bin/env python # Cherrypy + ExtJS example - from orun.extjs import * - from orun.extjs import cp + from orun.extjs import js, Ext, cp - def ok_click(id, *args, **kwargs): - cli << Ext.getCmp(id).setText('Clicked') - cli << js.client.alert('Server side message') - - def button_click(id, *args, **kwargs): + def ok_click(id_, *args, **kwargs): + js.cli << Ext.getCmp(id_).setText('Clicked') + js.cli << js.client.alert('Server side message') + + def button_click(id_, *args, **kwargs): js.write(""" Ext.getCmp("%s").setText('Clicked'); alert('Server side callback message'); - """ % id) - + """ % id_) + class MyApplication(cp.ExtApplication): def main(self, *args, **kwargs): wnd = Ext.create('widget.window', {'title': 'My Window', 'width': 300, 'height': 250, 'items': [{'xtype': 'button', 'text': 'Click Here', 'handler': button_click}], 'buttons': [ - {'text': 'OK', 'handler': ok_click}, - {'text': 'Close', 'handler': js.function('this.up("window").close();')}]}) + {'text': 'OK', 'handler': js.FuncWithParams(ok_click, {'arg1': 1, 'arg2': 'val2', 'arg3': js.cli.this.id})}, + {'text': 'Close', 'handler': js.function('this.up(\'window\').close()')}]}) wnd.show() wnd.setHeight(200) - + + cp.THEME = 'classic' + app = MyApplication('Orun (ExtJS Application)') app.run() diff --git a/setup.py b/setup.py index 915baaf..7d286a9 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os def package_files(directory): paths = [] - for (path, directories, filenames) in os.walk(directory): + for (path, _, filenames) in os.walk(directory): for filename in filenames: paths.append(os.path.join('..', path, filename)) return paths @@ -13,8 +13,8 @@ extra_files.extend(package_files('extjs/static')) setuptools.setup( name='Orun', - version='0.1.0', - author='Alexandre L. Dias', + version='0.2.0', + author='Alexandre L. Dias, Roman Borodin (inpos@yandex.ru)', author_email='alexandre@katrid.com', packages=setuptools.find_packages(), package_data={'': extra_files},