| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return ('%s %s committed "%s" %s' % (url, email, subject, red_flag_messa
ge)).strip() | 180 return ('%s %s committed "%s" %s' % (url, email, subject, red_flag_messa
ge)).strip() |
| 181 | 181 |
| 182 def _post(self, message): | 182 def _post(self, message): |
| 183 self.connection.execute_delayed(0, lambda: self.connection.privmsg(chann
el, self._sanitize_string(message))) | 183 self.connection.execute_delayed(0, lambda: self.connection.privmsg(chann
el, self._sanitize_string(message))) |
| 184 | 184 |
| 185 def _sanitize_string(self, message): | 185 def _sanitize_string(self, message): |
| 186 return message.encode('ascii', 'backslashreplace') | 186 return message.encode('ascii', 'backslashreplace') |
| 187 | 187 |
| 188 | 188 |
| 189 class CommitAnnouncerThread(threading.Thread): | 189 class CommitAnnouncerThread(threading.Thread): |
| 190 |
| 190 def __init__(self, tool, announce_path, irc_password): | 191 def __init__(self, tool, announce_path, irc_password): |
| 191 threading.Thread.__init__(self) | 192 threading.Thread.__init__(self) |
| 192 self.bot = CommitAnnouncer(tool, announce_path, irc_password) | 193 self.bot = CommitAnnouncer(tool, announce_path, irc_password) |
| 193 | 194 |
| 194 def run(self): | 195 def run(self): |
| 195 self.bot.start() | 196 self.bot.start() |
| 196 | 197 |
| 197 def stop(self): | 198 def stop(self): |
| 198 self.bot.stop() | 199 self.bot.stop() |
| 199 self.join() | 200 self.join() |
| OLD | NEW |