12c12 < import urlparse,urllib --- > import urlparse, urllib 62,66c62 < lines = [] < line = f.readline() < while line: < lines.append(line.strip()) < line = f.readline() --- > lines = [ line.strip() for line in f ] 68c64 < if self.errcode == 401 or self.errcode == 403: --- > if self.errcode in (401, 403): 94c90 < linenumber = linenumber + 1 --- > linenumber += 1 96c92 < if state==1: --- > if state == 1: 102c98 < elif state==2: --- > elif state == 2: 108c104 < if i>=0: --- > if i>= 0: 118c114 < if state==2: --- > if state == 2: 127c123 < if state==0: --- > if state == 0: 134c130 < if state==0: --- > if state == 0: 144c140 < if state==2: --- > if state == 2: 188c184 < return self.path=="*" or filename.startswith(self.path) --- > return self.path == "*" or filename.startswith(self.path) 191c187 < return (self.allowance and "Allow" or "Disallow")+": "+self.path --- > return "%s: %s" % ((self.allowance and "Allow" or "Disallow"), self.path) 203c199 < ret = ret + "User-agent: "+agent+"\n" --- > ret = "%sUser-agent: %s\n" % (ret, agent) 205c201 < ret = ret + str(line) + "\n" --- > ret += str(line) + "\n" 213c209 < if agent=='*': --- > if agent == '*': 241c237 < def _check(a,b): --- > def _check(a, b): 246c242 < if a!=b: --- > if a != b: