This file is indexed.

/usr/share/pyshared/configglue/inischema/parsers.py is in python-configglue 1.0-1.

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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
###############################################################################
#
# configglue -- glue for your apps' configuration
#
# A library for simple, DRY configuration of applications
#
# (C) 2009--2011 by Canonical Ltd.
# by John R. Lenton <john.lenton@canonical.com>
# and Ricardo Kirkner <ricardo.kirkner@canonical.com>
#
# Released under the BSD License (see the file LICENSE)
#
# For bug reports, support, and new releases: http://launchpad.net/configglue
#
###############################################################################

"""Parsers used by TypedConfigParser live here
"""


def lines(value):
    """ Split a string on its newlines

    RawConfigParser supports "continuations in the style of RFC822", which
    gives us a very natural way of having values that are lists of strings.

    If value isn't a string, leaves it alone.
    """
    try:
        return value.split('\n')
    except AttributeError:
        return value

_true_values = frozenset(('true', '1', 'on', 'yes'))
_false_values = frozenset(('false', '0', 'off', 'no'))


def bool_parser(value):
    """Take a string representation of a boolean and return its boolosity

    true, 1, on, and yes (in any case) should all be True.
    false, 0, off, and no (in any case) should all be False.

    any other string else should raise an error; None and booleans are
    preserved.
    """
    try:
        value = value.lower()
    except AttributeError:
        return bool(value)
    else:
        if value in _true_values:
            return True
        if value in _false_values:
            return False
    raise ValueError("Unable to determine boolosity of %r" % value)