Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Config.py
diff options
context:
space:
mode:
authorJames <olpc@localhost.localdomain>2007-01-29 12:03:33 (GMT)
committer James <olpc@localhost.localdomain>2007-01-29 12:03:33 (GMT)
commit9bf4b3ccc2684c108ec0228578911f4a8dc0b6b1 (patch)
tree2cafe11910c52d7ed3f4cb14282c88a2a35f1a2d /Config.py
parent37d5b1c8b1248eb86db2dc8d0550569cd08b8535 (diff)
parent91597cc694d20ef5385805f26af8a1c829b1052c (diff)
merged
Diffstat (limited to 'Config.py')
-rw-r--r--Config.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/Config.py b/Config.py
index abfb296..6c96b61 100644
--- a/Config.py
+++ b/Config.py
@@ -1,7 +1,12 @@
# -*- coding: utf-8 -*-
-
import os
+SugarMode = True
+try:
+ from sugar import env
+except ImportError:
+ SugarMode = False
+
if os.path.isfile("DEBUG"):
f = open("DEBUG")
l = f.read(10)
@@ -13,7 +18,6 @@ print "Debug Level %d" % (DEBUG)
TAM_TAM_ROOT = os.path.dirname(os.path.abspath(__file__))
-PREF_DIR = '/tamtam'
print 'INFO: loaded TAMTAM_ROOT=%s' % TAM_TAM_ROOT
#BUFFERING
@@ -23,6 +27,10 @@ NOTELOOPER_SLEEP = 0.05
#PATHS
SOUNDS_DIR = TAM_TAM_ROOT + "/Resources/Sounds"
FILES_DIR = TAM_TAM_ROOT + "/Resources"
+if SugarMode == True:
+ PREF_DIR = env.get_profile_path() + '/tamtam'
+else:
+ PREF_DIR = SOUNDS_DIR + '/temp'
#SERVER
SERVER_ADDRESS = "localhost"