[pitivi] Use 'USERPROFILE' instead of 'HOME' in windows
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] Use 'USERPROFILE' instead of 'HOME' in windows
- Date: Tue, 27 Apr 2010 20:28:40 +0000 (UTC)
commit 623391bef1ed6f8e802db7a0f9e3bc9ed0287333
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Sun Nov 15 15:44:36 2009 +0100
Use 'USERPROFILE' instead of 'HOME' in windows
pitivi/settings.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/settings.py b/pitivi/settings.py
index 67d3a7b..1c498b3 100644
--- a/pitivi/settings.py
+++ b/pitivi/settings.py
@@ -25,6 +25,7 @@ Settings
"""
import os
+import platform
import gst
from ConfigParser import SafeConfigParser, ParsingError
@@ -37,6 +38,11 @@ from pitivi.encode import available_muxers, available_video_encoders, \
from pitivi.stream import get_stream_for_caps
from pitivi.log.loggable import Loggable
+if platform.system() == 'Windows':
+ HOME = 'USERPROFILE'
+else:
+ HOME = 'HOME'
+
def get_bool_env(var):
value = os.getenv(var)
if not value:
@@ -92,11 +98,11 @@ def get_env_dirs(var, default):
def xdg_config_home(autocreate=True):
return get_dir(get_env_default("XDG_CONFIG_HOME",
- os.path.join(os.getenv("HOME"), ".config")), autocreate)
+ os.path.join(os.getenv(HOME), ".config")), autocreate)
def xdg_data_home(autocreate=True):
return get_dir(get_env_default("XDG_DATA_HOME",
- os.path.join(os.getenv("HOME"), ".local", "share")), autocreate)
+ os.path.join(os.getenv(HOME), ".local", "share")), autocreate)
def xdg_cache_home(autocreate=True):
return get_dir(get_env_default("XDG_CACHE_HOME",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]