@app.route('/api/packages/preload')
def precache_package_detail():

    def generate():
        yield 'running...\t'

        repository = Repository(settings.basedir)
        for ref in repository.dumpreferences():
            ref['deb'] = os.path.join(repository.options.basedir, ref['deb'])
            try:
                (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) = os.stat(ref['deb'])
                ref['stats'] = {'mtime': time.ctime(mtime), 'ctime': time.ctime(ctime), 'user': pwd.getpwuid(uid).pw_gecos, 'size': size}
                cache(settings).write(repository, ref['codename'], ref['component'], ref['arch'], ref['package'], ref['version'], ref)
                yield "</br>"
                yield json.dumps(ref)
            except Exception as e:
                app.logger.warn(e)
                app.logger.warn((ref['package'], ref['version']) % 'unable to write cache for %s %s')

        yield json.dumps({'status': 'OK'})

    return Response(generate())
dataset/ETHPy150Open baseblack/ReproWeb/reproweb/views.py/precache_package_detail/swapped operands of `%`