Extending Pythons os.walk-Funktion auf dem FTP-Server

ie kann ich @ machos.walk den Verzeichnisbaum einer FTP-Datenbank (auf einem Remote-Server) durchlaufen? Die Art und Weise, wie der Code jetzt strukturiert ist, ist (Kommentare zur Verfügung gestellt):

import fnmatch, os, ftplib

def find(pattern, startdir=os.curdir): #find function taking variables for both desired file and the starting directory
    for (thisDir, subsHere, filesHere) in os.walk(startdir): #each of the variables change as the directory tree is walked
        for name in subsHere + filesHere: #going through all of the files and subdirectories
            if fnmatch.fnmatch(name, pattern): #if the name of one of the files or subs is the same as the inputted name
                fullpath = os.path.join(thisDir, name) #fullpath equals the concatenation of the directory and the name
                yield fullpath #return fullpath but anew each time

def findlist(pattern, startdir = os.curdir, dosort=False):
    matches = list(find(pattern, startdir)) #find with arguments pattern and startdir put into a list data structure
    if dosort: matches.sort() #isn't dosort automatically False? Is this statement any different from the same thing but with a line in between
    return matches

#def ftp(
#specifying where to search.

if __name__ == '__main__':
    import sys
    namepattern, startdir = sys.argv[1], sys.argv[2]
    for name in find(namepattern, startdir): print (name)

Ich denke, ich muss eine neue Funktion definieren (d. H.def ftp()), um diese Funktionalität zum obigen Code hinzuzufügen. Ich fürchte jedoch, dass dasos.walkie @ -Funktion durchsucht standardmäßig nur die Verzeichnisbäume des Computers, auf dem der Code ausgeführt wird.

Gibt es eine Möglichkeit, die Funktionalität von @ zu erweiteros.walk um einen entfernten Verzeichnisbaum (über FTP) durchlaufen zu können?