2 # -*- coding: utf-8 -*-
3 ##############################################################################
4 # Copyright (c) 2017 Luke Hinds <lhinds@redhat.com>, Red Hat
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
12 # from __future__ import division, print_function, absolute_import
14 """Anteater - CI Gate Checks.
17 anteater (-p |--project) <project> [(-ps |--patchset) <patchset>]
18 anteater (-p |--project) <project> [--path <project_path>]
19 anteater (-h | --help)
23 -h --help Show this screen.
24 --version Show version.
28 from docopt import docopt
30 from src.patch_scan import prepare_patchset
31 from src.project_scan import prepare_project
32 import utils.anteater_logger as antlog
35 config = ConfigParser.RawConfigParser()
36 config.read('anteater.conf')
37 reports_dir = config.get('config', 'reports_dir')
38 logger = antlog.Logger(__name__).getLogger()
43 """ Creates a directory for scan reports """
45 os.makedirs(reports_dir)
46 logger.info('Creating reports directory: {0}'.format(reports_dir))
48 if not os.path.isdir(reports_dir):
53 """ Main function, mostly for passing arguments """
55 arguments = docopt(__doc__, version=__version__)
57 if arguments['<patchset>']:
58 prepare_patchset(arguments['<project>'], arguments['<patchset>'])
59 elif arguments['<project_path>']:
60 prepare_project(arguments['<project>'], arguments['<project_path>'])
63 if __name__ == "__main__":