Add alert function to js module

master
unknown 2013-04-30 03:48:44 -03:00
parent 2909a53756
commit 1650c0da18
1 changed files with 3 additions and 3 deletions

View File

@ -161,14 +161,14 @@ class JsObject(object):
write('%s.%s = %s' % (self._id, attr, json.dumps(value))) write('%s.%s = %s' % (self._id, attr, json.dumps(value)))
self._js[attr] = value self._js[attr] = value
def alert(msg):
write(client.alert(msg))
def load(filename, klass=JsObject): def load(filename, klass=JsObject):
return klass(**json.load(open(filename))) return klass(**json.load(open(filename)))
cli = client = JsClient() cli = client = JsClient()
def call(self, *args):
print('call')
if __name__ == '__main__': if __name__ == '__main__':
class MyManager(JsManager): class MyManager(JsManager):
def write(self, code): def write(self, code):