Support tilde expansion on filestore path
Closed this issue · 1 comments
susam commented
We should support tilde expansion in any paths read from configuration as much as possible.
For example, currently the filestore
plugin module accepts a directory path as path
parameter to write output files.
cloudmarker/cloudmarker/stores/filestore.py
Lines 11 to 18 in 273eadb
It should expand tilde (~
) or (~user
) in the path
to the home directory of the user.
Python has a os.path.expanduser()
function that does this. This should be used to do this task. Here is an example usage:
>>> import os
>>> os.path.expanduser('~susam')
'/Users/susam'
>>> os.path.expanduser('~susam/foo')
'/Users/susam/foo'
>>> os.path.expanduser('~')
'/Users/susam'
>>> os.path.expanduser('~/foo')
'/Users/susam/foo'
prateeknischal commented
Added #21 for the issue.