[Pkg-debile-commits] [debile-slave] 35/100: foo

Sylvestre Ledru sylvestre at alioth.debian.org
Mon Aug 19 14:53:04 UTC 2013


This is an automated email from the git hooks/post-receive script.

sylvestre pushed a commit to branch master
in repository debile-slave.

commit 2b52a942fa4c1930f4bfe78cdf2fe816806dad22
Author: Paul Tagliamonte <tag at pault.ag>
Date:   Tue May 28 22:55:53 2013 -0400

    foo
---
 ethel/commands/__init__.py |   11 +++++++++++
 ethel/commands/build.py    |    5 +++++
 ethel/daemon.py            |   43 +++++++++++++++++++++++++++++++++++++++++++
 ethel/runners/sbuild.py    |    4 ----
 4 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/ethel/commands/__init__.py b/ethel/commands/__init__.py
new file mode 100644
index 0000000..5370a65
--- /dev/null
+++ b/ethel/commands/__init__.py
@@ -0,0 +1,11 @@
+import importlib
+
+PLUGINS = {
+    "build": "ethel.commands.build"
+}
+
+
+def load_module(what):
+    path = PLUGINS[what]
+    mod = importlib.import_module(path)
+    return mod.run
diff --git a/ethel/commands/build.py b/ethel/commands/build.py
new file mode 100644
index 0000000..aff8adc
--- /dev/null
+++ b/ethel/commands/build.py
@@ -0,0 +1,5 @@
+
+
+
+def run(package, job):
+    print(package, job)
diff --git a/ethel/daemon.py b/ethel/daemon.py
new file mode 100644
index 0000000..47d2a49
--- /dev/null
+++ b/ethel/daemon.py
@@ -0,0 +1,43 @@
+from ethel.commands import PLUGINS, load_module
+from ethel.client import get_proxy, checkout
+from ethel.config import load
+from ethel.utils import tdir, cd
+
+config = load()
+proxy = get_proxy()
+
+
+class IDidNothingError(Exception):
+    pass
+
+
+def listize(entry):
+    items = [x.strip() for x in entry.split(",")]
+    return [None if x == "null" else x for x in items]
+
+
+def iterate():
+    suites = listize(config['suites'])
+    arches = listize(config['arches'])
+    job = proxy.get_next_job(suites, arches, list(PLUGINS.keys()))
+    if job is None:
+        raise IDidNothingError("No more jobs")
+    package_id = job['package']
+    type_ = job['package_type']
+
+    package = None
+    if type_ == 'binary':
+        package = proxy.get_binary_package(package_id)
+    elif type_ == 'source':
+        package = proxy.get_source_package(package_id)
+    else:
+        raise IDidNothingError("SHIT")
+
+    handler = load_module(job['type'])
+    with tdir() as fd:
+        with cd(fd):
+            checkout(package)
+            handler(package, job)
+
+
+iterate()
diff --git a/ethel/runners/sbuild.py b/ethel/runners/sbuild.py
index b81ce90..3c59f44 100644
--- a/ethel/runners/sbuild.py
+++ b/ethel/runners/sbuild.py
@@ -81,7 +81,3 @@ def sbuild(package, dist, arch):
     info = parse_sbuild_log(out, sut=sut)
 
     return ftbfs, out, info
-
-
-def main():
-    sbuild(*sys.argv[1:])

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-debile/debile-slave.git



More information about the Pkg-debile-commits mailing list