/usr/share/pyshared/pkginfo/develop.py is in python-pkginfo 0.9.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 15 16 17 18 19 20 21 22 23 24 25 26 | import glob
import os
import sys
import warnings
from pkginfo.distribution import Distribution
class Develop(Distribution):
def __init__(self, path, metadata_version=None):
self.path = os.path.abspath(
os.path.normpath(
os.path.expanduser(path)))
self.metadata_version = metadata_version
self.extractMetadata()
def read(self):
candidates = [self.path]
candidates.extend(glob.glob(os.path.join(self.path, '*.egg-info')))
candidates.extend(glob.glob(os.path.join(self.path, 'EGG-INFO')))
for candidate in candidates:
if os.path.isdir(candidate):
path = os.path.join(candidate, 'PKG-INFO')
if os.path.exists(path):
return open(path).read()
warnings.warn('No PKG-INFO found for path: %s' % self.path)
|