mirror of
https://github.com/aljazceru/plugins.git
synced 2026-01-11 09:14:21 +01:00
Feedback from GH Review.
1. Fix README.md dynamic plugin example (needs keywords, abspath!) (pointed out by @carnhofdaki). 2. Define magic number we use (suggested by @FreePietje)
This commit is contained in:
@@ -20,8 +20,8 @@ Each of these can be specified more than once:
|
||||
|
||||
## Example Usage
|
||||
|
||||
$ l1-cli plugin start commando.py commando_reader=0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518
|
||||
$ l2-cli plugin start commando.py
|
||||
$ l1-cli plugin subcommand=start plugin=`pwd`/commando.py commando_reader=0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518
|
||||
$ l2-cli plugin start $(pwd)/commando.py
|
||||
$ l2-cli commando 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59 stop
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@ def send_msg(plugin, peer_id, msgtype, idnum, contents):
|
||||
|
||||
|
||||
def send_result(plugin, peer_id, idnum, res):
|
||||
# We can only send 64k in a message.
|
||||
# We can only send 64k in a message, but there is 10 byte overhead
|
||||
# in the message header; 65000 is safe.
|
||||
parts = textwrap.wrap(json.dumps(res), 65000)
|
||||
for p in parts[:-1]:
|
||||
send_msg(plugin, peer_id, COMMANDO_REPLY_CONTINUES, idnum, p)
|
||||
|
||||
Reference in New Issue
Block a user