Quem usa o gcompris e atualizou o Ubuntu para a versão 9.04 (Jaunty Jackalope) deve ter percebido que o gcompris administration não está disponível. Quando se tenta abrir aparece uma janela do gcompris em branco.
Esse bug foi relatado no bugzilla do Ubuntu (
Bug #371603).Como é uma página em outro idioma, resolvi escrever esse tópico para futuras referências dos usuários da comunidade Brasil.
Quando se roda o gcompris do terminal aparece a seguinte mensagem de erro:
derosa@bowman:~$ gcompris -a --nolockcheck
exec_prefix NULL
XF86VidMode: Compiled with XF86VidMode.
If you have problems starting GCompris in fullscreen, try the -x option to disable XF86VidMode.
** (process:16014): WARNING **: Binary relocation disabled
package_data_dir = /usr/share/gcompris/boards
package_locale_dir = /usr/share/locale
package_plugin_dir = /usr/lib/gcompris
package_python_plugin_dir= /usr/share/gcompris/python
/usr/share/themes/Guadalinex/gtk-2.0/gtkrc:56: Clearlooks configuration option "menuitemstyle" is not supported and will be ignored.
/usr/share/themes/Guadalinex/gtk-2.0/gtkrc:57: Clearlooks configuration option "listviewitemstyle" is not supported and will be ignored.
/usr/share/themes/Guadalinex/gtk-2.0/gtkrc:58: Clearlooks configuration option "progressbarstyle" is not supported and will be ignored.
Infos:
Config dir '/home/derosa/.config/gcompris'
Users dir '/home/derosa/My GCompris'
Database '/home/derosa/.config/gcompris/gcompris_sqlite.db'
Traceback (most recent call last):
File "/usr/share/gcompris/python/administration.py", line 89, in start
exec('from admin import module_' + module + ' as ' + module)
File "<string>", line 1, in <module>
File "/usr/share/gcompris/python/admin/module_profiles.py", line 28, in <module>
import profile_list
File "/usr/share/gcompris/python/admin/profile_list.py", line 38, in <module>
import profile_edit
File "/usr/share/gcompris/python/admin/profile_edit.py", line 231
def __create_model(self, with, profile_id):
^
SyntaxError: invalid syntax
derosa@bowman:~$
A sintaxe inválida aponta para a palavra "with" do arquivo profile_edit.py (arquivo python). Na verdade são três os arquivos comprometidos. Faça o Backup deles. No terminal:
sudo cp /usr/share/gcompris/python/admin/profile_edit.py /usr/share/gcompris/python/admin/profile_edit.py.bkp && sudo cp /usr/share/gcompris/python/admin/class_edit.py /usr/share/gcompris/python/admin/class_edit.py.bkp && sudo cp /usr/share/gcompris/python/admin/group_edit.py /usr/share/gcompris/python/admin/group_edit.py.bkp
Abra o arquivo profile_edit.py para edição.
sudo gedit /usr/share/gcompris/python/admin/profile_edit.py
Aperte Ctrl + I para escolher a linha do arquivo. digite 228
Aparecerá umas linhas assim:
# profile_id: only groups in this profile are inserted
# If with = True, create a list only with groups in the given profile_id
# False, create a list only with groups NOT this profile_id
- def __create_model(self, with, profile_id):
Na linha marcada com o sinal de menos substitua o "with"por "create _list". Obs.: O sinal "-" na última linha da citação não existe.
Pressione as teclas "Crtrl + I" novamente e digite agora 257
# Insert the class name in the group
group = (group[0], class_name, group[1], group[2])
- if(with and group_is_already):
self.add_group_in_model(model, group)
- elif(not with and not group_is_already):
self.add_group_in_model(model, group)
return model
Agora, substitua novamente nas duas linhas marcadas com "-" a palavra "with" por "create_list".
Salve e feche o gedit.
Abra o arquivo class_edit.py:
sudo gedit /usr/share/gcompris/python/admin/class_edit.py
Repita o processo na linha 228
# If class_id is provided, only users in this class are inserted
# If with = True, create a list only with the given class_id.
# False, create a list only without the given class_id
- def __create_model(self, with, class_id):
# Grab the user data
- if(with):
Ficará assim:
# If class_id is provided, only users in this class are inserted
# If with = True, create a list only with the given class_id.
# False, create a list only without the given class_id
+ def __create_model(self, create_list, class_id):
# Grab the user data
+ if(create_list):
Obs.: O sinal "+" na última e na antepenúltima linha da citação também é inexistente servindo apenas de marcação.
Salve e feche.
Abra agora o arquivo group_edit:
sudo gedit /usr/share/gcompris/python/admin/group_edit.py
Vá a linha 233:
# group_id: only users in this group are inserted
# If with = True, create a list only with user in the given class_id and group_id.
# False, create a list only with user in the given class_id but NOT this group_id
- def __create_model(self, with, class_id, group_id):
Deverá ficar assim:
# group_id: only users in this group are inserted
# If with = True, create a list only with user in the given class_id and group_id.
# False, create a list only with user in the given class_id but NOT this group_id
+ def __create_model(self, create_list, class_id, group_id)
E na linha 252:
user_is_already = self.cur.fetchall()
- if(with and user_is_already):
self.add_user_in_model(model, user)
- elif(not with and not user_is_already):
self.add_user_in_model(model, user)
Editada ficará assim:
user_is_already = self.cur.fetchall()
+ if(create_list and user_is_already):
self.add_user_in_model(model, user)
+ elif(not create_list and not user_is_already):
self.add_user_in_model(model, user)
Salve e feche o arquivo.
Pronto agora rode o gcompris administration:
gcompris -a --nolockcheck