Fwd: Gadget on the XS - upwards/downwards compat?

2008-06-19 Thread Martin Langhoff
This is a resend - Daf already clarified some things on irc (thanks!),
but we should flesh this out more...


-- Forwarded message --
From: Martin Langhoff [EMAIL PROTECTED]
Date: Mon, Jun 16, 2008 at 3:48 PM
Subject: Gadget on the XS - upwards/downwards compat?
To: [EMAIL PROTECTED]
Cc: Michael Stone [EMAIL PROTECTED], John Watlington
[EMAIL PROTECTED], OLPC Devel devel@lists.laptop.org


Hi Daf  Collabra team,

Michael Stone gave me a brief run down of Gadget and plans to review
it for inclusion on future XO and XS builds. What he described sounded
pretty good, so I am keen on this.

Have you guys considered backwards / forwards compat? We have many
locations where XS and XO will be updated on separate schedules -- can
an old client talk to a Gadget-driven server? How about vice-versa?
Can old and new clients coexist?

chees,



m
--
 [EMAIL PROTECTED] -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff



-- 
 [EMAIL PROTECTED] -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Unicode for Etoys

2008-06-19 Thread Edward Cherlin
Trac Issue #4011 Put the Pango support for Etoys in place. is marked
for Update 2.

What is the holdup? This is a blocker for Mongolian Cyrillic, Greek
http://www.olpcnews.com/countries/greece/using_xos_in_greece.html,
Ethiopian Amharic, any Arabic trials, Dari and Pashto in Afghanistan,
and Cambodian Khmer.

Issue #4894 Support cyrillic says that the code was fixed but the
fonts for Greek and Cyrillic weren't put in the distribution.
*   milestone  changed from Update.1 to Update.2

Oops. The greek and cyrillic fonts aren't actually distributed and loaded ...


What is the status?

-- 
Edward Cherlin
End Poverty at a Profit by teaching children business
http://www.EarthTreasury.org/
The best way to predict the future is to invent it.--Alan Kay
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Unicode for Etoys

2008-06-19 Thread Yoshiki Ohshima
At Thu, 19 Jun 2008 12:05:13 -0700,
Edward Cherlin wrote:
 
 Trac Issue #4011 Put the Pango support for Etoys in place. is marked
 for Update 2.
 
 What is the holdup? This is a blocker for Mongolian Cyrillic, Greek
 http://www.olpcnews.com/countries/greece/using_xos_in_greece.html,
 Ethiopian Amharic, any Arabic trials, Dari and Pashto in Afghanistan,
 and Cambodian Khmer.
 
 Issue #4894 Support cyrillic says that the code was fixed but the
 fonts for Greek and Cyrillic weren't put in the distribution.
 *   milestone  changed from Update.1 to Update.2
 
 Oops. The greek and cyrillic fonts aren't actually distributed and loaded ...
 
 
 What is the status?

  It is making progress again.  New patches are pushed to the Etoys
update stream, and a patch to the VM is sent around.

-- Yoshiki
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Project name : Physics activity is set up

2008-06-19 Thread Henry Edward Hardy
Wed, 18 Jun 2008 16:45:13 -0400 Brian Jordan [EMAIL PROTECTED] wrote:

1. Project name : Physics activity

Done. Your tree is here:
git+ssh://[EMAIL PROTECTED]/git/activities/physics-activity

Please follow instructions here for importing your project:
http://wiki.laptop.org/go/Importing_your_project

Let us know if you have any problems with your tree. Happy hacking.

Cheers,

--
Henry Edward Hardy
[EMAIL PROTECTED]
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


New joyride build 2053

2008-06-19 Thread Build Announcer v2
http://xs-dev.laptop.org/~cscott/olpc/streams/joyride/build2053

Changes in build 2053 from build: 2037

Size delta: -0.13M

-etoys 3.0.2007-1
+etoys 3.0.2029-1

--- Changes for etoys 3.0.2029-1 from 3.0.2007-1 ---
  + Pango fixes (tested with Nepalese)
  + new DBus bindings
  + updated QuickGuides
  + a few more strings made translatable

--
This mail was automatically generated
See http://dev.laptop.org/~rwh/announcer/joyride-pkgs.html for aggregate logs
See http://dev.laptop.org/~rwh/announcer/joyride_vs_update1.html for a 
comparison
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


New faster build 2053

2008-06-19 Thread Build Announcer v2
http://xs-dev.laptop.org/~cscott/olpc/streams/faster/build2053

Changes in build 2053 from build: 2037

Size delta: -0.13M

-etoys 3.0.2007-1
+etoys 3.0.2029-1

--- Changes for etoys 3.0.2029-1 from 3.0.2007-1 ---
  + Pango fixes (tested with Nepalese)
  + new DBus bindings
  + updated QuickGuides
  + a few more strings made translatable

--
This mail was automatically generated
See http://dev.laptop.org/~rwh/announcer/faster-pkgs.html for aggregate logs
See http://dev.laptop.org/~rwh/announcer/joyride_vs_update1.html for a 
comparison
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


[Server-devel] [PATCH 3/4] ds_backup.py: remove dbus and json dependencies

2008-06-19 Thread martin . langhoff
From: Martin Langhoff [EMAIL PROTECTED]

Now that we don't talk to the datastore, drop
these dependencies.
---
 ds_backup.py |   29 -
 1 files changed, 0 insertions(+), 29 deletions(-)

diff --git a/ds_backup.py b/ds_backup.py
index 3ae9df2..dabcf39 100755
--- a/ds_backup.py
+++ b/ds_backup.py
@@ -27,16 +27,9 @@ import glob
 import popen2
 import re
 
-import json
-import dbus
-
 from sugar import env
 from sugar import profile
 
-DS_DBUS_SERVICE = 'org.laptop.sugar.DataStore'
-DS_DBUS_INTERFACE = 'org.laptop.sugar.DataStore'
-DS_DBUS_PATH = '/org/laptop/sugar/DataStore'
-
 class BackupError(Exception): pass
 class ProtocolVersionError(BackupError): pass
 class RefusedByServerError(BackupError): pass
@@ -45,14 +38,6 @@ class TransferError(BackupError): pass
 class NoPriorBackups(BackupError): pass
 class BulkRestoreUnavailable(BackupError): pass
 
-# FIXME: We should not be doing this for every entry. Cannot get JSON to accept
-# the dbus types?
-def _sanitize_dbus_dict(dbus_dict):
-base_dict = {}
-for key, value in dbus_dict.iteritems():
-base_dict[unicode(key)] = unicode(value)
-return base_dict
-
 def find_last_backup(server, xo_serial):
 try:
 ret = urllib.urlopen(server + '/last/%s' % xo_serial).read()
@@ -119,20 +104,6 @@ def rsync_to_xs(from_path, to_path, keyfile, user):
 raise TransferError('rsync error code %s, message:'
 % rsync_exit, rsync_p.childerr.read())
 
-def _unpack_bulk_backup(restore_index):
-bus = dbus.SessionBus()
-obj = bus.get_object(DS_DBUS_SERVICE, DS_DBUS_PATH)
-datastore = dbus.Interface(obj, DS_DBUS_INTERFACE)
-
-for line in file(restore_index):
-props = json.read(line)
-preview_path = os.path.join('preview', props['uid'])
-if os.path.exists(preview_path):
-preview = file(preview_path).read()
-props['preview'] = dbus.ByteArray(preview_data)
-props['uid'] = ''
-datastore.create(props, file_path, transfer_ownership=True)
-
 def have_ofw_tree():
 return os.path.exists('/ofw')
 
-- 
1.5.4.34.g053d9

___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel


[Server-devel] [PATCH 4/4] Making space for server-side code

2008-06-19 Thread martin . langhoff
From: Martin Langhoff [EMAIL PROTECTED]

---
 client/ds_backup.py |  136 
 client/ds_backup.sh |  144 +++
 ds_backup.py|  136 
 ds_backup.sh|  144 ---
 4 files changed, 280 insertions(+), 280 deletions(-)
 create mode 100755 client/ds_backup.py
 create mode 100755 client/ds_backup.sh
 delete mode 100755 ds_backup.py
 delete mode 100755 ds_backup.sh

diff --git a/client/ds_backup.py b/client/ds_backup.py
new file mode 100755
index 000..dabcf39
--- /dev/null
+++ b/client/ds_backup.py
@@ -0,0 +1,136 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007 Ivan Krstić
+# Copyright (C) 2007 Tomeu Vizoso
+# Copyright (C) 2007 One Laptop per Child
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of version 2 of the GNU General Public License (and
+# no other version) as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+import os
+import sha
+import urllib
+import os.path
+import tempfile
+import time
+import glob
+import popen2
+import re
+
+from sugar import env
+from sugar import profile
+
+class BackupError(Exception): pass
+class ProtocolVersionError(BackupError): pass
+class RefusedByServerError(BackupError): pass
+class ServerTooBusyError(BackupError): pass
+class TransferError(BackupError): pass
+class NoPriorBackups(BackupError): pass
+class BulkRestoreUnavailable(BackupError): pass
+
+def find_last_backup(server, xo_serial):
+try:
+ret = urllib.urlopen(server + '/last/%s' % xo_serial).read()
+return ret.split(',', 1)
+except IOError, e:
+if e[1] == 404:
+raise ProtocolVersionError(server)
+elif e[1] == 403:
+raise RefusedByServerError(server)
+elif e[1] == 503:
+raise ServerTooBusyError(server)
+
+def find_restore_path(server, xo_serial):
+try:
+ret = urllib.urlopen(server + '/restore/%s' % xo_serial).read()
+if ret == '0':
+raise NoPriorBackups(server)
+else:
+return ret
+except IOError, e:
+if e[1] == 500:
+raise BulkRestoreUnavailable(server)
+elif e[1] == 503:
+raise ServerTooBusyError(server)
+
+def rsync_to_xs(from_path, to_path, keyfile, user):
+
+# add a trailing slash to ensure
+# that we don't generate a subdir
+# at the remote end. rsync oddities...
+if not re.compile('/$').search(from_path):
+from_path = from_path + '/'
+
+ssh = '/usr/bin/ssh -F /dev/null -o PasswordAuthentication no -i %s -l 
%s' \
+% (keyfile, user)
+rsync = /usr/bin/rsync -az --partial --delete --timeout=160 -e '%s' '%s' 
'%s'  % \
+(ssh, from_path, to_path)
+print rsync
+rsync_p = popen2.Popen3(rsync, True)
+
+# here we could track progress with a
+# for line in pipe:
+# (an earlier version had it)
+
+# wait() returns a DWORD, we want the lower
+# byte of that.
+rsync_exit = os.WEXITSTATUS(rsync_p.wait())
+if rsync_exit != 0:
+# TODO: retry a couple of times
+# if rsync_exit is 30 (Timeout in data send/receive)
+raise TransferError('rsync error code %s, message:'
+% rsync_exit, rsync_p.childerr.read())
+
+# Transfer an empty file marking completion
+# so the XS can see we are done.
+tmpfile = tempfile.mkstemp()
+rsync = (/usr/bin/rsync --timeout 10 -e '%s' '%s' '%s' 
+ % (ssh, tmpfile[1], to_path+'/.transfer_complete'))
+rsync_p = popen2.Popen3(rsync, True)
+rsync_exit = os.WEXITSTATUS(rsync_p.wait())
+if rsync_exit != 0:
+# TODO: retry a couple ofd times
+# if rsync_exit is 30 (Timeout in data send/receive)
+raise TransferError('rsync error code %s, message:'
+% rsync_exit, rsync_p.childerr.read())
+
+def have_ofw_tree():
+return os.path.exists('/ofw')
+
+def read_ofw(path):
+path = os.path.join('/ofw', path)
+if not os.path.exists(path):
+return None
+fh = open(path, 'r')
+data = fh.read().rstrip('\0\n')
+fh.close()
+return data
+
+# if run directly as script
+if __name__ == __main__:
+
+backup_url = 'http://schoolserver/backup/1'
+
+if have_ofw_tree():
+sn = read_ofw('mfg-data/SN')
+else:
+sn = 'SHF'
+
+ds_path = 

Re: [Server-devel] EduBlog v0.1 Available for Comment! (Martin Langhoff)

2008-06-19 Thread Tarun Pondicherry
Hi Greg,

I talked with Martin, and I think ou blog will be better for us since it 
runs as an activity.  This already makes it capable of having multiple 
blogs for each course / teacher.  It'll be easier to integrate with a 
scheme like Yama had set up than the standard blog.

Thanks,
Tarun

 I understand that there is a decision point about OuBlog vs. Moodleblog.
 I think the choice will affect what appears on the students home page.
 I'm ready to ask the teachers what they prefer but I'm not sure I have a
 well formed question

___
Server-devel mailing list
Server-devel@lists.laptop.org
http://lists.laptop.org/listinfo/server-devel