A rule line is a single "Allow:" (allowance==True) or "Disallow:" (allowance==False) followed by a path.
| 229 | return '\n\n'.join(map(str, entries)) |
| 230 | |
| 231 | class RuleLine: |
| 232 | """A rule line is a single "Allow:" (allowance==True) or "Disallow:" |
| 233 | (allowance==False) followed by a path.""" |
| 234 | def __init__(self, path, allowance): |
| 235 | if path == '' and not allowance: |
| 236 | # an empty value means allow all |
| 237 | allowance = True |
| 238 | self.path = normalize_path(path) |
| 239 | self.allowance = allowance |
| 240 | |
| 241 | def applies_to(self, filename): |
| 242 | return self.path == "*" or filename.startswith(self.path) |
| 243 | |
| 244 | def __str__(self): |
| 245 | return ("Allow" if self.allowance else "Disallow") + ": " + self.path |
| 246 | |
| 247 | |
| 248 | class Entry: |
no outgoing calls
no test coverage detected
searching dependent graphs…