From d5aae7ad6c34042cb0652003ed79367c4dd6a8aa Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Tue, 24 Jun 2003 20:06:24 +0000 Subject: [PATCH] Remove trailing _ in making account file svn path=/trunk/boinc/; revision=1576 --- test/boinc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/boinc.py b/test/boinc.py index f448aeaa87..1431a53eb0 100644 --- a/test/boinc.py +++ b/test/boinc.py @@ -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'