Re: [Sugar-devel] Call for testing and feedback: alternative Journal implementation

2012-07-07 Thread Christophe Guéret
Dear everyone,

I've updated the installation bundle for SemanticXO and also fixed a few
bugs reported on this mail thread.
To play around with the code:
* go to http://git.sugarlabs.org/semanticxo/main/trees/master/patch_my_xo
* put the files patch_my_xo.py and semanticxo.tgz somewhere on the XO
* login as root, set patch_my_xo.py to be executable and type
./patch_my_xo.py setup
* reboot

It's a very harsh script that will just overwrite the standard Journal code
and erase all the content. I've tested it on a couple of XO-1. If
everything works fine, you won't see any difference.
To see what happens in the back-end, open a web browser to
http://IP_OF_THE_XO:8080
to see the content of the triple store.

I'd now like to implement something to remotely query an XO triple store
from an activity.
Does anyone know if it is possible to get an IP of a neighbour returned by
the presence service?
Or, shall I better wrap external calls to the triple store in a DBus API,
even if that is all plain HTTP?

Christophe

On 2 July 2012 17:38, Christophe Guéret c.d.m.gue...@vu.nl wrote:

 Hi Aleksey,

 I've packaged redstore to SD:Factory repos
 (
 https://packages.sugarlabs.org/project/monitor?project=SweetsDistribution:Factory
 )
 the package is redstore that provides redstore command and
 redstored init.d script.

 Great! Many thanks :)


 I didn't make it autorun in case if you will use it in
 the same way as Journal (and Sugar Network database), i.e., keep
 database in ~/.sugar/PROFILE and start daemon from current user's
 session.

 Could you point me to an example on how to set this up?
 Currently I set the database system wide and start the daemon at boot time
 but switching to a user session would make sens.


 btw, it might be useful to create SemanticXO package as well and make it
 pluggable like it was done with Sugar Network (checkbox in Sweets
 Distribution Control Panel component). i.e., it should regular DBus
 service that provides the same Dbus API as sugar-datastore. If you will
 do that, I think it will be possible to plug either sugar-datastore or
 SemanticXO in runtime.

 It is already the case, on my test machines I remove sugar-datastore to
 put the one provided by SemanticXO instead.
 That one uses the same DBUS API and service name. I will look into
 packaging it.

 I was slowed down on SemanticXO recently, I hope to be able to get back in
 speed soon...

 Christophe






___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release Turtle Blocks-149

2012-07-07 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4027

Sugar Platform:
0.82 - 0.96

Download Now:
http://activities.sugarlabs.org/downloads/file/28147/turtle_art-149.xo

Release notes:
149

ENHANCEMENTS:
* Changed flow block artwork to use clamp style
* Insert blocks into the middle of a stack
* Moved camera to media palette
* New translations

BUG FIX:
* Fix regression that prevented selected blocks from moving on top of
  all other blocks
* Add box and stack proto blocks to palette on load/copy
* Don't create duplicate start or action blocks with copy/paste



Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH Speak] Removing Hippo Canvas from chat mode

2012-07-07 Thread Daniel Francis
Now the activity hasn't got HippoCanvas and I'm ready to port it to Gtk3!

A little comment, I added de _share function because I forgot it at the time to 
remove the early toolkit modules, and it appeared in the log when I tried to 
share the activity.

Signed-off-by: Daniel Francis fran...@sugarlabs.org
---
 activity.py |   12 ++
 chat.py |  137 +++---
 chatbox.py  |  364 ++-
 roundbox.py |  100 
 4 files changed, 391 insertions(+), 222 deletions(-)
 create mode 100644 roundbox.py

diff --git a/activity.py b/activity.py
index a3f01ac..d4f0e2a 100644
--- a/activity.py
+++ b/activity.py
@@ -203,6 +203,18 @@ class SpeakActivity(SharedActivity):
 toolbox.show_all()
 self.toolbar_box = toolbox
 
+def _share(self, tube_conn, initiator):
+logging.debug('Activity._share state=%s' % self.__state)
+
+if self.__state == _NEW_INSTANCE:
+self.__postponed_share.append((tube_conn, initiator))
+self.__state = _PRE_INSTANCE
+elif self.__state == _PRE_INSTANCE:
+self.__postponed_share.append((tube_conn, initiator))
+self.__instance()
+elif self.__state == _POST_INSTANCE:
+self.share_instance(tube_conn, initiator)
+
 def set_cursor(self, cursor):
 if not isinstance(cursor, gtk.gdk.Cursor):
 cursor = CursorFactory().get_cursor(cursor)
diff --git a/chat.py b/chat.py
index 12d0075..a61822d 100644
--- a/chat.py
+++ b/chat.py
@@ -16,12 +16,11 @@
 
 import gtk
 import pango
-import hippo
 import logging
 from gettext import gettext as _
 
 import sugar.graphics.style as style
-from sugar.graphics.roundbox import CanvasRoundBox
+from roundbox import RoundBox
 from sugar.graphics.toggletoolbutton import ToggleToolButton
 
 import eye
@@ -45,9 +44,9 @@ ENTRY_XPAD = 0
 ENTRY_YPAD = 7
 
 
-class View(hippo.Canvas):
+class View(gtk.EventBox):
 def __init__(self):
-hippo.Canvas.__init__(self)
+gtk.EventBox.__init__(self)
 
 self.messenger = None
 self.me = None
@@ -57,16 +56,18 @@ class View(hippo.Canvas):
 
 # buddies box
 
-self._buddies_list = hippo.CanvasBox(
-background_color=BUDDIES_COLOR.get_int(),
-box_width=BUDDIES_WIDTH,
-padding=ENTRY_YPAD,
-spacing=ENTRY_YPAD)
+self._buddies_list = gtk.VBox()
+self._buddies_list.set_homogeneous(False)
+self._buddies_list.props.spacing = ENTRY_YPAD
 
-self._buddies_box = hippo.CanvasScrollbars()
-self._buddies_box.set_policy(hippo.ORIENTATION_HORIZONTAL,
-hippo.SCROLLBAR_NEVER)
-self._buddies_box.set_root(self._buddies_list)
+self._buddies_box = gtk.ScrolledWindow()
+self._buddies_box.set_policy(gtk.POLICY_ALWAYS,
+ gtk.POLICY_NEVER)
+evbox = gtk.EventBox()
+evbox.modify_bg(gtk.STATE_NORMAL, BUDDIES_COLOR.get_gdk_color())
+evbox.add(self._buddies_list)
+evbox.show()
+self._buddies_box.add_with_viewport(evbox)
 
 # chat entry
 
@@ -82,40 +83,37 @@ class View(hippo.Canvas):
 chat_post.connect('key-press-event', self._key_press_cb)
 chat_post.props.wrap_mode = gtk.WRAP_WORD_CHAR
 chat_post.set_size_request(-1, BUDDY_SIZE - ENTRY_YPAD * 2)
-chat_post_box = CanvasRoundBox(
-background_color=style.COLOR_WHITE.get_int(),
-padding_left=ENTRY_XPAD,
-padding_right=ENTRY_XPAD,
-padding_top=ENTRY_YPAD,
-padding_bottom=ENTRY_YPAD
-)
-chat_post_box.props.border_color = ENTRY_COLOR.get_int()
-chat_post_box.append(hippo.CanvasWidget(widget=chat_post),
-hippo.PACK_EXPAND)
-
-chat_entry = CanvasRoundBox(background_color=ENTRY_COLOR.get_int(),
-padding_left=ENTRY_XPAD,
-padding_right=ENTRY_XPAD,
-padding_top=ENTRY_YPAD,
-padding_bottom=ENTRY_YPAD,
-spacing=ENTRY_YPAD)
-chat_entry.props.orientation = hippo.ORIENTATION_HORIZONTAL
-chat_entry.props.border_color = style.COLOR_WHITE.get_int()
-chat_entry.append(my_face_widget)
-chat_entry.append(chat_post_box, hippo.PACK_EXPAND)
-
-chat_box = hippo.CanvasBox(orientation=hippo.ORIENTATION_VERTICAL,
-  background_color=style.COLOR_WHITE.get_int())
-chat_box.append(self._chat, hippo.PACK_EXPAND)
-chat_box.append(chat_entry)
+chat_post_box = RoundBox()
+chat_post_box.background_color = style.COLOR_WHITE
+chat_post_box.border_color = ENTRY_COLOR
+chat_post_box.pack_start(chat_post, True, True, ENTRY_XPAD)
+
+