Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2008-12-18 06:44:37 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2008-12-19 23:50:57 (GMT)
commitd6ba40c9b568a99d1fb8e459cb9497cfffd3e981 (patch)
treed13cb49cef09f11fe140b50a267c17a2b23db10a /common
parent075c7831f3a8adbc804014c53d460a1dfd4dc382 (diff)
cleanup paths for XO and non-XO installations
Diffstat (limited to 'common')
-rw-r--r--common/Config.py51
-rwxr-xr-xcommon/Generation/GenerationParametersWindow.py4
-rw-r--r--common/Util/Instruments.py2
3 files changed, 25 insertions, 32 deletions
diff --git a/common/Config.py b/common/Config.py
index c620627..72ae993 100644
--- a/common/Config.py
+++ b/common/Config.py
@@ -5,7 +5,10 @@ from sugar import env
#QUICKLOAD = os.path.isfile("QUICKLOAD") # skip loading inessential comenents to speed things up
-SugarMode = True
+if os.path.exists('/ofw'):
+ XO = True
+else:
+ XO = None
if os.path.isfile("DEBUG"):
f = open("DEBUG")
@@ -30,37 +33,31 @@ def logwrite(level, msg):
TAM_TAM_ROOT = get_bundle_path()
print 'INFO: loaded TAMTAM_ROOT=%s' % TAM_TAM_ROOT
-EDIT_RESOURCES = os.path.join(TAM_TAM_ROOT, "../TamTamEdit.activity/common/Resources")
-FILES_DIR = TAM_TAM_ROOT + "/common/Resources"
-
#PATHS
-if os.path.isdir("/usr/share/tamtam/Sounds"):
- SOUNDS_DIR = "/usr/share/tamtam/Sounds"
- LIB_DIR = "/usr/share/tamtam"
+if XO:
+ INSTANCE_DIR = os.path.join(get_activity_root(), 'instance')
+ DATA_DIR = os.path.join(get_activity_root(), 'data')
+ SNDS_INFO_DIR = os.path.join(get_activity_root(), 'data', 'snds_info')
+ TMP_DIR = os.path.join(get_activity_root(), 'tmp')
+ FILES_DIR = os.path.join(TAM_TAM_ROOT, "..", "TamTamEdit.activity", "common", "Resources")
+ SOUNDS_DIR = os.path.join(FILES_DIR, "Sounds", "")
+ IMAGE_ROOT = os.path.join(FILES_DIR, "Images", "")
else:
- SOUNDS_DIR = os.path.join(EDIT_RESOURCES, "Sounds")
- LIB_DIR = EDIT_RESOURCES
-
-if SugarMode == True:
- if not os.path.isdir(os.path.join(get_activity_root(), 'data', 'snds_info')):
- os.system("mkdir " + os.path.join(get_activity_root(), 'data', 'snds_info'))
- INSTANCE_DIR = os.path.join(get_activity_root(), 'instance')
- DATA_DIR = os.path.join(get_activity_root(), 'data')
- TMP_DIR = os.path.join(get_activity_root(), 'tmp')
+ INSTANCE_DIR = os.path.join(os.getenv('HOME'), '.tamtam')
+ DATA_DIR = os.path.join(os.getenv('HOME'), '.tamtam')
+ SNDS_INFO_DIR = os.path.join(os.getenv('HOME'), '.tamtam', 'snds_info')
+ TMP_DIR = os.path.join(get_activity_root(), 'tmp')
+ FILES_DIR = "/usr/share/tamtam/"
+ SOUNDS_DIR = "/usr/share/tamtam/Sounds/"
+ IMAGE_ROOT = '/usr/share/tamtam/Images/'
- SNDS_INFO_DIR = os.path.join(get_activity_root(), 'data', 'snds_info')
-
-else:
- PREF_DIR = os.getenv('HOME') + '/.tamtam'
- SYNTH_DIR= os.getenv('HOME') + '/.tamtam/synthlab'
- SNDS_DIR= os.getenv('HOME') + '/.tamtam/snds'
- SNDS_INFO_DIR = os.getenv('HOME') + '/.tamtam/snds_info'
- SCRATCH_DIR = os.getenv('HOME') + '/tamtam/.scratch'
+for i in (INSTANCE_DIR, DATA_DIR, SNDS_INFO_DIR, TMP_DIR):
+ if not os.path.isdir(i): os.makedirs(i)
#PLUGIN
PLUGIN_DEBUG = "STDERR"
PLUGIN_VERBOSE = DEBUG
-PLUGIN_UNIVORC = TAM_TAM_ROOT + "/common/Resources/tamtamorc.csd"
+PLUGIN_UNIVORC = os.path.join(FILES_DIR, "tamtamorc.csd")
PLUGIN_KSMPS = 64
PLUGIN_RATE = 16000
@@ -99,10 +96,6 @@ CSOUND_STOP_RECORD_PERF = 'i5401 4 1 "%s"'
#################
LANGUAGE = 'En'
-if os.path.isdir("/usr/share/tamtam/Images"):
- IMAGE_ROOT = '/usr/share/tamtam/Images/'
-else:
- IMAGE_ROOT = os.path.join(EDIT_RESOURCES, "Images") + '/'
MAIN_WINDOW_PADDING = 5
BG_COLOR = '#404040'
diff --git a/common/Generation/GenerationParametersWindow.py b/common/Generation/GenerationParametersWindow.py
index bde409d..5a3ea31 100755
--- a/common/Generation/GenerationParametersWindow.py
+++ b/common/Generation/GenerationParametersWindow.py
@@ -172,11 +172,11 @@ class GenerationParametersWindow( gtk.VBox ):
transButtonBox = RoundHBox(fillcolor=Config.INST_BCK_COLOR, bordercolor=Config.PANEL_BCK_COLOR)
transButtonBox.set_radius(10)
- self.GUI["saveButton"] = ImageButton(Config.TAM_TAM_ROOT + '/Resources/Images/save.png', backgroundFill=Config.INST_BCK_COLOR )
+ self.GUI["saveButton"] = ImageButton(Config.IMAGE_ROOT + '/save.png', backgroundFill=Config.INST_BCK_COLOR )
self.GUI["saveButton"].connect("clicked", self.handleSave, None)
#transButtonBox.pack_start(self.GUI["saveButton"], False, False, 2)
- self.GUI["loadButton"] = ImageButton(Config.TAM_TAM_ROOT + '/Resources/Images/load.png', backgroundFill=Config.INST_BCK_COLOR )
+ self.GUI["loadButton"] = ImageButton(Config.IMAGE_ROOT + '/load.png', backgroundFill=Config.INST_BCK_COLOR )
self.GUI["loadButton"].connect("clicked", self.handleLoad, None)
#transButtonBox.pack_start(self.GUI["loadButton"], False, False, 2)
diff --git a/common/Util/Instruments.py b/common/Util/Instruments.py
index ef22bce..8248d09 100644
--- a/common/Util/Instruments.py
+++ b/common/Util/Instruments.py
@@ -18,7 +18,7 @@ instrumentDB = InstrumentDB.getRef()
def _addInstrument( name, csoundInstrumentId, instrumentRegister, category, loopStart, loopEnd, crossDur, ampScale = 1, kit = None ):
- instrumentDB.addInstrumentFromArgs( name, csoundInstrumentId, instrumentRegister, loopStart, loopEnd, crossDur, ampScale, kit, name, Config.LIB_DIR+"/Images/"+name+".png", category )
+ instrumentDB.addInstrumentFromArgs( name, csoundInstrumentId, instrumentRegister, loopStart, loopEnd, crossDur, ampScale, kit, name, Config.IMAGE_ROOT+"/"+name+".png", category )
_addInstrument( "mic1", INST_TIED, MID, 'mysounds', .01, 1.99, .01, 1 )