| OLD | NEW |
| 1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 import traceback | 29 import traceback |
| 30 | 30 |
| 31 from webkitpy.tool.bot.commit_announcer import CommitAnnouncerThread | 31 from webkitpy.tool.bot.commit_announcer import CommitAnnouncerThread |
| 32 from webkitpy.tool.bot.commit_announcer import UPDATE_WAIT_SECONDS | 32 from webkitpy.tool.bot.commit_announcer import UPDATE_WAIT_SECONDS |
| 33 from webkitpy.tool.commands.command import Command | 33 from webkitpy.tool.commands.command import Command |
| 34 | 34 |
| 35 _log = logging.getLogger(__name__) | 35 _log = logging.getLogger(__name__) |
| 36 ANNOUNCE_PATH = "third_party/WebKit" | 36 ANNOUNCE_PATH = "third_party/WebKit" |
| 37 | 37 |
| 38 | 38 |
| 39 | |
| 40 class CommitAnnouncerCommand(Command): | 39 class CommitAnnouncerCommand(Command): |
| 41 name = "commit-announcer" | 40 name = "commit-announcer" |
| 42 help_text = "Start an IRC bot for announcing new git commits." | 41 help_text = "Start an IRC bot for announcing new git commits." |
| 43 show_in_main_help = True | 42 show_in_main_help = True |
| 44 | 43 |
| 45 def __init__(self): | 44 def __init__(self): |
| 46 options = [ | 45 options = [ |
| 47 optparse.make_option("--irc-password", default=None, help="Specify I
RC password to use."), | 46 optparse.make_option("--irc-password", default=None, help="Specify I
RC password to use."), |
| 48 ] | 47 ] |
| 49 super(CommitAnnouncerCommand, self).__init__(options) | 48 super(CommitAnnouncerCommand, self).__init__(options) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 61 except Exception: | 60 except Exception: |
| 62 _log.error("Unexpected error:") | 61 _log.error("Unexpected error:") |
| 63 _log.error(traceback.format_exc()) | 62 _log.error(traceback.format_exc()) |
| 64 | 63 |
| 65 if bot_thread.is_alive(): | 64 if bot_thread.is_alive(): |
| 66 _log.info("Disconnecting bot") | 65 _log.info("Disconnecting bot") |
| 67 bot_thread.stop() | 66 bot_thread.stop() |
| 68 else: | 67 else: |
| 69 _log.info("Bot offline") | 68 _log.info("Bot offline") |
| 70 _log.info("Done") | 69 _log.info("Done") |
| OLD | NEW |