l.r.s.p.w.WalkerBase : class documentation

Part of lp.registry.scripts.productreleasefinder.walker View In Hierarchy

Known subclasses: lp.registry.scripts.productreleasefinder.walker.FTPWalker, lp.registry.scripts.productreleasefinder.walker.HTTPWalker

Base class for URL walkers.

This class is a base class for those wishing to implement protocol
specific walkers.  Walkers behave much like the scandir.walk() function,
but taking a URL and working remotely.

A typical usage would be:
    for (dirpath, dirnames, filenames) in ProtWalker(url):
        ...

Sub-classes are required to implement the open(), list() and close()
methods.
Method __init__ Undocumented
Method walk Walk through the URL.
Method open Open the FTP connection.
Method close Close the FTP connection.
Method list Return listing of directory.
def __init__(self, base, log_parent=None):
Undocumented
def walk(self):
Walk through the URL.

Yields (dirpath, dirnames, filenames) for each path under the base; dirnames can be modified as with scandir.walk.

def open(self):
Open the FTP connection.

Must be implemented by sub-classes.

def close(self):
Close the FTP connection.

Must be implemented by sub-classes.

def list(self, dir):
Return listing of directory.

Must be implemented by sub-classes to return two lists, one of directory names and one of file names; both underneath the directory given.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.