[Sugar-devel] Experiment with Art4Apps

Gonzalo Odiard gonzalo at laptop.org
Sun Dec 8 22:41:42 EST 2013


I was playing a little with the Art4Apps images and data,
and created json files and a python module to mange that,
in a way to make easier to activities to use it.

Have a very basic api to get the information, like:

>>> from art4apps import Art4Apps
>>> aa = Art4Apps()
>>> aa.get_categories()
[u'houseware', u'letters', u'people', u'actions', u'colors', u'numbers',
u'tools', u'constructions', u'vegetables', u'emotions', u'sports',
u'other', u'bodyparts', u'jobs', u'nature', u'food', u'objects', u'plants',
u'animals', u'adjectives', u'fruits', u'furnitures', u'transports',
u'clothes']
>>> aa.get_words_by_category('colors')
[u'black', u'blue', u'brown', u'color', u'gray', u'green', u'mauve',
u'orange-color', u'pink', u'red', u'white', u'yellow']
>>> aa.get_languages()
['es']
>>> aa.get_translation('es', 'white')
u'blanco'
>>> aa.get_image_filename_by_word('penguin')
u'/usr/share/art4apps/images/penguin.png'

The data is in json format, to make easier use it in web activities too.

I have utilities to create the json files based in csv files,
and I plan create a utility to help in the translation to new languages,
displaying the images.

As a simple example, I have modified the Story, to use the Art4Apps images
if available (patch attached). Iwant modify Memorize activity too.

The art4apps rpm can be downloaded from:

http://dev.laptop.org/~gonzalo/art4apps-0.1-0.noarch.rpm

This is just a experiment, looking for feedback. I would like to know if
something like this can be used in Abecedarium, by example.

Gonzalo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131209/7c5a2847/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-art4apps-images-if-are-available.patch
Type: text/x-patch
Size: 2987 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20131209/7c5a2847/attachment.bin>


More information about the Sugar-devel mailing list