--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/checker.py Mon Jun 13 09:47:55 2016 +0800
+#!/usr/bin/env python -u
+from __future__ import print_function
+from argparse import ArgumentParser, FileType
+from datetime import datetime
+from shutil import rmtree
+from subprocess import check_call, CalledProcessError
+from tempfile import mkdtemp
+rel = lambda *x: os.path.abspath(os.path.join(os.path.dirname(__file__), *x))
+def print_and_run(args):
+ print('$ ' + ' '.join(args))
+def run_ignore_1(fn, args):
+ except CalledProcessError as e:
+def run(args, silent=False, ignore_1=False):
+ print('# C&O error: {}'.format(e))
+ print('# C&O job failed')
+ return datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S+00:00')
+ print('# C&O job started: {}'.format(now()))
+ tmp = mkdtemp(prefix='candolint.', dir=rel('workdir'))
+ print('# C&O task: clone')
+ print('# C&O project URL: {}'.format(config['url']))
+ if ok and not run(['hg', 'clone', config['url'], source]):
+ print('# C&O task: cleanup')
+ print('# C&O job finished: {}'.format(now()))
+ parser = ArgumentParser()
+ parser.add_argument('config', help='configuration file (YAML)', type=FileType('r'))
+ args = parser.parse_args()
+ config = yaml.safe_load(args.config)
+if __name__ == '__main__':