[library-web] Don't fail if HOME is not defined
- From: Frederic Peters <fpeters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [library-web] Don't fail if HOME is not defined
- Date: Fri, 3 Dec 2010 15:56:06 +0000 (UTC)
commit 43567de177d1bfa8c021a8e4a048f9829993999c
Author: Frédéric Péters <fpeters 0d be>
Date: Fri Dec 3 16:38:10 2010 +0100
Don't fail if HOME is not defined
src/config.py | 5 ++++-
src/defaults.lgorc | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/config.py b/src/config.py
index 21d26e7..8d469bd 100644
--- a/src/config.py
+++ b/src/config.py
@@ -25,7 +25,10 @@ import traceback
from errors import FatalError
_defaults_file = os.path.join(os.path.dirname(__file__), 'defaults.lgorc')
-_default_lgorc = os.path.join(os.environ['HOME'], '.lgorc')
+if 'HOME' in os.environ:
+ _default_lgorc = os.path.join(os.environ['HOME'], '.lgorc')
+else:
+ _default_lgorc = None
_known_keys = ['ftp_gnome_org_local_copy', 'use_latest_version',
'private_dir', 'download_cache_dir', 'output_dir',
diff --git a/src/defaults.lgorc b/src/defaults.lgorc
index 97bb349..e289e36 100644
--- a/src/defaults.lgorc
+++ b/src/defaults.lgorc
@@ -4,7 +4,10 @@ import os
ftp_gnome_org_local_copy = None
# private work directory
-private_dir = os.path.join(os.environ['HOME'], '.lgo')
+if 'HOME' in os.environ:
+ private_dir = os.path.join(os.environ['HOME'], '.lgo')
+else:
+ private_dir = '/tmp/'
# where to cache downloaded files
download_cache_dir = os.path.join(private_dir, 'cache')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]