Launch ftp.x.y with an ftp protocol

This commit is contained in:
Iain Lane 2008-09-08 20:21:26 +01:00
parent 6c763fae39
commit fd8ad1bbea
1 changed files with 8 additions and 2 deletions

View File

@ -832,7 +832,13 @@ text/plain
if url: if url:
if url[1] != self.matches['email']: if url[1] != self.matches['email']:
if url[1]: # Assume HTTP if we launch a URL with no protocol, otherwise xdg-open won't open it # Add protocol if we launch a URL without it, otherwise xdg-open won't open it
if url[1] == self.matches['addr_only']:
if url[0][0:3] == "ftp":
# "ftp.foo.bar" -> "ftp://ftp.foo.bar"
address = "ftp://" + url[0]
else:
# Assume http
address = "http://" + url[0] address = "http://" + url[0]
else: else:
address = url[0] address = url[0]