/usr/lib/python2.7/dist-packages/pkginfo/index.py is in python-pkginfo 1.2.1-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 | from pkginfo.distribution import Distribution
class Index(dict):
def __setitem__(self, key, value):
if not isinstance(value, Distribution):
raise ValueError('Not a distribution: %r.' % value)
if key != '%s-%s' % (value.name, value.version):
raise ValueError('Key must match <name>-<version>.')
super(Index, self).__setitem__(key, value)
def add(self, distribution):
key = '%s-%s' % (distribution.name, distribution.version)
self[key] = distribution
|