Merge lp:~jelmer/launchpad/remove-archiveuploader-utils into lp:launchpad

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 11454
Proposed branch: lp:~jelmer/launchpad/remove-archiveuploader-utils
Merge into: lp:launchpad
Diff against target: 79 lines (+0/-59)
2 files modified
lib/lp/archiveuploader/tests/test_utils.py (+0/-11)
lib/lp/archiveuploader/utils.py (+0/-48)
To merge this branch: bzr merge lp:~jelmer/launchpad/remove-archiveuploader-utils
Reviewer Review Type Date Requested Status
Michael Nelson (community) code Approve
Review via email: mp+33764@code.launchpad.net

Commit message

Remove lp.archiveuploader.utils.build_file_list.

Description of the change

build_file_list() in lp.archiveuploader.utils is not used anywhere except its own test. This branch removes it.

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Nice and easy :)

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/archiveuploader/tests/test_utils.py'
2--- lib/lp/archiveuploader/tests/test_utils.py 2010-08-20 20:31:18 +0000
3+++ lib/lp/archiveuploader/tests/test_utils.py 2010-08-26 12:51:50 +0000
4@@ -124,17 +124,6 @@
5 self.assertEquals(sect, "libs")
6 self.assertEquals(comp, "restricted")
7
8- def testBuildFileListFromChanges(self):
9- """lp.archiveuploader.utils.build_file_list should be capable of
10- reading changes files
11- """
12- from lp.archiveuploader.utils import build_file_list
13- from lp.archiveuploader.tagfiles import parse_tagfile
14-
15- ch = parse_tagfile(datadir("good-signed-changes"))
16- fl = build_file_list(ch)
17- self.assertEquals("abiword_2.0.10-1.2_mips.deb" in fl, True)
18-
19 def testFixMaintainerOkay(self):
20 """lp.archiveuploader.utils.fix_maintainer should parse correct values
21 """
22
23=== modified file 'lib/lp/archiveuploader/utils.py'
24--- lib/lp/archiveuploader/utils.py 2010-08-20 20:31:18 +0000
25+++ lib/lp/archiveuploader/utils.py 2010-08-26 12:51:50 +0000
26@@ -133,54 +133,6 @@
27 return (section, component)
28
29
30-def build_file_list(tagfile, is_dsc = False, default_component="main"):
31- files = {}
32-
33- if "files" not in tagfile:
34- raise ValueError("No Files section in supplied tagfile")
35-
36- format = tagfile["format"]
37-
38- format = float(format)
39-
40- if not is_dsc and (format < 1.5 or format > 2.0):
41- raise ValueError("Unsupported format '%s'" % tagfile["format"])
42-
43- for line in tagfile["files"].split("\n"):
44- if not line:
45- break
46-
47- tokens = line.split()
48-
49- section = priority = ""
50-
51- try:
52- if is_dsc:
53- (md5, size, name) = tokens
54- else:
55- (md5, size, section, priority, name) = tokens
56- except ValueError:
57- raise TagFileParseError(line)
58-
59- if section == "":
60- section = "-"
61- if priority == "":
62- priority = "-"
63-
64- (section, component) = extract_component_from_section(
65- section, default_component)
66-
67- files[name] = {
68- "md5sum": md5,
69- "size": size,
70- "section": section,
71- "priority": priority,
72- "component": component,
73- }
74-
75- return files
76-
77-
78 def force_to_utf8(s):
79 """Forces a string to UTF-8.
80