#!/usr/bin/env python
from atlantic.actions import (aquire, package, finish)
from atlantic.utils import (tmpdir, run)
import time
import sys
import os


while True:
    with tmpdir():
        obj = aquire()
        if 'code' in obj and obj['code'] == 'no-jobs':
            print "No more jobs. Rockn'."
        else:
            job = obj['job']
            typ = job['type']
            if typ == 'lint':
                run(["alint"])
            else:
                run(["abuild"])
    time.sleep(5)
