Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2011-09-06 17:00:38 (GMT)
committer Simon Schampijer <simon@schampijer.de>2011-09-07 05:35:17 (GMT)
commite4f7d81e73fe445f4d4d7b1b168855835fcc09ea (patch)
tree051497a79186b63c73b8b14b64a5a825c8e02522 /src
parent7e1fa4e984e00cfaaddb46d0c043bdf21ce09fd6 (diff)
Only show DOCUMENTS folder when it is not $HOME
'xdg-user-dir DOCUMENTS' will return $HOME when DOCUMENTS does not exist, only display the DOCUMENTS folder when the actual folder exists Signed-off-by: Simon Schampijer <simon@laptop.org> Tested-By: Gonzalo Odiard <gonzalo@laptop.org> Reviewed-By: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'src')
-rw-r--r--src/jarabe/journal/volumestoolbar.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jarabe/journal/volumestoolbar.py b/src/jarabe/journal/volumestoolbar.py
index 84d9e31..1cc764f 100644
--- a/src/jarabe/journal/volumestoolbar.py
+++ b/src/jarabe/journal/volumestoolbar.py
@@ -67,8 +67,9 @@ def _get_documents_path():
try:
pipe = subprocess.Popen(['xdg-user-dir', 'DOCUMENTS'],
stdout=subprocess.PIPE)
- documents_path = pipe.communicate()[0].strip()
- if os.path.exists(documents_path):
+ documents_path = os.path.normpath(pipe.communicate()[0].strip())
+ if os.path.exists(documents_path) and \
+ os.environ.get('HOME') != documents_path:
return documents_path
except OSError, exception:
if exception.errno != errno.ENOENT: