127 try:
128 try:
129 f = urllib2.urlopen(u)
130 except urllib2.HTTPError, e:
131 if e.code == 404:
132 return False
133 raise e
134 finally:
135 if f:
136 f.close()
137 author_cache[an] = True
138 return True
139
140
141 # Whitespace and comment validation
142
143 badwhite_re = re.compile("(\t)|([ \t]$)|\r", re.MULTILINE)
144 normext_re = re.compile(".*\.(java|c|h|cpp|hpp)$")
145
146 tag_desc_re = re.compile("Added tag [^ ]+ for changeset [0-9a-f]{12}")
147 tag_re = re.compile("tip$|jdk-([1-9]([0-9]*)(\.[0-9]){0,3})\+([0-9]+)$|jdk[4-9](u\d{1,3})?-b\d{2,3}$|hs\d\d(\.\d{1,2})?-b\d\d$")
148
149 def badwhite_what(m):
150 if m.group(1):
151 return "Tab character"
152 if m.group(2):
153 return "Trailing whitespace"
154 return "Carriage return (^M)"
155
156 base_addr_pat = "[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}"
157 addr_pat = ("(" + base_addr_pat + ")"
158 + "|(([-_a-zA-Z0-9][-_ a-zA-Z0-9]+) +<" + base_addr_pat + ">)")
159
160 bug_ident = re.compile("(([A-Z][A-Z0-9]+-)?[0-9]+):")
161 bug_check = re.compile("([0-9]{7}): \S.*$")
162 sum_ident = re.compile("Summary:")
163 sum_check = re.compile("Summary: \S.*")
164 rev_ident = re.compile("Reviewed-by:")
165 rev_check = re.compile("Reviewed-by: (([a-z0-9]+)(, [a-z0-9]+)*$)")
166 con_ident = re.compile("Contributed-by:")
167 con_check = re.compile("Contributed-by: ((" + addr_pat + ")(, (" + addr_pat + "))*)$")
|
127 try:
128 try:
129 f = urllib2.urlopen(u)
130 except urllib2.HTTPError, e:
131 if e.code == 404:
132 return False
133 raise e
134 finally:
135 if f:
136 f.close()
137 author_cache[an] = True
138 return True
139
140
141 # Whitespace and comment validation
142
143 badwhite_re = re.compile("(\t)|([ \t]$)|\r", re.MULTILINE)
144 normext_re = re.compile(".*\.(java|c|h|cpp|hpp)$")
145
146 tag_desc_re = re.compile("Added tag [^ ]+ for changeset [0-9a-f]{12}")
147 tag_re = re.compile("tip$|jdk-([1-9]([0-9]*)(\.[0-9]){0,3})\+([0-9]+)$|jdk[4-9](u\d{1,3})?-b\d{2,3}$|hs\d\d(\.\d{1,2})?-b\d\d$|[1-9]((\.\d{1,3}){0,2})-b\d{2,3}$|[1-9]u(\d{1,3})-b\d{2,3}$")
148
149 def badwhite_what(m):
150 if m.group(1):
151 return "Tab character"
152 if m.group(2):
153 return "Trailing whitespace"
154 return "Carriage return (^M)"
155
156 base_addr_pat = "[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}"
157 addr_pat = ("(" + base_addr_pat + ")"
158 + "|(([-_a-zA-Z0-9][-_ a-zA-Z0-9]+) +<" + base_addr_pat + ">)")
159
160 bug_ident = re.compile("(([A-Z][A-Z0-9]+-)?[0-9]+):")
161 bug_check = re.compile("([0-9]{7}): \S.*$")
162 sum_ident = re.compile("Summary:")
163 sum_check = re.compile("Summary: \S.*")
164 rev_ident = re.compile("Reviewed-by:")
165 rev_check = re.compile("Reviewed-by: (([a-z0-9]+)(, [a-z0-9]+)*$)")
166 con_ident = re.compile("Contributed-by:")
167 con_check = re.compile("Contributed-by: ((" + addr_pat + ")(, (" + addr_pat + "))*)$")
|