diff options
author | Tony Anderson <tony@traveler.(none)> | 2011-03-21 04:11:10 (GMT) |
---|---|---|
committer | Tony Anderson <tony@traveler.(none)> | 2011-03-21 04:11:10 (GMT) |
commit | a7a5a736bf612572d053a0bf2e50c828841636ef (patch) | |
tree | eb30ee81313f1ce8968839e92a23a30a50862f70 | |
parent | fa56fed5282e23f71ca552407b6b72e25dc2538a (diff) |
version 12.8
-rwxr-xr-x | activity/activity.info | 2 | ||||
-rwxr-xr-x | cgi-bin/activities.py | 40 | ||||
-rwxr-xr-x | launch.py | 7 |
3 files changed, 7 insertions, 42 deletions
diff --git a/activity/activity.info b/activity/activity.info index 33df64b..52b358d 100755 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,5 +1,5 @@ [Activity] -#version = 12.8 +#version = 12.9 name = Learn service_name = rw.olpc.Learn icon = activity-learn diff --git a/cgi-bin/activities.py b/cgi-bin/activities.py index 8371e6b..fb6455f 100755 --- a/cgi-bin/activities.py +++ b/cgi-bin/activities.py @@ -153,10 +153,13 @@ def getSubjects(mode): alog = open('/tmp/loggetSubjects','w') if USB.exists(): #get from usb drive pth = USB / 'subjects.js' - cmd = 'cp -r ' + pth + ' ' + 'content/' + cmd = 'cp ' + pth + ' ' + 'content/' subprocess.call(cmd,shell=True) pth = USB / 'index.html' - cmd = 'cp -r ' + pth + ' ' + 'content/' + cmd = 'cp ' + pth + ' ' + 'content/' + subprocess.call(cmd,shell=True) + pth = USB / 'versio-*' + cmd = 'cp ' + pth + ' ' + 'content/' subprocess.call(cmd,shell=True) else: #get from schoolserver folder = 'content/' @@ -194,7 +197,7 @@ def getSubjects(mode): subprocess.call('mkdir ' + tgtpth,shell=True) result = getFile(srcpth, 'courses.js') result = getFile(srcpth, 'index.html') - result = getFile(srcpth, subject.lower()+'.png') + result = getFile(srcpth, subject.lower()+'.png') alog.close() def getKarma(): @@ -250,34 +253,3 @@ def _getParam(txt): value = value.replace("'","") return(key,value) -class Config(): - def __init__(self): - fin = open('content/karma/js/config.js','r') - txt = fin.read() - fin.close() - txtout = txt - lines = txt.split('\n') - config = {} - for line in lines: - (rkey,rvalue) = _getParam(line) - if len(rkey)>0: - config[rkey] = rvalue - self.config = config - - def setConfig(self, key, value): - self.config[key]= str(value) - - def getConfig(self, key): - try: - return self.config[key] - except: - return None - - def saveConfig(self): - txtout = '' - for key in self.config.keys(): - txtout = txtout + 'var ' + key + " = '" + self.config[key] + "';\n" - fout = open('content/karma/js/config.js','w') - fout.write(txtout) - fout.close() - @@ -78,13 +78,6 @@ class Learn(activity.Activity): txt = fin.read() fin.close() print >> log, 'subjects.js',txt - config = Config() - if self.nickname[0] == 'F': - config.setConfig('mode','Faculty') - else: - config.setConfig('mode',self.nickname[:2]) - config.setConfig('course',self.nickname[:2]) - config.saveConfig() #start localserver #print >> log, 'close any open localserver' tpid = subprocess.Popen('ps aux |grep CGIHTTPServer', stdout = subprocess.PIPE, shell=True) |