git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@148
fdd5c36f-1aea-0310-aeeb-
c58d7e2b6c23
import time, urllib
from base64 import b64encode
from urlparse import urljoin
import time, urllib
from base64 import b64encode
from urlparse import urljoin
- if type(msg) == type(""):
+ if isinstance(msg, str):
return msg
else:
s = []
for i in msg:
return msg
else:
s = []
for i in msg:
- s.append("'%s'" % string.join(string.split(str(i), "\n"), "\\n"))
- return "(%s)" % string.join(s)
+ s.append("'%s'" % str(i).replace('\n', "\\n"))
+ return "(%s)" % ' '.join(s)
urllib_ftpwrapper = urllib.ftpwrapper
urllib_ftpwrapper = urllib.ftpwrapper
def __init__(self, user, passwd, host, port, dirs):
urllib_ftpwrapper.__init__(self, user, passwd, host, port, dirs)
global ftpcache_key
def __init__(self, user, passwd, host, port, dirs):
urllib_ftpwrapper.__init__(self, user, passwd, host, port, dirs)
global ftpcache_key
- ftpcache_key = (user, host, port, string.join(dirs, '/'))
+ ftpcache_key = (user, host, port, tuple(dirs))
urllib.ftpwrapper = myftpwrapper
urllib.ftpwrapper = myftpwrapper