Autor Tópico: [resolvido]Gcompris Administrartion indisponível no Ubuntu 9.04 Jaunty Jackalope  (Lida 2200 vezes)

Offline thglara

  • Usuário Ubuntu
  • *
  • Mensagens: 12
  • Sonho com um mundo livre.
    • Ver perfil
    • Diário de Bordo da Judite
  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:
Citar
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:
Citar
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.

Citar
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:
Citar
     # 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
Citar
             # 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:
Citar
sudo gedit /usr/share/gcompris/python/admin/class_edit.py

Repita o processo na linha 228

Citar
     # 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:
Citar
     # 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:
Citar
sudo gedit /usr/share/gcompris/python/admin/group_edit.py

Vá a linha 233:
Citar
     # 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:

Citar
     # 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:

Citar
             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:

Citar
             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:
Citar
gcompris -a --nolockcheck
Leia meu blogue: http://www.diariodajudite.bogspot.com

O Diário de Bordo da Judite, abrange vários temas inclusive o mundo opensource visto por um usuário comum.

Offline pigdin

  • Usuário Ubuntu
  • *
  • Mensagens: 723
  • Terra - Brasill - SP-Capital
    • Ver perfil
Opa! Valeu vou verificar.

O G compris de uma hora para outra passou a falar em ingles???

Vou ter também que configurar o locale, mas o speedy hoje tá uma derma.

abraço.


EDITADO!

Beleza resolveu aqui.

Instalei o pacote gcompris-sound-ptbr e resolveu o idioma falado.

« Última modificação: 16 de Julho de 2009, 10:21 por pigdin »
Desk: Phenom X3 2GB DDR II - Win 7 / Ubuntu 10.04 64 Bits
Note MUB: Core2Duo 4GB - Win7 / Ubuntu 10.04 / Bodhi Linux.
@alexpigdin

Offline pigdin

  • Usuário Ubuntu
  • *
  • Mensagens: 723
  • Terra - Brasill - SP-Capital
    • Ver perfil
Tem um bug no jogo dos pinguins violinistas, às vezes alguns pinguins não emitem som.
Desk: Phenom X3 2GB DDR II - Win 7 / Ubuntu 10.04 64 Bits
Note MUB: Core2Duo 4GB - Win7 / Ubuntu 10.04 / Bodhi Linux.
@alexpigdin