Re: [Sugar-devel] Enable gnome-keyring to autostart in sugar-emulator

2012-07-03 Thread Caspar Bothmer
Hello Daniel,

sorry, been busy...

Sascha and me have discussed this issue thoroughly. The diff itself is easy,
the reasoning behind is not.

So we decided just to tell you how we would write this commit message and
the diff to reflect the situation.  The commit message will become the
entry in git log.  It's not enough to tell in your own words, what the diff
is doing and giving the place, where this solution is outlined.
You need to extract the relevant information, what you do and why.

Caspar


Subject: Enable gnome-keyring-daemon to start inside the emulated session.

We have the following situation: there is an instance of gnome-keyring-daemon
running on the machine.  But sugar-emulator can't access this instance of
gnome-keyring-daemon, as it is outside the scope of sugar-emulator and not
registered with the D-Bus session bus started by sugar-emulator.
D-Bus tries to start a new instance of gnome-keyring-daemon, which fails due
to a set of environment variables related to gnome-keyring-daemon.  These
essentially make gnome-keyring-daemon try to initialize the existing instance
of gnome-keyring-daemon outside the scope of sugar-emulator.
By removing these environment variables, D-Bus can start a new instance of
gnome-keyring-daemon and register with the D-Bus session.

See
https://bugzilla.gnome.org/show_bug.cgi?id=628302
and
https://live.gnome.org/GnomeKeyring/RunningDaemon

for more information.

---
bin/sugar.in|6 --
 src/jarabe/util/emulator.py |7 +++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/bin/sugar.in b/bin/sugar.in
index 12098db..2df0ab8 100644
--- a/bin/sugar.in
+++ b/bin/sugar.in
@@ -62,12 +62,6 @@ export LANGUAGE="${LANGUAGE:-${LANG}}"
 # Set Sugar's telepathy accounts directory
 export MC_ACCOUNT_DIR=$HOME/.sugar/$SUGAR_PROFILE/accounts
 
-# Workaround until gnome-keyring-daemon lets dbus activate it
-# https://bugzilla.gnome.org/show_bug.cgi?id=628302
-if test "$SUGAR_EMULATOR" = "yes" -a "$(type gnome-keyring-daemon)"; then
-gnome-keyring-daemon --components=secrets &
-fi
-
 # Source language settings and debug definitions
 if [ -f ~/.i18n ]; then
 . ~/.i18n
diff --git a/src/jarabe/util/emulator.py b/src/jarabe/util/emulator.py
index fda1b59..db34190 100644
--- a/src/jarabe/util/emulator.py
+++ b/src/jarabe/util/emulator.py
@@ -120,6 +120,13 @@ def _start_window_manager():
 
 
 def _setup_env(display, scaling, emulator_pid):
+# We need to remove the environment related to gnome-keyring-daemon,
+# so a new instance of gnome-keyring-daemon can be started and
+# registered properly.
+for variable in ['GPG_AGENT_INFO', 'SSH_AUTH_SOCK',
+ 'GNOME_KEYRING_CONTROL', 'GNOME_KEYRING_PID']:
+if variable in os.environ:
+del os.environ[variable]
+
 os.environ['SUGAR_EMULATOR'] = 'yes'
 os.environ['GABBLE_LOGFILE'] = os.path.join(
 env.get_profile_path(), 'logs', 'telepathy-gabble.log')
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH Finance] pep8ized

2012-07-03 Thread Manuel Kaufmann
Fixed a lot of code style related with PEP8

Signed-off-by: Manuel Kaufmann 
---
 budgetscreen.py   |   81 +++--
 chartscreen.py|   56 -
 finance.py|  341 -
 registerscreen.py |   76 +++-
 setup.py  |2 +
 5 files changed, 328 insertions(+), 228 deletions(-)

diff --git a/budgetscreen.py b/budgetscreen.py
index c38617e..4115d79 100644
--- a/budgetscreen.py
+++ b/budgetscreen.py
@@ -1,38 +1,40 @@
-# Copyright 2008 by Wade Brainerd.  
+# Copyright 2008 by Wade Brainerd.
 # This file is part of Finance.
 #
 # Finance is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # Finance 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 Finance.  If not, see .
 
 # Import standard Python modules.
-import logging, os, math, time, copy, json, time, datetime, locale
-from gettext import gettext as _
+import datetime
+import locale
 
-# Set up localization.
-locale.setlocale(locale.LC_ALL, '')
+from gettext import gettext as _
 
 from gi.repository import Gtk
 from gi.repository import Gdk
 from gi.repository import GObject
 
-# Import Sugar UI modules.
-import sugar3.activity.activity
-from sugar3.graphics import *
+# Set up localization.
+locale.setlocale(locale.LC_ALL, '')
 
 # Import activity module
 import finance
 
-BUDGET_HELP = _('The Budget view allows you to set a monthly budget for each 
expense category, and to keep track of your\nbudgets.  To set a budget, type 
the amount in the box to the right of the category.')
+BUDGET_HELP = _(
+'The Budget view allows you to set a monthly budget for each expense '
+'category, and to keep track of your\nbudgets. To set a budget, type '
+'the amount in the box to the right of the category.')
+
 
 class BudgetScreen(Gtk.VBox):
 def __init__(self, activity):
@@ -42,7 +44,7 @@ class BudgetScreen(Gtk.VBox):
 
 self.category_total = {}
 self.sorted_categories = []
- 
+
 self.budgetbox = Gtk.VBox()
 
 scroll = Gtk.ScrolledWindow()
@@ -57,12 +59,12 @@ class BudgetScreen(Gtk.VBox):
 for t in self.activity.visible_transactions:
 cat = t['category']
 amount = t['amount']
-
+
 if t['type'] == 'debit':
-if not self.category_total.has_key(cat):
+if not cat in self.category_total:
 self.category_total[cat] = amount
-else: 
-self.category_total[cat] += amount 
+else:
+self.category_total[cat] += amount
 
 # Generate a list of names sorted by total.
 self.sorted_categories = self.category_total.keys()
@@ -74,12 +76,12 @@ class BudgetScreen(Gtk.VBox):
 
 # Build header.
 catlabel = Gtk.Label()
-catlabel.set_markup(''+_('Category')+'')
+catlabel.set_markup('' + _('Category') + '')
 spentlabel = Gtk.Label()
-spentlabel.set_markup(''+_('Spent')+'')
+spentlabel.set_markup('' + _('Spent') + '')
 budgetlabel = Gtk.Label()
-budgetlabel.set_markup(''+_('Budget')+'')
-
+budgetlabel.set_markup('' + _('Budget') + '')
+
 headerbox = Gtk.HBox()
 headerbox.pack_start(catlabel, False, True, 20)
 headerbox.pack_start(spentlabel, True, True, 10)
@@ -94,7 +96,7 @@ class BudgetScreen(Gtk.VBox):
 
 budgetgroup = Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL)
 budgetgroup.add_widget(budgetlabel)
-
+
 # Build categories.
 for c in self.sorted_categories:
 description = c
@@ -120,7 +122,7 @@ class BudgetScreen(Gtk.VBox):
 budgetentry = Gtk.Entry()
 budgetentry.connect('changed', self.budget_changed_cb, c)
 budgetentry.set_width_chars(10)
-if self.activity.data['budgets'].has_key(c):
+if c in self.activity.data['budgets']:
 b = self.activity.data['budgets'][c]
 budgetentry.set_text(locale.currency(b['amount'], False))
 budgetgroup.add_widget(budgetentry)
@@ -141,7 +143,7 @@ class BudgetScreen(Gtk.VBox):
 self.budgetbox.pack_start(hbox, False, False, 5)
 
 self.show_all()
-
+
 self.activity.set_help(BUDGET_HELP)
 
 def bar_draw_cb(self, widget, cr, category):
@@ -149,13 +151,18 @@ class BudgetScreen(Gtk.VBox):
 
 # Draw amount of time spent in period if sensible.
 period_ratio

[Sugar-devel] [PATCH Finance] Bug fix

2012-07-03 Thread Manuel Kaufmann
These two bugs were introduced in 1c21ce44b81831132aaa520fdde4e8eccce1b705

Signed-off-by: Manuel Kaufmann 
---
 chartscreen.py |2 +-
 finance.py |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/chartscreen.py b/chartscreen.py
index 3538836..f1c40cd 100644
--- a/chartscreen.py
+++ b/chartscreen.py
@@ -75,7 +75,7 @@ class ChartScreen(Gtk.HBox):
 amount = t['amount']
 
 if t['type'] == 'debit':
-if not cat self.category_total:
+if cat not in self.category_total:
 self.category_total[cat] = amount
 else:
 self.category_total[cat] += amount
diff --git a/finance.py b/finance.py
index 9325f3b..6ba89cc 100644
--- a/finance.py
+++ b/finance.py
@@ -43,7 +43,7 @@ from sugar3.graphics.toolbarbox import ToolbarButton
 from sugar3.graphics.radiotoolbutton import RadioToolButton
 from sugar3.activity.widgets import StopButton
 from sugar3.activity.widgets import ActivityToolbarButton
-from sugar3.activity import Activity
+from sugar3.activity.activity import Activity
 
 # Set up localization.
 locale.setlocale(locale.LC_ALL, '')
-- 
1.7.10.4

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


[Sugar-devel] [REMINDER] Development team meeting --- 3 July 2012 (15:00 UTC)

2012-07-03 Thread Gonzalo Odiard
Hi,

today we will have our weekly development team meeting, the topics will be:

- Introducing new contributors

- Update list of action items

- shell and activities port status update

Time: 26. June 2012 (15:00 UTC)
Place: #sugar-meeting (freenode)

Regards,

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


Re: [Sugar-devel] test automation

2012-07-03 Thread Daniel Narvaez
On 2 July 2012 12:02, Sascha Silbe  wrote:
> 1. Ensuring the "accessibility" helpers are running.
>
>The test suite already enables them, but they need to actually get
>started. This is done automatically by the upstream version of
>gnome-session, but sugar-toolkit ships an ancient copy that won't
>start the helpers. Starting them manually was problematic. For this
>reason (in addition to generally being a good idea), I've ported
>Sugar over to upstream gnome-session.

These days the helpers are automatically started by dbus, so they just
work in sugar as is. One of them registers with the gnome-session but
I didn't check for what reason.
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] dogtail unreliability (was Re: test automation)

2012-07-03 Thread Daniel Narvaez
Just to give an update, I investigated more why my dogtail script to
run all the activities was failing randomly in the buildbot. It looks
like when the system is under heavy load sometimes clicks are missed.
I'm not sure yet if it's the dbus side or the Xvfb/XTest side. It's a
pretty bad issue though, hopefully we can figure out a solution.

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


Re: [Sugar-devel] [PATCH sugar-toolkit] presence: use RoomConfig1 to configure channel properties (#3629)

2012-07-03 Thread Sascha Silbe
Daniel Drake  writes:

[...]
> However, as of Telepathy-0.24.0, these properties have gone away.
>
> http://telepathy.freedesktop.org/spec/Channel_Type_Text.html
> Changed in 0.24.0. This interface used to have a bunch of clunky
> Telepathy.Properties. They have been removed in favour of D-Bus
> properties on the Room2, Subject2 and RoomConfig1 interfaces.

Ah, reading the quote carefully, it's clear that the version number
applies to the specification. It would be nice to adjust the
introductory sentence to reflect that (e.g. "as of Telepathy
specification 0.24.0").


[...]
[src/sugar/presence/activity.py]
> @@ -43,6 +43,7 @@ from sugar.presence.buddy import Buddy
>  
>  CONN_INTERFACE_ACTIVITY_PROPERTIES = 
> 'org.laptop.Telepathy.ActivityProperties'
>  CONN_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
> +CONN_INTERFACE_ROOM_CONFIG = 
> 'org.freedesktop.Telepathy.Channel.Interface.RoomConfig1'

This line is too long. According to the PEP-8 indentation
recommendations [1], I would suggest:

CONN_INTERFACE_ROOM_CONFIG = \
'org.freedesktop.Telepathy.Channel.Interface.RoomConfig1'

> @@ -675,13 +676,47 @@ class _JoinCommand(_BaseCommand):
>  self_handle = self._global_self_handle
>  
>  if self_handle in added:

Since there's nothing else in this function that gets run if the
condition is False, it would make the code easier to read if we
converted this to guardian style. I.e.:

 if self_handle not in added:
return


> -if PROPERTIES_INTERFACE not in self.text_channel:
> -self._finished = True
> -self.emit('finished', None)
> -else:
> +# Use RoomConfig1 to configure the text channel. If this
> +# doesn't exist, fall-back on old-style PROPERTIES_INTERFACE.
> +if CONN_INTERFACE_ROOM_CONFIG in self.text_channel:
> +self.__update_room_config()
> +elif PROPERTIES_INTERFACE in self.text_channel:
>  self.text_channel[PROPERTIES_INTERFACE].ListProperties(
>  reply_handler=self.__list_properties_cb,
>  error_handler=self.__error_handler_cb)
> +else:
> +self._finished = True
> +self.emit('finished', None)

It seems the if/elif blocks and the else block now handle cases that are
different in nature. While if block vs. elif block distinguishes between
the versions of Telepathy in use, if/elif blocks vs. else block
seems to distinguish between different stages of the protocol. That's
fine, but a comment explaining the latter check would make this code
block easier to understand.


> +def __update_room_config(self):
> +# FIXME: invite-only ought to be set on private activities; but
> +# since only the owner can change invite-only, that would break
> +# activity scope changes.
> +props = {
> +# otherwise buddy resolution breaks
> +'Anonymous': False,
> +# anyone who knows about the channel can join
> +'InviteOnly': False,
> +# vanish when there are no members
> +'Persistent': False,
> +# don't appear in server room lists
> +'Private': True,
> +}

This part seems to be a direct copy of the corresponding block in
__list_properties_cb(). How about factoring it out into a class
constant?


[...]
> +def __room_cfg_error_cb(self, error):
> +# If RoomConfig update fails, it's probably because we don't have
> +# permission (e.g. we are not the session initiator). Thats OK -
> +# ignore the failure and carry on.
> +self._finished = True
> +self.emit('finished', None)

Would it be possible to check the error and log it if it doesn't match
our expectations (i.e. permission denied)?


Otherwise the patch is looking good, thanks!

Sascha

[1] http://www.python.org/dev/peps/pep-0008/#id12
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpEbdrNhjSjc.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar-toolkit] presence: use RoomConfig1 to configure channel properties (#3629)

2012-07-03 Thread Daniel Drake
On Tue, Jul 3, 2012 at 8:04 AM, Sascha Silbe  wrote:
> It seems the if/elif blocks and the else block now handle cases that are
> different in nature. While if block vs. elif block distinguishes between
> the versions of Telepathy in use, if/elif blocks vs. else block
> seems to distinguish between different stages of the protocol. That's
> fine, but a comment explaining the latter check would make this code
> block easier to understand.

I don't think its related to different stages in the protocol, but I
don't know a huge amount on this topic. Can you point me towards what
makes you think this so that I can write a good comment?

>> +def __update_room_config(self):
>> +# FIXME: invite-only ought to be set on private activities; but
>> +# since only the owner can change invite-only, that would break
>> +# activity scope changes.
>> +props = {
>> +# otherwise buddy resolution breaks
>> +'Anonymous': False,
>> +# anyone who knows about the channel can join
>> +'InviteOnly': False,
>> +# vanish when there are no members
>> +'Persistent': False,
>> +# don't appear in server room lists
>> +'Private': True,
>> +}
>
> This part seems to be a direct copy of the corresponding block in
> __list_properties_cb(). How about factoring it out into a class
> constant?

It's not a direct copy - the names are different, as are the set of
properties (mentioned in commit message).

I'll address the other comments, thanks.

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


Re: [Sugar-devel] Enable gnome-keyring to autostart in sugar-emulator

2012-07-03 Thread Daniel Narvaez
Thanks. Can you please push the patch with updated log?

On 3 July 2012 13:53, Caspar Bothmer  wrote:
> Hello Daniel,
>
> sorry, been busy...
>
> Sascha and me have discussed this issue thoroughly. The diff itself is easy,
> the reasoning behind is not.
>
> So we decided just to tell you how we would write this commit message and
> the diff to reflect the situation.  The commit message will become the
> entry in git log.  It's not enough to tell in your own words, what the diff
> is doing and giving the place, where this solution is outlined.
> You need to extract the relevant information, what you do and why.
>
> Caspar
>
>
> Subject: Enable gnome-keyring-daemon to start inside the emulated session.
>
> We have the following situation: there is an instance of gnome-keyring-daemon
> running on the machine.  But sugar-emulator can't access this instance of
> gnome-keyring-daemon, as it is outside the scope of sugar-emulator and not
> registered with the D-Bus session bus started by sugar-emulator.
> D-Bus tries to start a new instance of gnome-keyring-daemon, which fails due
> to a set of environment variables related to gnome-keyring-daemon.  These
> essentially make gnome-keyring-daemon try to initialize the existing instance
> of gnome-keyring-daemon outside the scope of sugar-emulator.
> By removing these environment variables, D-Bus can start a new instance of
> gnome-keyring-daemon and register with the D-Bus session.
>
> See
> https://bugzilla.gnome.org/show_bug.cgi?id=628302
> and
> https://live.gnome.org/GnomeKeyring/RunningDaemon
>
> for more information.
>
> ---
> bin/sugar.in|6 --
>  src/jarabe/util/emulator.py |7 +++
>  2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/bin/sugar.in b/bin/sugar.in
> index 12098db..2df0ab8 100644
> --- a/bin/sugar.in
> +++ b/bin/sugar.in
> @@ -62,12 +62,6 @@ export LANGUAGE="${LANGUAGE:-${LANG}}"
>  # Set Sugar's telepathy accounts directory
>  export MC_ACCOUNT_DIR=$HOME/.sugar/$SUGAR_PROFILE/accounts
>
> -# Workaround until gnome-keyring-daemon lets dbus activate it
> -# https://bugzilla.gnome.org/show_bug.cgi?id=628302
> -if test "$SUGAR_EMULATOR" = "yes" -a "$(type gnome-keyring-daemon)"; then
> -gnome-keyring-daemon --components=secrets &
> -fi
> -
>  # Source language settings and debug definitions
>  if [ -f ~/.i18n ]; then
>  . ~/.i18n
> diff --git a/src/jarabe/util/emulator.py b/src/jarabe/util/emulator.py
> index fda1b59..db34190 100644
> --- a/src/jarabe/util/emulator.py
> +++ b/src/jarabe/util/emulator.py
> @@ -120,6 +120,13 @@ def _start_window_manager():
>
>
>  def _setup_env(display, scaling, emulator_pid):
> +# We need to remove the environment related to gnome-keyring-daemon,
> +# so a new instance of gnome-keyring-daemon can be started and
> +# registered properly.
> +for variable in ['GPG_AGENT_INFO', 'SSH_AUTH_SOCK',
> + 'GNOME_KEYRING_CONTROL', 'GNOME_KEYRING_PID']:
> +if variable in os.environ:
> +del os.environ[variable]
> +
>  os.environ['SUGAR_EMULATOR'] = 'yes'
>  os.environ['GABBLE_LOGFILE'] = os.path.join(
>  env.get_profile_path(), 'logs', 'telepathy-gabble.log')



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


Re: [Sugar-devel] [PATCH sugar] Allow to build outside the source directory

2012-07-03 Thread Daniel Narvaez
Could a maintainer take a look please? It has been reviewed a few times now :)
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH sugar-base] Allow to build outside source directory

2012-07-03 Thread Daniel Narvaez
Ping

On 26 June 2012 15:06, Daniel Narvaez  wrote:
> From: Daniel Narvaez 
>
> ---
>  autogen.sh |   11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/autogen.sh b/autogen.sh
> index 3d12f8f..679c2bf 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -1,6 +1,15 @@
>  #!/bin/sh
> +
> +test -n "${srcdir}" || srcdir=`dirname "$0"`
> +test -n "${srcdir}" || srcdir="$(pwd)"
> +
> +olddir="$(pwd)"
> +cd "$srcdir"
> +
>  export ACLOCAL="aclocal -I m4"
>
>  intltoolize
>  autoreconf -i
> -./configure "$@"
> +
> +cd "$olddir"
> +"$srcdir/configure" "$@"
> --
> 1.7.10.2
>



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


Re: [Sugar-devel] [PATCH sugar-toolkit-gtk3] Allow to build outside source directory

2012-07-03 Thread Daniel Narvaez
Ping

On 26 June 2012 15:14, Daniel Narvaez  wrote:
> From: Daniel Narvaez 
>
> ---
>  autogen.sh |   11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/autogen.sh b/autogen.sh
> index f25b0a3..c5e1bf3 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -1,6 +1,15 @@
>  #!/bin/sh
> +
> +test -n "${srcdir}" || srcdir=`dirname "$0"`
> +test -n "${srcdir}" || srcdir="$(pwd)"
> +
> +olddir="$(pwd)"
> +cd "$srcdir"
> +
>  export ACLOCAL="aclocal -I m4"
>
>  intltoolize
>  autoreconf -i
> -./configure --enable-maintainer-mode "$@"
> +
> +cd "$olddir"
> +"$srcdir/configure" --enable-maintainer-mode "$@"
> --
> 1.7.10.2
>



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


Re: [Sugar-devel] [PATCH sugar-toolkit-gtk3] Allow to build outside source directory

2012-07-03 Thread Daniel Narvaez
Ping

On 3 July 2012 18:03, Daniel Narvaez  wrote:
> Ping
>
> On 26 June 2012 15:14, Daniel Narvaez  wrote:
>> From: Daniel Narvaez 
>>
>> ---
>>  autogen.sh |   11 ++-
>>  1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/autogen.sh b/autogen.sh
>> index f25b0a3..c5e1bf3 100755
>> --- a/autogen.sh
>> +++ b/autogen.sh
>> @@ -1,6 +1,15 @@
>>  #!/bin/sh
>> +
>> +test -n "${srcdir}" || srcdir=`dirname "$0"`
>> +test -n "${srcdir}" || srcdir="$(pwd)"
>> +
>> +olddir="$(pwd)"
>> +cd "$srcdir"
>> +
>>  export ACLOCAL="aclocal -I m4"
>>
>>  intltoolize
>>  autoreconf -i
>> -./configure --enable-maintainer-mode "$@"
>> +
>> +cd "$olddir"
>> +"$srcdir/configure" --enable-maintainer-mode "$@"
>> --
>> 1.7.10.2
>>
>
>
>
> --
> Daniel Narvaez



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


Re: [Sugar-devel] [REMINDER] Development team meeting --- 3 July 2012 (15:00 UTC)

2012-07-03 Thread Gonzalo Odiard
Minutes:
http://meeting.sugarlabs.org/sugar-meeting/meetings/2012-07-03T15:14:06.html
Log:
http://meeting.sugarlabs.org/sugar-meeting/meetings/2012-07-03T15:14:06
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Two strange files in sugar-toolkit-gtk3

2012-07-03 Thread S. Daniel Francis
Hi,
I was looking at the sources of sugar-toolkit-gtk3 and y found the
following 'strange' things to comment or ask why there are in
sugar-toolkit:

First: The module sugar.graphics.panel with this code:

class Panel(Gtk.VBox):

__gtype_name__ = 'SugarPanel'

def __init__(self):
GObject.GObject.__init__(self)

I think we can't be so children for make a class and only inherit from
Gtk.VBox. I would suggest to remove it.

The other is the module sugar.graphics.toolbox , those
toolbars-notebooks are too deprecated. Could we have only the Sugar
ToolbarBox in sugar-toolkit-gtk3?

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


Re: [Sugar-devel] [PATCH sugar-toolkit] presence: use RoomConfig1 to configure channel properties (#3629)

2012-07-03 Thread Sascha Silbe
Daniel Drake  writes:

> On Tue, Jul 3, 2012 at 8:04 AM, Sascha Silbe  
> wrote:
>> It seems the if/elif blocks and the else block now handle cases that are
>> different in nature. While if block vs. elif block distinguishes between
>> the versions of Telepathy in use, if/elif blocks vs. else block
>> seems to distinguish between different stages of the protocol. That's
>> fine, but a comment explaining the latter check would make this code
>> block easier to understand.
>
> I don't think its related to different stages in the protocol, but I
> don't know a huge amount on this topic. Can you point me towards what
> makes you think this so that I can write a good comment?

It's just what it looked like to me. If it isn't, a comment would be
even more important. So if you can figure out why we're doing this,
please add a corresponding note in the code. If you can't, please add a
FIXME. Code that we don't understand is likely to cause trouble in the
future.


>> This part seems to be a direct copy of the corresponding block in
>> __list_properties_cb(). How about factoring it out into a class
>> constant?
>
> It's not a direct copy - the names are different, as are the set of
> properties (mentioned in commit message).

You're right, I didn't look carefully enough.


> I'll address the other comments, thanks.

Thanks! I expect your next patch to be good enough, so here's my

Acked-by: Sascha Silbe 

However, please send the final patch to the list before pushing.

Sascha
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/


pgpqtvttS9Jh3.pgp
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH sugar-toolkit v2] presence: use RoomConfig1 to configure channel properties (#3629)

2012-07-03 Thread Daniel Drake
This code was still using regular Telepathy properties to
set important configuration such as Anonymous=False.

However, as of Telepathy specification 0.24.0, these properties have
gone away.

http://telepathy.freedesktop.org/spec/Channel_Type_Text.html
Changed in 0.24.0. This interface used to have a bunch of clunky
Telepathy.Properties. They have been removed in favour of D-Bus
properties on the Room2, Subject2 and RoomConfig1 interfaces.

Switch to using RoomConfig1 (where available) to set this
configuration. The invite-restricted flag is no longer available and
actually seems to have been removed a long while back.

Fixes sharing of activities over gabble on new platforms such
as Fedora 17.

Signed-off-by: Daniel Drake 
---
 src/sugar/presence/activity.py |   61 ++--
 1 file changed, 53 insertions(+), 8 deletions(-)

v2: incorporate review comments from Sascha Silbe.

diff --git a/src/sugar/presence/activity.py b/src/sugar/presence/activity.py
index 750a73c..3f0f1df 100644
--- a/src/sugar/presence/activity.py
+++ b/src/sugar/presence/activity.py
@@ -43,6 +43,8 @@ from sugar.presence.buddy import Buddy
 
 CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
 CONN_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
+CONN_INTERFACE_ROOM_CONFIG = \
+'org.freedesktop.Telepathy.Channel.Interface.RoomConfig1'
 
 _logger = logging.getLogger('sugar.presence.activity')
 
@@ -674,14 +676,57 @@ class _JoinCommand(_BaseCommand):
 else:
 self_handle = self._global_self_handle
 
-if self_handle in added:
-if PROPERTIES_INTERFACE not in self.text_channel:
-self._finished = True
-self.emit('finished', None)
-else:
-self.text_channel[PROPERTIES_INTERFACE].ListProperties(
-reply_handler=self.__list_properties_cb,
-error_handler=self.__error_handler_cb)
+if self_handle not in added:
+return
+
+# Use RoomConfig1 to configure the text channel. If this
+# doesn't exist, fall-back on old-style PROPERTIES_INTERFACE.
+if CONN_INTERFACE_ROOM_CONFIG in self.text_channel:
+self.__update_room_config()
+elif PROPERTIES_INTERFACE in self.text_channel:
+self.text_channel[PROPERTIES_INTERFACE].ListProperties(
+reply_handler=self.__list_properties_cb,
+error_handler=self.__error_handler_cb)
+else:
+# FIXME: when does this codepath get hit?
+# It could be related to no property configuration being available
+# in the selected backend, or it could be called at some stage
+# of the protocol when properties aren't available yet.
+self._finished = True
+self.emit('finished', None)
+
+def __update_room_config(self):
+# FIXME: invite-only ought to be set on private activities; but
+# since only the owner can change invite-only, that would break
+# activity scope changes.
+props = {
+# otherwise buddy resolution breaks
+'Anonymous': False,
+# anyone who knows about the channel can join
+'InviteOnly': False,
+# vanish when there are no members
+'Persistent': False,
+# don't appear in server room lists
+'Private': True,
+}
+room_cfg = self.text_channel[CONN_INTERFACE_ROOM_CONFIG]
+room_cfg.UpdateConfiguration(props,
+ reply_handler=self.__room_cfg_updated_cb,
+ error_handler=self.__room_cfg_error_cb)
+
+def __room_cfg_updated_cb(self):
+self._finished = True
+self.emit('finished', None)
+
+def __room_cfg_error_cb(self, error):
+# If RoomConfig update fails, it's probably because we don't have
+# permission (e.g. we are not the session initiator). Thats OK -
+# ignore the failure and carry on.
+if (error.get_dbus_name() !=
+'org.freedesktop.Telepathy.Error.PermissionDenied'):
+logging.error("Error setting room configuration: %s", error)
+self._finished = True
+self.emit('finished', None)
 
 def __list_properties_cb(self, prop_specs):
 # FIXME: invite-only ought to be set on private activities; but
-- 
1.7.10.4

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


[Sugar-devel] Ubuntu bugs

2012-07-03 Thread Daniel Narvaez
Hello,

I'm trying to support ubuntu in sugar-build, currently there are a
couple of problems and I opened bugs on launchpad for them.

https://bugs.launchpad.net/ubuntu/+source/pyabiword/+bug/1020074

This prevents Write to run at all.

https://bugs.launchpad.net/ubuntu/+source/dogtail/+bug/1020082

This prevent automated UI tests to work.


I don't know who is working on Ubuntu packages for sugar, but it would
be great if they could somehow contribute to these bugs. Now that
Browse works on Ubuntu maybe we can finally have good sugar packages
as in Fedora :)

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


Re: [Sugar-devel] Ubuntu bugs

2012-07-03 Thread Rafael Ortiz
On Tue, Jul 3, 2012 at 5:50 PM, Daniel Narvaez  wrote:

> Hello,
>
> I'm trying to support ubuntu in sugar-build, currently there are a
> couple of problems and I opened bugs on launchpad for them.
>
> https://bugs.launchpad.net/ubuntu/+source/pyabiword/+bug/1020074
>
> This prevents Write to run at all.
>
> https://bugs.launchpad.net/ubuntu/+source/dogtail/+bug/1020082
>
> This prevent automated UI tests to work.
>
>
> I don't know who is working on Ubuntu packages for sugar, but it would
> be great if they could somehow contribute to these bugs. Now that
> Browse works on Ubuntu maybe we can finally have good sugar packages
> as in Fedora :)
>
>
fwiw I managed to run sugar-jhbuild on ubuntu 12-0.4 (w/o write activity)
with the config/sysdeps attached.


Cheers.


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


  
  
  
  
  
  
  
  
  
  
  

  
  
  
  
  
  
  

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


Re: [Sugar-devel] Ubuntu bugs

2012-07-03 Thread Daniel Narvaez
Yeah, sugar-build runs out of the box, except for Write.

On 4 July 2012 03:57, Rafael Ortiz  wrote:
>
>
> On Tue, Jul 3, 2012 at 5:50 PM, Daniel Narvaez  wrote:
>>
>> Hello,
>>
>> I'm trying to support ubuntu in sugar-build, currently there are a
>> couple of problems and I opened bugs on launchpad for them.
>>
>> https://bugs.launchpad.net/ubuntu/+source/pyabiword/+bug/1020074
>>
>> This prevents Write to run at all.
>>
>> https://bugs.launchpad.net/ubuntu/+source/dogtail/+bug/1020082
>>
>> This prevent automated UI tests to work.
>>
>>
>> I don't know who is working on Ubuntu packages for sugar, but it would
>> be great if they could somehow contribute to these bugs. Now that
>> Browse works on Ubuntu maybe we can finally have good sugar packages
>> as in Fedora :)
>>
>
> fwiw I managed to run sugar-jhbuild on ubuntu 12-0.4 (w/o write activity)
> with the config/sysdeps attached.
>
>
> Cheers.
>
>>
>> --
>> Daniel Narvaez
>> ___
>> Sugar-devel mailing list
>> Sugar-devel@lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>



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