[Sugar-devel] From GConf to GSettings

Ignacio Rodríguez nachoel01 at gmail.com
Thu Dec 26 18:08:35 EST 2013


Thx,
"xo_WelcomeWeb" I uploaded a new version without gconf (I copied the
activity.py accidently)

2013/12/26, Daniel Narvaez <dwnarvaez at gmail.com>:
> Thanks this awesome.
>
> It seems these can be split in
>
> 1 Sugar settings. /desktop/sugar/...
> 2 Activity setting. /apps/...
>
> For the all keys in group 1, I think we to keep setting them for a while
> both in gconf and in gsettings. They are API and just breaking it would be
> bad. We should deprecate them now and remove them later. I think Gonzalo
> suggestion to have python methods to access the most common might be a good
> idea, but IMO it's not sufficient and not necessary for the plain port
> (other GCI task?).
>
> About group 2, I think we should figure out what it would take to make
> gsettings schemas work for activities. Then it will be easier to discuss if
> we want that to be our suggested way to store settings for activities. I
> don't think it should block porting the sugar core to gsettings though,
> it's another step (and perhaps another GCI task).
>
> I think it's important to document what activity authors should be doing
> here (once we figured it out exactly). Perhaps that's something we should
> put in sugar-docs? We have no python activities documentation there yet,
> but if we never start...
>
> On 26 December 2013 21:00, Gonzalo Odiard <gonzalo at laptop.org> wrote:
>
>> I did a search in all the xo I have downloaded from ASLO two months ago,
>> then, can be a little outdated but is useful as reference.
>>
>> Of 682 .xo files, only 36 read values from gconf.
>>
>> Looking for "client.get_" :
>>
>> grep -in client.get_ *.py | grep -v get_default | wc -l
>>     100
>>
>> But many are reading nick/color:
>>
>> [gonzalo at localhost gconf_use]$ grep -in client.get_ *.py | grep nick | wc
>> -l
>> 23
>> [gonzalo at localhost gconf_use]$ grep -in client.get_ *.py | grep color |
>> wc -l
>> 34
>> And a few get the value of '/desktop/sugar/power/automatic'
>> grep -in client.get_ *.py | grep power | wc -l
>> 10
>>
>> The other are in 15 activities:
>>
>> [gonzalo at localhost gconf_use]$ grep -in client.get_ *.py | grep -v
>> get_default | grep -v nick | grep -v color | grep -v power | awk -F '.'
>> '{print $2}' | sort -u
>> xo_AmazonasTortuga
>> xo_Browse
>> xo_FileShare
>> xo_IconChange
>> xo_Labyrinth
>> xo_Mirage
>> xo_MouseCam
>> xo_TortugadeMexico
>> xo_TurtleArtMini
>> xo_TurtleBlocks
>> xo_TurtleBots
>> xo_TurtleConfusion
>> xo_TurtleFlags
>> xo_WelcomeWeb
>> xo_Write
>>
>> [gonzalo at localhost gconf_use]$ grep -in client.get_ *.py | grep -v
>> get_default | grep -v nick | grep -v color | grep -v power
>> addon-4024-latest.xo_Browse.activity_webactivity.py:92:    backup_url =
>> client.get_string('/desktop/sugar/backup_url')
>> addon-4024-latest.xo_Browse.activity_webactivity.py:97:    jabber_server
>> = client.get_string(
>>
>> addon-4027-latest.xo_TurtleBlocks.activity_collaboration_neighborhood.py:797:
>>        server = client.get_string(
>> addon-4027-latest.xo_TurtleBlocks.activity_TurtleArtActivity.py:133:
>>        if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4027-latest.xo_TurtleBlocks.activity_TurtleArtActivity.py:135:
>>        if not self.client.get_int(self._COORDINATE_SCALE) in [0, 1]:
>> addon-4027-latest.xo_TurtleBlocks.activity_turtleblocks.py:234:
>>  if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4027-latest.xo_TurtleBlocks.activity_turtleblocks.py:237:
>>  if not self.client.get_int(self._COORDINATE_SCALE) in [0, 1]:
>> addon-4078-latest.xo_Labyrinth.activity_src_Browser.py:96: width =
>> self.config_client.get_int ('/apps/labyrinth/width')
>> addon-4078-latest.xo_Labyrinth.activity_src_Browser.py:97: height =
>> self.config_client.get_int ('/apps/labyrinth/height')
>> addon-4078-latest.xo_Labyrinth.activity_src_Browser.py:98:
>> utils.use_bezier_curves
>> = self.config_client.get_bool ('/apps/labyrinth/curves')
>> addon-4078-latest.xo_Labyrinth.activity_src_Browser.py:109: sort_order =
>> self.config_client.get_int('/apps/labyrinth/map_sort_order')
>> addon-4078-latest.xo_Labyrinth.activity_src_Browser.py:110: column_id =
>> self.config_client.get_int('/apps/labyrinth/map_sort_order_column')
>> addon-4078-latest.xo_Labyrinth.activity_src_MainWindow.py:221: if not
>> self.config_client.get_bool('/apps/labyrinth/show_tree_view'):
>> addon-4201-latest.xo_Write.activity_speechtoolbar.py:109:
>>  speech.pitch = self._cnf_client.get_int('/desktop/sugar/speech/pitch')
>> addon-4201-latest.xo_Write.activity_speechtoolbar.py:110:
>>  speech.rate = self._cnf_client.get_int('/desktop/sugar/speech/rate')
>> addon-4201-latest.xo_Write.activity_speechtoolbar.py:139:        value =
>> client.get_int(key)
>> addon-4266-latest.xo_FileShare.activity_FileShareActivity.py:116:
>>    jabber_serv =
>> client.get_string("/desktop/sugar/collaboration/jabber_server")
>>
>> addon-4298-latest.xo_TurtleArtMini.activity_collaboration_neighborhood.py:797:
>>        server = client.get_string(
>> addon-4298-latest.xo_TurtleArtMini.activity_TurtleArtActivity.py:124:
>>    if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4298-latest.xo_TurtleArtMini.activity_turtleblocks.py:222:
>>  if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4363-latest.xo_Mirage.activity_mirage.py:698: style =
>> client.get_string('/desktop/gnome/interface/toolbar_style')
>> addon-4363-latest.xo_Mirage.activity_pippy_app.py:700: style =
>> client.get_string('/desktop/gnome/interface/toolbar_style')
>> addon-4434-latest.xo_TurtleBots.activity_collaboration_neighborhood.py:797:
>>        server = client.get_string(
>> addon-4434-latest.xo_TurtleBots.activity_TurtleArtActivity.py:124:
>>  if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4434-latest.xo_TurtleBots.activity_turtleblocks.py:222:        if
>> self.client.get_int(self._HOVER_HELP) == 1:
>>
>> addon-4450-latest.xo_TurtleConfusion.activity_collaboration_neighborhood.py:797:
>>        server = client.get_string(
>> addon-4450-latest.xo_TurtleConfusion.activity_TurtleArtActivity.py:138:
>>          if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4450-latest.xo_TurtleConfusion.activity_turtleconfusion.py:226:
>>    if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4487-latest.xo_MouseCam.activity_activity.py:137:
>>  gconf_persist_value = self.client.get_float('/apps/mousecam/adj')
>> addon-4487-latest.xo_MouseCam.activity_activity.py:149:
>>  gconf_persist_value = self.client.get_int('/apps/mousecam/threshold')
>>
>> addon-4585-latest.xo_AmazonasTortuga.activity_collaboration_neighborhood.py:797:
>>        server = client.get_string(
>> addon-4585-latest.xo_AmazonasTortuga.activity_TurtleArtActivity.py:132:
>>      if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4585-latest.xo_AmazonasTortuga.activity_turtleblocks.py:222:
>>  if self.client.get_int(self._HOVER_HELP) == 1:
>>
>> addon-4668-latest.xo_TortugadeMexico.activity_collaboration_neighborhood.py:797:
>>        server = client.get_string(
>> addon-4668-latest.xo_TortugadeMexico.activity_TurtleArtActivity.py:133:
>>      if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4668-latest.xo_TortugadeMexico.activity_turtleblocks.py:223:
>>  if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4682-latest.xo_TurtleFlags.activity_collaboration_neighborhood.py:797:
>>        server = client.get_string(
>> addon-4682-latest.xo_TurtleFlags.activity_TurtleArtActivity.py:140:
>>      if self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4682-latest.xo_TurtleFlags.activity_turtleflags.py:225:        if
>> self.client.get_int(self._HOVER_HELP) == 1:
>> addon-4683-latest.xo_IconChange.activity_Widgets.py:45:    value =
>> client.get_string(path)
>> addon-4697-latest.xo_WelcomeWeb.activity_activity.py:345:    face =
>> client.get_string('/desktop/sugar/font/default_face')
>> addon-4697-latest.xo_WelcomeWeb.activity_activity.py:346:    size =
>> client.get_float('/desktop/sugar/font/default_size')
>>
>> For better analysis or peer review, you can get the files where I found
>> the string gconf/GConf
>> here http://dev.laptop.org/~gonzalo/gconf_use.zip
>>
>> If someone want download all the xo files in aslo, I have a script to do
>> it,
>> but would be good discuss with the infrastructure team before we start to
>> do massive downloads.
>> Probably there are a better way to do it.
>>
>> My proposals:
>>
>> * Activities should use sugar3.profile get_nick_name() and get_color()
>> methods.
>> * Other popular/needed sugar configurations (power mode, speech
>> configurations)should be available as methods in the toolkit.
>>
>> Gonzalo
>>
>>
>>
>>
>>
>>
>> On Thu, Dec 26, 2013 at 5:17 PM, Daniel Narvaez
>> <dwnarvaez at gmail.com>wrote:
>>
>>> On 26 December 2013 18:17, Daniel Narvaez <dwnarvaez at gmail.com> wrote:
>>>
>>>>
>>>> About activities, there is probably a way to make them ship schemas but
>>>> I'm wondering what's the advantage for them to use gsettings vs a json
>>>> or
>>>> ini file. It feels like added complexity without real advantages.
>>>>
>>>
>>> Gonzalo pointed out that deployments are using the gconf tools to set
>>> stuff like Write font. That''s probably a good use case.
>>> Still I hope we can deal with activity specific settings separately in
>>> the port (perhaps even a separated GCI task?).
>>>
>>> --
>>> Daniel Narvaez
>>>
>>> _______________________________________________
>>> Sugar-devel mailing list
>>> Sugar-devel at lists.sugarlabs.org
>>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>>
>>>
>>
>
>
> --
> Daniel Narvaez
>


-- 
Saludos.
Ignacio Rodríguez


More information about the Sugar-devel mailing list