Add alert function to js module
parent
2909a53756
commit
1650c0da18
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue