MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/urllib/robotparser.py:234–239  ·  view source on GitHub ↗
(self, path, allowance)

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 1

normalize_pathFunction · 0.85

Tested by

no test coverage detected