#
# See the irkerhook manual page in the distribution for a detailed
# explanation of how to configure this hook.
-#
-# Other configuration changes you may want to make are to:
-#
-# urlprefix: the current version should work for viewcvs or gitweb
-# installations, but will require modification for other systems.
-#
-# tinyfier: If your project maintains its own url-shrinking service
# The default location of the irker proxy, if the project configuration
# does not override it.
default_server = "localhost"
IRKER_PORT = 6659
-# The default service used to turn your gitwebbish URL into a tinyurl so it
+# The default service used to turn your web-view URL into a tinyurl so it
# will take up less space on the IRC notification line.
-tinyifier = "http://tinyurl.com/api-create.php?url="
+default_tinyifier = "http://tinyurl.com/api-create.php?url="
# Map magic urlprefix values to actual URL prefixes.
urlprefixmap = {
"cgit": "http://%(host)s/cgi-bin/cgit.cgi/%(repo)s/commit/?id=",
}
+# By default, the channel list includes the freenode #commits list
+default_channels = "irc://chat.freenode.net/%(project)s,irc://chat.freenode.net/#commits"
+
#
# No user-serviceable parts below this line:
#
prefix = extractor.urlprefix % extractor.__dict__
# Try to tinyfy a reference to a web view for this commit.
try:
- url = open(urllib.urlretrieve(tinyifier + prefix + commit)[0]).read()
+ url = open(urllib.urlretrieve(extractor.tinyifier + prefix + commit)[0]).read()
except:
url = prefix + commit
return url
self.tcp = do("git config --bool --get irker.tcp")
self.template = '%(project)s: %(author)s %(repo)s:%(branch)s * %(rev)s / %(files)s: %(logmsg)s %(url)s'
self.urlprefix = do("git config --get irker.urlprefix") or "gitweb"
+ self.tinyifier = default_tinyifier
# This one is git-specific
self.revformat = do("git config --get irker.revformat")
# The project variable defaults to the name of the repository toplevel.
self.rev = "r%s" % self.commit
self.template = '%(project)s: %(author)s %(repo)s * %(rev)s / %(files)s: %(logmsg)s %(url)s'
self.urlprefix = "viewcvs"
+ self.tinyifier = default_tinyifier
load_preferences(self, os.path.join(self.repository, "irker.conf"))
def svnlook(self, info):
return do("svnlook %s %s --revision %s" % (shellquote(info), shellquote(self.repository), shellquote(self.commit)))
print "irkerhook.py: version", version
sys.exit(0)
- # Gather info for repo type discrimination, make globals settable
+ # Gather info for repo type discrimination
for tok in arguments:
- if tok.startswith("tinyfier="):
- tinyfier = tok[9:]
- elif tok.startswith("repository="):
+ if tok.startswith("repository="):
repository = tok[11:]
# Determine the repository type. Default to git unless user has pointed
else:
setattr(extractor, key, val)
- # By default, the channel list includes the freenode #commits list
if not extractor.channels:
- extractor.channels = "irc://chat.freenode.net/%s,irc://chat.freenode.net/#commits" % extractor.project
+ extractor.channels = default_channels % extractor.__dict__
# Other defaults get set here
if not extractor.repo:
extractor.repo = extractor.project.lower()
<term>channels</term>
<listitem>
<para>An IRC channel URL, or comma-separated list of same, identifying
-channels to which notofications are to be sent. If not specified, the
+channels to which notifications are to be sent. If not specified, the
defaults channel list id the freenode #commits channel plus the freenode
channel named by the project variable.</para>
</listitem>
field in commit notifications will be suppressed. Other magic values
are "cgit", "gitweb", and "viewcvs", which expand to URL templates
that will usually work with those systems.</para>
+
+<para>The magic cookies "%(host)s" and %(repo)s" may occur in this
+URL. The former is expanded to the FQDN of the host on which
+<application>irkerhook.py</application> is running; the latter is
+expanded to the value of the "repo" variable.</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>tinyifier</term>
+<listitem>
+<para>URL template pointing to a service for compressing URLs so they
+will take up less space in the notification line.</para>
</listitem>
</varlistentry>
</variablelist>