[Frugalware-darcs] darcs-hooks: the list of enabled plugins is now a config variable

VMiklos vmiklos at frugalware.org
Thu Jun 7 19:44:11 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=darcs-hooks;a=darcs_commitdiff;h=20070607171644-e2957-8a267719d15f02553dd45fa17cafb82b5930a550.gz;

[the list of enabled plugins is now a config variable
VMiklos <vmiklos at frugalware.org>**20070607171644] {
addfile ./config.py
hunk ./config.py 1
+#!/usr/bin/env python
+
+class config:
+	enabled_plugins = ['cia', 'sendmail']
hunk ./darcs-hooks.py 57
-	from sendmail.sendmail import config
-	from sendmail.sendmail import callback
-	hook = Hook(config.dir, config.latestfile, callback)
+	from config import config
+	for i in config.enabled_plugins:
+		s = "%s.%s" % (i, i)
+		plugin = __import__(s)
+		for j in s.split(".")[1:]:
+			plugin = getattr(plugin, j)
+		hook = Hook(plugin.config.dir, plugin.config.latestfile, plugin.callback)
}


More information about the Frugalware-darcs mailing list