<commit_before># vim: set expandtab sw=4 ts=4:
"""
Celery Tasks Queue.

Copyright (C) 2014-2015 <NAME> <<EMAIL>>

This file is part of buildtimetrend/python-service
<https://github.com/buildtimetrend/python-service/>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

import cgi
from celery import Celery
from buildtimetrend import logger
from buildtimetrend.travis import TravisData
from buildtimetrend.keenio import send_build_data_service
from buildtimetrend.service import check_process_parameters

app = Celery('tasks', backend='amqp', broker='amqp://')

def is_worker_enabled():
    """
    Checks if a task queue is configured and a worker is available.
    """
    return False

@app.task(ignore_result=True)
def process_travis_buildlog(repo, build):
    """
    Process Travis CI buildlog.

    Check parameters, load build data from Travis CI,
    process it and send to Keen.io for storage.
    """
    result = check_process_parameters(repo, build)
    if result is not None:
        logger.warning(result)
        return

    travis_data = TravisData(repo, build)

    # retrieve build data using Travis CI API
    message = "Retrieving build #%s data of %s from Travis CI"<commit_msg>fix coding style [skip ci]<commit_after># vim: set expandtab sw=4 ts=4:
"""
Celery Tasks Queue.

Copyright (C) 2014-2015 <NAME>ens <<EMAIL>>

This file is part of buildtimetrend/python-service
<https://github.com/buildtimetrend/python-service/>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

import cgi
from celery import Celery
from buildtimetrend import logger
from buildtimetrend.travis import TravisData
from buildtimetrend.keenio import send_build_data_service
from buildtimetrend.service import check_process_parameters

app = Celery('tasks', backend='amqp', broker='amqp://')

def is_worker_enabled():
    """Check if a task queue is configured and a worker is available."""
    return False

@app.task(ignore_result=True)
def process_travis_buildlog(repo, build):
    """
    Process Travis CI buildlog.

    Check parameters, load build data from Travis CI,
    process it and send to Keen.io for storage.
    """
    result = check_process_parameters(repo, build)
    if result is not None:
        logger.warning(result)
        return

    travis_data = TravisData(repo, build)

    # retrieve build data using Travis CI API
    message = "Retrieving build #%s data of %s from Travis CI"
{'fraction_non_alphanumeric': 0.07120655552415937, 'fraction_numerical': 0.006216445323537723, 'mean_word_length': 4.183016105417277, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1605436', 'n_tokens_mistral': 1017, 'n_tokens_neox': 972, 'n_words': 435}