l.c.s.BlacklistPolicy(BranchOpenPolicy) : class documentation

Part of lp.codehosting.safe_open View In Hierarchy

Known subclasses: lp.codehosting.safe_open.AcceptAnythingPolicy

Branch policy that forbids certain URLs.
Method __init__ Undocumented
Method shouldFollowReferences Whether we traverse references when mirroring.
Method checkOneURL Check the safety of the source URL.
Method transformFallbackLocation See BranchOpenPolicy.transformFallbackLocation.
def __init__(self, should_follow_references, unsafe_urls=None):
Undocumented
def shouldFollowReferences(self):
Whether we traverse references when mirroring.

Subclasses must override this method.

If we encounter a branch reference and this returns false, an error is raised.

ReturnsA boolean to indicate whether to follow a branch reference.
def checkOneURL(self, url):
Check the safety of the source URL.

Subclasses must override this method.

ParametersurlThe source URL to check.
RaisesBadUrlsubclasses are expected to raise this or a subclass when it finds a URL it deems to be unsafe.
def transformFallbackLocation(self, branch, url):
See BranchOpenPolicy.transformFallbackLocation.

This class is not used for testing our smarter stacking features so we just do the simplest thing: return the URL that would be used anyway and don't check it.

API Documentation for Launchpad, generated by pydoctor at 2019-07-09 00:00:06.