From: wking Date: Tue, 22 Jun 2010 15:30:26 +0000 (-0400) Subject: Use os.path.join in libbe.storage.util.config.path. X-Git-Tag: 1.0.0~58^2 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=401152d6eec5167043dedde60c0a64d0affbd120;p=be.git Use os.path.join in libbe.storage.util.config.path. Versus previous hardcoded "~/.bugs_everywhere". Also improve docstrings for * libbe.storage.util.config.path * libbe.ui.util.user.get_user_id --- diff --git a/libbe/storage/util/config.py b/libbe/storage/util/config.py index 724d2d3..7d59712 100644 --- a/libbe/storage/util/config.py +++ b/libbe/storage/util/config.py @@ -37,8 +37,10 @@ Initialized with :func:`libbe.util.encoding.get_filesystem_encoding`. def path(): """Return the path to the per-user config file. + + Defaults to :file:`~/.bugs_everywhere`. """ - return os.path.expanduser("~/.bugs_everywhere") + return os.path.expanduser(os.path.join('~','.bugs_everywhere')) def set_val(name, value, section="DEFAULT", encoding=None): """Set a value in the per-user config file. diff --git a/libbe/ui/util/user.py b/libbe/ui/util/user.py index 460a1dd..412575f 100644 --- a/libbe/ui/util/user.py +++ b/libbe/ui/util/user.py @@ -101,10 +101,12 @@ def get_user_id(storage=None): The source order is: - 1. Global BE configuration. + 1. Global BE configuration [#]_ (default section, setting 'user'). 2. `storage.get_user_id`, if that function is defined. 3. :func:`get_fallback_username` and :func:`get_fallback_email`. + .. [#] See :mod:`libbe.storage.util.config`. + Notes ----- Sometimes the storage will keep track of the user ID (e.g. most