Skip to content

Commit 50a1942

Browse files
zmej-serowwillmcgugan
authored andcommitted
Added geturl() method (#289)
1 parent 9c92da1 commit 50a1942

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

fs/ftpfs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,13 @@ def ftp(self):
453453
"""~ftplib.FTP: the underlying FTP client.
454454
"""
455455
return self._get_ftp()
456+
457+
def geturl(self, path, purpose="download"):
458+
# type: (str, str) -> Text
459+
"""Get FTP url for resource."""
460+
if purpose != "download":
461+
raise errors.NoURL(path, purpose, "No such purpose")
462+
return "{}/{}".format(self.ftp_url, path)
456463

457464
def _get_ftp(self):
458465
# type: () -> FTP

0 commit comments

Comments
 (0)