diff options
Diffstat (limited to 'license_protected_downloads')
-rw-r--r-- | license_protected_downloads/buildinfo.py | 6 | ||||
-rw-r--r-- | license_protected_downloads/common.py | 5 | ||||
-rw-r--r-- | license_protected_downloads/tests/test_buildinfo.py | 6 |
3 files changed, 4 insertions, 13 deletions
diff --git a/license_protected_downloads/buildinfo.py b/license_protected_downloads/buildinfo.py index 42a789b..19c6f46 100644 --- a/license_protected_downloads/buildinfo.py +++ b/license_protected_downloads/buildinfo.py @@ -15,9 +15,7 @@ class BuildInfoBase(object): "openid-launchpad-teams", ] - def __init__(self, full_name, search_path, content): - self.full_file_name = full_name - self.search_path = search_path + def __init__(self, full_name, content): self.fname = os.path.basename(full_name) self.index = 0 @@ -157,7 +155,7 @@ class BuildInfo(BuildInfoBase): build_info_file = os.path.join(search_path, "BUILD-INFO.txt") with open(build_info_file, "r") as f: - super(BuildInfo, self).__init__(fn, search_path, f.read()) + super(BuildInfo, self).__init__(fn, f.read()) @classmethod def get_search_path(cls, path): diff --git a/license_protected_downloads/common.py b/license_protected_downloads/common.py index 23aff14..e800ec6 100644 --- a/license_protected_downloads/common.py +++ b/license_protected_downloads/common.py @@ -185,10 +185,7 @@ class Artifact(object): def get_build_info(self): buf = self.build_info_buffer if buf: - sp = fn = self.urlbase[1:] - if not self.isdir(): - fn = sp + '/' + self.file_name - return buildinfo.BuildInfoBase(fn, sp, buf) + return buildinfo.BuildInfoBase(self.file_name, buf) def get_listing(self): if self.isdir(): diff --git a/license_protected_downloads/tests/test_buildinfo.py b/license_protected_downloads/tests/test_buildinfo.py index 9ab5738..6b04118 100644 --- a/license_protected_downloads/tests/test_buildinfo.py +++ b/license_protected_downloads/tests/test_buildinfo.py @@ -19,7 +19,7 @@ class BuildInfoBaseTests(unittest.TestCase): def setUp(self): p = os.path.join(THIS_DIRECTORY, "BUILD-INFO.txt") with open(os.path.join(THIS_DIRECTORY, "BUILD-INFO.txt")) as f: - self.build_info = BuildInfoBase(p, os.path.dirname(p), f.read()) + self.build_info = BuildInfoBase(p, f.read()) def test_get_emptyField(self): value = "notempty" @@ -187,8 +187,6 @@ class BuildInfoBaseTests(unittest.TestCase): [{'license-type': 'protected'}, {'license-type': 'protected'}]) def test_getInfoForFile(self): - self.build_info.full_file_name = os.path.join( - self.build_info.search_path, 'foo.pyc') self.build_info.fname = 'foo.pyc' self.build_info.build_info_array = [{}] data = ["Format-Version: 2.0", @@ -205,8 +203,6 @@ class BuildInfoBaseTests(unittest.TestCase): self.assertEquals(self.build_info.file_info_array, [{}]) def test_getInfoForFile_no_block_for_file(self): - self.build_info.full_file_name = os.path.join( - self.build_info.search_path, 'foo.pyc') self.build_info.fname = 'foo.pyc' self.build_info.build_info_array = [{}] data = ["Format-Version: 2.0", |