Merge lp:~dooferlad/linaro-license-protection/bigdir into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by James Tunnicliffe
Status: Merged
Approved by: Milo Casagrande
Approved revision: 194
Merged at revision: 194
Proposed branch: lp:~dooferlad/linaro-license-protection/bigdir
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 42 lines (+16/-3)
2 files modified
HACKING (+2/-0)
license_protected_downloads/buildinfo.py (+14/-3)
To merge this branch: bzr merge lp:~dooferlad/linaro-license-protection/bigdir
Reviewer Review Type Date Requested Status
Milo Casagrande (community) Approve
Review via email: mp+166254@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Milo Casagrande (milo) wrote :

Looks great!
Thanks for working on this!
+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'HACKING'
2--- HACKING 2013-03-12 14:59:02 +0000
3+++ HACKING 2013-05-29 13:42:29 +0000
4@@ -10,6 +10,8 @@
5 * python-mock
6 * python-subunit
7 * testrepository (>=0.0.6)
8+ * python-django-openid-auth
9+ * python-textile
10
11 Code structure
12 --------------
13
14=== modified file 'license_protected_downloads/buildinfo.py'
15--- license_protected_downloads/buildinfo.py 2013-05-08 12:10:58 +0000
16+++ license_protected_downloads/buildinfo.py 2013-05-29 13:42:29 +0000
17@@ -57,11 +57,22 @@
18
19 def getInfoForFile(self):
20 for block in self.build_info_array:
21+
22+ if self.fname in block:
23+ # File name matches a key directly - don't need to iterate
24+ # through each using fnmatch to implement globs.
25+ return block[self.fname]
26+
27+ if self.full_file_name == self.search_path:
28+ # Searching for directory match. This will only match the "*"
29+ # glob.
30+ if "*" in block:
31+ return block["*"]
32+ else:
33+ return [{}]
34+
35 for key in block:
36 if key != "format-version":
37- # Special handling of entire-directory access specifier
38- if key == "*" and os.path.isdir(self.full_file_name):
39- return block[key]
40 if fnmatch.fnmatch(self.full_file_name,
41 os.path.join(self.search_path, key)):
42 return block[key]

Subscribers

People subscribed via source and target branches