Remove trailing _ in making account file

svn path=/trunk/boinc/; revision=1576
This commit is contained in:
Karl Chen 2003-06-24 20:06:24 +00:00
parent ed3a90e505
commit d5aae7ad6c
1 changed files with 7 additions and 1 deletions

View File

@ -146,8 +146,14 @@ def rmtree(dir):
except OSError:
pass
def _remove_trail(s, suffix):
if s.endswith(suffix):
return s[:-len(suffix)]
else:
return s
def _url_to_filename(url):
return url.replace('http://','').replace('/','_')
return _remove_trail(url.replace('http://','').replace('/','_'),'_')
def account_file_name(url):
return 'account_' + _url_to_filename(url) + '.xml'