diff -r 2266d6d73de3 -r d67cc4fbc3f1 mod_bt.py --- a/mod_bt.py Sun Nov 09 19:59:10 2014 +0200 +++ b/mod_bt.py Mon Nov 10 02:06:06 2014 +0200 @@ -19,53 +19,8 @@ ] } -def get_ticket_data (bot, replyto, ticket, withlink): - if suds_active == False: - return - - data = {} - try: - data = bt_getissue (ticket) - except Exception, e: - bot.privmsg (replyto, "Failed to get info for issue %s: %s" % (ticket, `e`)) - - if data: - if data['view_state']['name'] == 'private': - allowprivate = False - - for channel in bot.channels: - if channel.get_value ('name') == replyto and channel.get_value ('btprivate', False): - allowprivate = True - break - #fi - #done - - if not allowprivate: - bot.privmsg (replyto, 'Error: ticket %s is private' % ticket) - return - #fi - #fi - - bot.privmsg (replyto, "Issue %s: %s: Reporter: %s, assigned to: %s, status: %s (%s)" % \ - (ticket, \ - data.summary, \ - data.reporter.name if hasattr (data.reporter, 'name') else "", \ - data.handler.name if hasattr (data, 'handler') else "nobody", \ - data.status.name, \ - data.resolution.name)) - - if withlink: - bot.privmsg (replyto, "Read all about it here: " + bot.get_ticket_url (ticket)) - #fi - #fi -#enddef - -def cmd_ticket (bot, args, **rest): +def cmd_ticket (bot, args, replyto, **rest): Bt.get_ticket_data (bot, replyto, args['ticket'], True) -def cmd_testannounce (bot, args, **rest); -elif command == 'testannounce': - check_admin (sender, ident, host, command) - if len(args) != 1: - raise logical_exception ("usage: .%s " % command) - self.announce_ticket (bt_getissue (args[0])) \ No newline at end of file +def cmd_testannounce (bot, args, **rest): + Bt.announce_new_issue (bot, Bt.get_issue (args['ticket'])) \ No newline at end of file