mod_bt.py

changeset 141
506e951fd338
parent 138
d0184734320e
child 146
c17b82b1f573
equal deleted inserted replaced
140:631451eecefc 141:506e951fd338
49 'name': 'checkbt', 49 'name': 'checkbt',
50 'description': 'Polls the bug tracker for new tickets', 50 'description': 'Polls the bug tracker for new tickets',
51 'args': None, 51 'args': None,
52 'level': 'admin', 52 'level': 'admin',
53 }, 53 },
54
55 {
56 'name': 'btsoap',
57 'description': 'Sends a custom SOAP query',
58 'args': '<func> [args...]',
59 'level': 'admin',
60 },
54 ] 61 ]
55 } 62 }
56 63
57 def cmd_ticket (bot, args, replyto, **rest): 64 def cmd_ticket (bot, args, replyto, **rest):
58 Bt.get_ticket_data (bot, replyto, args['ticket'], True) 65 Bt.get_ticket_data (bot, replyto, args['ticket'], True)
60 def cmd_testannounce (bot, args, **rest): 67 def cmd_testannounce (bot, args, **rest):
61 Bt.announce_new_issue (bot, Bt.get_issue (args['ticket'])) 68 Bt.announce_new_issue (bot, Bt.get_issue (args['ticket']))
62 69
63 def cmd_checkbt (bot, **rest): 70 def cmd_checkbt (bot, **rest):
64 Bt.poll() 71 Bt.poll()
72
73 def cmd_btsoap (bot, args, reply, **rest):
74 result = Bt.custom_query (args['func'], args['args'].split (' ') if 'args' in args else [])
75
76 for line in result.splitlines():
77 reply (line)

mercurial