From 3cc7302e3c09fd0f3e7173f49f4f4690ee32178d Mon Sep 17 00:00:00 2001 From: inpos Date: Thu, 9 Aug 2018 08:57:18 +0300 Subject: [PATCH] cleanup --- orun/examples/cp.py | 3 +-- orun/js.py | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/orun/examples/cp.py b/orun/examples/cp.py index 8a7f149..5ed6de5 100644 --- a/orun/examples/cp.py +++ b/orun/examples/cp.py @@ -1,5 +1,4 @@ -from orun.extjs import * -from orun.extjs import cp +from orun.extjs import js, Ext, cp def ok_click(id_, *args, **kwargs): js.cli << Ext.getCmp(id_).setText('Clicked') diff --git a/orun/js.py b/orun/js.py index c1b6858..d1c6708 100644 --- a/orun/js.py +++ b/orun/js.py @@ -48,8 +48,8 @@ class JsBlock: return self.code class JsFunction(JsBlock): - def __str__(cls): - return 'function () { %s }' % cls.code + def __str__(self): + return 'function () { %s }' % self.code block = JsBlock func = function = JsFunction @@ -69,8 +69,9 @@ class JsManager(object): self.output.append(data) def __str__(self): - s = '\n'.join(output) output = self.output[:] + s = '\n'.join(output) + return s class JsNode(object): @@ -215,4 +216,4 @@ if __name__ == '__main__': client << client.x # test block - print(json.dumps({'click': call}, default=_encoder)) + print(encode({'click': 'call'}))