Show More
@@ -56,16 +56,11 b' def ignorepats(lines):' | |||||
56 | return patterns, warnings |
|
56 | return patterns, warnings | |
57 |
|
57 | |||
58 | def readignorefile(filepath, warn): |
|
58 | def readignorefile(filepath, warn): | |
59 | try: |
|
|||
60 | pats = [] |
|
|||
61 |
|
|
59 | fp = open(filepath) | |
62 |
|
|
60 | pats, warnings = ignorepats(fp) | |
63 |
|
|
61 | fp.close() | |
64 |
|
|
62 | for warning in warnings: | |
65 |
|
|
63 | warn("%s: %s\n" % (filepath, warning)) | |
66 | except IOError, inst: |
|
|||
67 | warn(_("skipping unreadable ignore file '%s': %s\n") % |
|
|||
68 | (filepath, inst.strerror)) |
|
|||
69 | return pats |
|
64 | return pats | |
70 |
|
65 | |||
71 | def readpats(root, files, warn): |
|
66 | def readpats(root, files, warn): | |
@@ -75,7 +70,11 b' def readpats(root, files, warn):' | |||||
75 | for f in files: |
|
70 | for f in files: | |
76 | if f in pats: |
|
71 | if f in pats: | |
77 | continue |
|
72 | continue | |
|
73 | try: | |||
78 | pats[f] = readignorefile(f, warn) |
|
74 | pats[f] = readignorefile(f, warn) | |
|
75 | except IOError, inst: | |||
|
76 | warn(_("skipping unreadable ignore file '%s': %s\n") % | |||
|
77 | (f, inst.strerror)) | |||
79 |
|
78 | |||
80 | return [(f, pats[f]) for f in files if f in pats] |
|
79 | return [(f, pats[f]) for f in files if f in pats] | |
81 |
|
80 |
General Comments 0
You need to be logged in to leave comments.
Login now