Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Anderson <tony@traveler.(none)>2011-03-21 17:14:14 (GMT)
committer Tony Anderson <tony@traveler.(none)>2011-03-21 17:14:14 (GMT)
commit41f7b6cafd883a3a0289c36fcaf582227cc6f1d3 (patch)
tree30b4b08247f188f78419c37182db36696089fde2
parent62b1d645f239dd7c0a429ae4e206599cd8918e7e (diff)
version 12.11
-rwxr-xr-xactivity/activity.info2
-rwxr-xr-xcgi-bin/activities.py19
2 files changed, 4 insertions, 17 deletions
diff --git a/activity/activity.info b/activity/activity.info
index fbe6017..7145fa9 100755
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -1,5 +1,5 @@
[Activity]
-#version = 12.10
+#version = 12.11
name = Learn
service_name = rw.olpc.Learn
icon = activity-learn
diff --git a/cgi-bin/activities.py b/cgi-bin/activities.py
index 1098254..df7d2a6 100755
--- a/cgi-bin/activities.py
+++ b/cgi-bin/activities.py
@@ -123,8 +123,8 @@ def setActivities(subject, milestone, activities):
def fetchMilestone(subject, course, milestone):
if USB.exists(): #get from usb drive
- src = USB / subject / course / milestone
- dst = 'content' / subject /course
+ src = USB / subject / course / milestone + '.msxo'
+ dst = path('content') / subject /course
cmd = 'cp -r ' + src + ' ' + dst
subprocess.call(cmd,shell=True)
else: #get from schoolserver
@@ -218,33 +218,20 @@ def getKarma():
subprocess.call(cmd, shell=True)
def getFile(filepth,filename):
- log = open('/tmp/loggetfile','w')
pth = filepth / filename
tgtpth = path('content') / filepth
result = ''
- print >> log, 'filepth',filepth,'tgtpth',tgtpth,'filename',filename
- log.close()
if USB.exists(): #get from usb drive
pth = USB / filepth
cmd = 'cp -r ' + pth / filename + ' ' + tgtpth
- print >> log, 'usb',cmd
subprocess.call(cmd,shell=True)
else: #get from schoolserver
pth = SS / filepth
- log = open('/tmp/loggetfile1','w')
- print >> log, 'pth',pth
if filename.find('*') > -1:
script = 'cd ' + str(pth) + '\nmget ' + filename
else:
script = 'cd ' + str(pth) + '\nget ' + filename
- print >> log, 'sftp folder', tgtpth, 'script',script
- try:
- (result,err) = sftp(script, tgtpth)
- except:
- print >> log, 'sftp failed', sys.exc_info()[:2]
- print >> log,'sftp result', result, 'err', err
- print >> log,'getFile done'
- log.close()
+ (result,err) = sftp(script, tgtpth)
return result
def _getParam(txt):