Page MenuHome

modules.py
No OneTemporary

File Metadata

Created
Sat, Oct 19, 11:42 AM

modules.py

import logging
from flask import Blueprint, render_template
from pillar.api.utils import jsonify
blueprint = Blueprint('attract', __name__)
log = logging.getLogger(__name__)
@blueprint.route('/')
def index():
return render_template('attract/index.html')
@blueprint.route('/subversion/kick')
def subversion_kick():
from . import subversion
# TODO: each project should have its own SVN server.
svn_server_url = 'svn://localhost/agent327'
log.info('Re-examining SVN server %s', svn_server_url)
client = subversion.obtain(svn_server_url)
# TODO: last_seen_revision should be stored, probably at the project level.
last_seen_revision = 0
observer = subversion.CommitLogObserver(client, last_seen_revision=last_seen_revision)
observer.fetch_and_observe()
return jsonify({
'previous_last_seen_revision': last_seen_revision,
'last_seen_revision': observer.last_seen_revision,
})

Event Timeline