def set_repo(): repo_url = request.args.get('url') if repo_url is None: return jsonify(status=status.bad_request, message="URL not requested", payload=[]) repo = stats.set_repo_impl(repo_url) if repo.bare: return jsonify(status=status.clone_failed, message="Clone Failed", payload=[]) return jsonify(status=status.clone_success, message='OK', payload=[])
def main(): repo = stats.set_repo_impl(input('.git URL: ')) assert not repo.bare print('commit message word frequency:') print(stats.messages_words_impl(repo)) print('commit loc:') print(stats.commit_lengths_impl(repo)) print('contributions per day:') print(stats.contributions_daily_impl(repo)) print('contributions per author') print(stats.contributions_authors_impl(repo)) print('commits per hour of the day') print(stats.commit_times_impl(repo)) print('commit emotions:') print(stats.messages_emotions_impl(repo))
def messages_emotions(): repo = request.args.get('url') return jsonify(status=status.request_success, message='OK', payload=stats.messages_emotions_impl( stats.set_repo_impl(repo)))
def commit_times(): repo = request.args.get('url') return jsonify(status=status.request_success, message='OK', payload=stats.commit_times_impl( stats.set_repo_impl(repo)))
def contributions_authors(): repo = request.args.get('url') return jsonify(status=status.request_success, message='OK', payload=stats.contributions_authors_impl( stats.set_repo_impl(repo)))
def delete_repo(): repo = request.args.get('url') delete_repo_impl(stats.set_repo_impl(repo)) return jsonify(status=status.request_success, message='OK', payload=[])