check if this entry applies to the specified agent
(self, useragent)
| 266 | return '\n'.join(ret) |
| 267 | |
| 268 | def applies_to(self, useragent): |
| 269 | """check if this entry applies to the specified agent""" |
| 270 | # split the name token and make it lower case |
| 271 | useragent = useragent.split("/")[0].lower() |
| 272 | for agent in self.useragents: |
| 273 | if agent == '*': |
| 274 | # we have the catch-all agent |
| 275 | return True |
| 276 | agent = agent.lower() |
| 277 | if agent in useragent: |
| 278 | return True |
| 279 | return False |
| 280 | |
| 281 | def allowance(self, filename): |
| 282 | """Preconditions: |
no test coverage detected