[Frugalware-darcs] darcs-hooks: moved the config classes of the plugins to separate files

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=20070607172222-e2957-ad8f6026ec02b03527671e2877929b4a65e4d20e.gz;

[moved the config classes of the plugins to separate files
VMiklos <vmiklos at frugalware.org>**20070607172222] {
addfile ./cia/__init__.py
hunk ./cia/cia.py 5
+from config import config
hunk ./cia/cia.py 10
-class config:
-	dir = os.path.join("_darcs", "third-party", "cia")
-	latestfile = "latest"
-	project = "Frugalware"
-	# just set this to None if you don't need this
-	darcsweb_url = "http://darcs.frugalware.org/darcsweb/darcsweb.cgi"
-	rpc_uri = "http://cia.vc"
-	# if false, then the mail will be printed to stdout and no xml-rpc post
-	# will be performed
-	post = False
-
addfile ./cia/config.py
hunk ./cia/config.py 1
+#!/usr/bin/env python
+
+import os
+
+class config:
+	dir = os.path.join("_darcs", "third-party", "cia")
+	latestfile = "latest"
+	project = "Frugalware"
+	# just set this to None if you don't need this
+	darcsweb_url = "http://darcs.frugalware.org/darcsweb/darcsweb.cgi"
+	rpc_uri = "http://cia.vc"
+	# if false, then the mail will be printed to stdout and no xml-rpc post
+	# will be performed
+	post = False
hunk ./darcs-hooks.py 57
-	from config import config
-	for i in config.enabled_plugins:
+	from config import config as myconfig
+	for i in myconfig.enabled_plugins:
hunk ./darcs-hooks.py 63
-		hook = Hook(plugin.config.dir, plugin.config.latestfile, plugin.callback)
+		s = "%s.config" % i
+		config = __import__(s)
+		for j in s.split(".")[1:]:
+			config = getattr(config, j)
+		hook = Hook(config.config.dir, config.config.latestfile, plugin.callback)
addfile ./sendmail/__init__.py
addfile ./sendmail/config.py
hunk ./sendmail/config.py 1
+#!/usr/bin/env python
+
+import os
+
+class config:
+	dir = os.path.join("_darcs", "third-party", "email")
+	latestfile = "latest"
+	dest = "vmiklos at frugalware.org"
+	# just set this to None if you don't need this
+	darcsweb_url = "http://darcs.frugalware.org/darcsweb/darcsweb.cgi"
+	# if false, then the mail will be printed to stdout and no mail will be
+	# sent
+	send = False
hunk ./sendmail/sendmail.py 6
-
-class config:
-	dir = os.path.join("_darcs", "third-party", "email")
-	latestfile = "latest"
-	dest = "vmiklos at frugalware.org"
-	# just set this to None if you don't need this
-	darcsweb_url = "http://darcs.frugalware.org/darcsweb/darcsweb.cgi"
-	# if false, then the mail will be printed to stdout and no mail will be
-	# sent
-	send = False
+from config import config
}


More information about the Frugalware-darcs mailing list