This file is indexed.

/usr/lib/python2.7/dist-packages/bottle_beaker.py is in python-bottle-beaker 0.1.3-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import bottle
import inspect
import beaker
from beaker import middleware


class BeakerPlugin(object):
    name = 'beaker'

    def __init__(self, keyword='beaker'):
        """
        :param keyword: Keyword used to inject beaker in a route
        """
        self.keyword = keyword

    def setup(self, app):
        """ Make sure that other installed plugins don't affect the same
            keyword argument and check if metadata is available."""
        for other in app.plugins:
            if not isinstance(other, BeakerPlugin):
                continue
            if other.keyword == self.keyword:
                raise bottle.PluginError("Found another beaker plugin "
                                         "with conflicting settings ("
                                         "non-unique keyword).")

    def apply(self, callback, context):
        args = inspect.getargspec(context['callback'])[0]

        if self.keyword not in args:
            return callback

        def wrapper(*args, **kwargs):
            kwargs[self.keyword] = beaker
            kwargs["{0}_middleware".format(self.keyword)] = middleware
            return callback(*args, **kwargs)

        return wrapper