Mercurial > treepkg > treepkg
diff treepkg/util.py @ 439:8e0c81870e5e treepkg-status
cleanup modules
fix test_info testcases
added testcases for remove_trailingslashes and expand_filename
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Fri, 06 Aug 2010 11:06:08 +0000 |
parents | acb8dbd506f6 |
children | e7e0ace683c6 |
line wrap: on
line diff
--- a/treepkg/util.py Thu Aug 05 16:21:47 2010 +0000 +++ b/treepkg/util.py Fri Aug 06 11:06:08 2010 +0000 @@ -174,3 +174,13 @@ f.close() return m.hexdigest() +def remove_trailing_slashes(s): + return s.rstrip("/") + +def expand_filename(filename): + """ + Applies os.path.expanduser and os.path.expandvars to filename + """ + return os.path.expandvars(os.path.expanduser(filename)) + +