irker_channels - The irc channels to post announcements to
irker_colours - Settings for using colours in the announcements (ANSI or
mIRC)
+ irker_server - Host for the irkerd server (localhost by default)
+ irker_port - port to connect to (6659 by default)
"""
from bzrlib.config import option_registry
"bzrlib.plugins.bzrirker.irkerhook", "opt_irker_colours")
option_registry.register_lazy("irker_project",
"bzrlib.plugins.bzrirker.irkerhook", "opt_irker_project")
+option_registry.register_lazy("irker_server",
+ "bzrlib.plugins.bzrirker.irkerhook", "opt_irker_server")
+option_registry.register_lazy("irker_port",
+ "bzrlib.plugins.bzrirker.irkerhook", "opt_irker_port")
from bzrlib.hooks import install_lazy_named_hook
# This causes double commit messages - investigate what we need further
import sys
import json
+IRKER_PORT = 6659
+
class IrkerSender(object):
"""An irker message sender."""
"""
self.branch.lock_read()
self.branch.repository.lock_read()
- # These should become configurable at some point
- default_server = 'localhost'
- IRKER_PORT = 6659
+ server = self.config.get('irker_server')
+ if not server:
+ server = 'localhost'
+ port = self.config.get('irker_port')
+ if not port:
+ port = IRKER_PORT
try:
# Do this after we have locked, to make things faster.
self._setup_revision_and_revno()
# of irker's code
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.connect((default_server, IRKER_PORT))
+ sock.connect((server, port))
sock.sendall(message + "\n")
except socket.error, e:
sys.stderr.write("%s\n" % e)
help='Colour option for irker.')
opt_irker_project = Option('irker_project',
help='Project name to use.')
+opt_irker_server = Option('irker_server',
+ help='host for the irkerd server (default localhost).')
+opt_irker_port = Option('irker_port',
+ help='port for the irkerd server (default %d)' % IRKER_PORT)