This file is indexed.

/usr/lib/python2.7/dist-packages/MLBviewer/mlbHttp.py is in mlbviewer 2015.sf.1-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
41
42
43
44
45
#!/usr/bin/env python

import urllib2, httplib
import StringIO
import gzip
import datetime
from mlbConstants import *

class MLBHttp:

    def __init__(self,accept_gzip=True):
        self.accept_gzip = accept_gzip
        self.opener = urllib2.build_opener()
        self.cache = dict()

    def getUrl(self,url):
        request = urllib2.Request(url)
        if self.accept_gzip:
            request.add_header('Accept-encoding', 'gzip')
        request.add_header('User-agent', USERAGENT)
        if self.cache.has_key(url):
            try:
                request.add_header('If-Modified-Since', self.cache[url]['last-modified'])
            except:
                pass
        else:
            self.cache[url] = dict()
        # for now, let errors drop through to the calling class
        try:
            rsp = self.opener.open(request)
        except urllib2.HTTPError, err:
            if err.code == 304:
                return self.cache[url]['response']
            else:
                raise
        self.cache[url]['last-modified'] = rsp.headers.get('Last-Modified')
        if rsp.headers.get('Content-Encoding') == 'gzip':
            compressedData = rsp.read()
            compressedStream = StringIO.StringIO(compressedData)
            gzipper = gzip.GzipFile(fileobj=compressedStream)
            self.cache[url]['response']= gzipper.read()
        else:
            self.cache[url]['response'] = rsp.read()
        return self.cache[url]['response']