After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 686772 - gaupol and apertium
gaupol and apertium
Status: RESOLVED NOTGNOME
Product: gaupol
Classification: Other
Component: general
0.15.1
Other Linux
: Normal normal
: ---
Assigned To: gaupol-maint@gnome.bugs
gaupol-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-10-24 09:35 UTC by freacer
Modified: 2012-10-24 21:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description freacer 2012-10-24 09:35:37 UTC
Tried to get the apertium extension working in gaupol as described here: http://wiki.apertium.org/wiki/Translating_subtitles

and the only result i get was this. 


Traceback

File: usr/share/gaupol/lib/gaupol/gtk/dialogs/preferences.py
Line: 282
In: _on_tree_view_selection_changed

    sensitive = self.manager.has_help(module)

File: usr/share/gaupol/lib/gaupol/gtk/extensionman.py
Line: 127
In: has_help

    extension = self._active[module]

KeyError: 'apertium'

Platform

Linux-2.6.32-44-generic-pae-i686-with-Ubuntu-10.04-lucid

Versions

Gaupol: 0.15.1
Python: 2.6.5
GTK+: 2.20.1
PyGTK: 2.17.0
PyEnchant: 1.5.3
Universal Encoding Detector: 2.0.1
Comment 1 Osmo Salomaa 2012-10-24 16:08:36 UTC
I can't tell what happens from that traceback. You could try starting gaupol from a terminal window and see if there's any error output.

But gaupol 0.15.1 is old and the extension system was rather new having been introduced in 0.14. I'd recommend you try gaupol 0.19.2 [1]. The lastest version is 0.20, but that uses some newer libraries and the apertium extension is to my knowledge not yet ported to those.

[1] http://download.gna.org/gaupol/0.19/gaupol-0.19.2.tar.gz
Comment 2 freacer 2012-10-24 17:18:32 UTC
output in terminal
$ gaupol
Traceback (most recent call last):
  • File "/usr/share/gaupol/lib/gaupol/gtk/extensionman.py", line 167 in setup_extension
    try: mobj = __import__(module, {}, {}, [])
  • File "/home/erik/.local/share/gaupol/extensions/apertium/apertium.py", line 16 in <module>
    import aeidon
ImportError: No module named aeidon
/usr/share/gaupol/lib/gaupol/gtk/agents/update.py:197: DeprecationWarning: use gtk.Statusbar.remove_message
  self.statusbar.remove(0, self._message_id)

Downloaded gaupol-0.19.2
running straight from the unpacked bin dir. 
had to point in preferences the right apertium dir. But then, also different errors, and while i do have installed quite some apertium files, no choice of translate from - to what i expected. 

Thanks!
Comment 3 Osmo Salomaa 2012-10-24 17:29:59 UTC
(In reply to comment #2)
> Downloaded gaupol-0.19.2
> running straight from the unpacked bin dir.

Don't try run from the bin dir! And you probably even didn't if you used command 'gaupol' instead of './gaupol'.

Run from the source top-level directory and use command 'bin/gaupol' or 'python bin/gaupol'. That way python will find the correct aeidon and gaupol packages instead of trying to use your 0.15.1 in /usr.
Comment 4 freacer 2012-10-24 17:44:23 UTC
ok
output of first one
erik@erik:~/Escritorio/gaupol-0.19.2$ bin/gaupol
getopt: opción inválida -- l
WARNING: /usr/bin/apertium -l returned 1
['USAGE:', 'apertium', '[-d', 'datadir]', '[-f', 'format]', '[-u]', '<translation>', '[in', '[out]]', '-d', 'datadir', 'directory', 'of', 'linguistic', 'data', '-f', 'format', 'one', 'of:', 'txt', '(default),', 'html,', 'rtf,', 'odt,', 'docx,', 'wxml,', 'xlsx,', 'pptx', '-a', 'display', 'ambiguity', '-u', "don't", 'display', 'marks', "'*'", 'for', 'unknown', 'words', '-m', 'memory.tmx', 'use', 'a', 'translation', 'memory', 'to', 'recycle', 'translations', '-o', 'translation', 'translation', 'direction', 'using', 'the', 'translation', 'memory,', 'by', 'default', "'translation'", 'is', 'used', 'instead', 'translation', 'typically,', 'LANG1-LANG2,', 'but', 'see', 'modes.xml', 'in', 'language', 'data', 'in', 'input', 'file', '(stdin', 'by', 'default)', 'out', 'output', 'file', '(stdout', 'by', 'default)']
getopt: opción inválida -- l
WARNING: /usr/bin/apertium -l returned 1
WARNING: cannot translate without a project!
ACTIVATED
WARNING: /usr/bin/apertium -f html  language /tmp/infile.tmp /tmp/outfile.tmp returned 1
Traceback (most recent call last):
  • File "/home/erik/.local/share/gaupol/extensions/apertium/apertium.py", line 154 in _on_translate_activate
    self.format(page.project.subtitles)))
  • File "/home/erik/.local/share/gaupol/extensions/apertium/apertium.py", line 203 in translate
    fout = open(outfile, "r")
IOError: [Errno 2] No existe el fichero o el directorio: '/tmp/outfile.tmp'

crashed on the missing outfile.tmp

and output of the python one:

erik@erik:~/Escritorio/gaupol-0.19.2$ python bin/gaupol
getopt: opción inválida -- l
WARNING: /usr/bin/apertium -l returned 1
['USAGE:', 'apertium', '[-d', 'datadir]', '[-f', 'format]', '[-u]', '<translation>', '[in', '[out]]', '-d', 'datadir', 'directory', 'of', 'linguistic', 'data', '-f', 'format', 'one', 'of:', 'txt', '(default),', 'html,', 'rtf,', 'odt,', 'docx,', 'wxml,', 'xlsx,', 'pptx', '-a', 'display', 'ambiguity', '-u', "don't", 'display', 'marks', "'*'", 'for', 'unknown', 'words', '-m', 'memory.tmx', 'use', 'a', 'translation', 'memory', 'to', 'recycle', 'translations', '-o', 'translation', 'translation', 'direction', 'using', 'the', 'translation', 'memory,', 'by', 'default', "'translation'", 'is', 'used', 'instead', 'translation', 'typically,', 'LANG1-LANG2,', 'but', 'see', 'modes.xml', 'in', 'language', 'data', 'in', 'input', 'file', '(stdin', 'by', 'default)', 'out', 'output', 'file', '(stdout', 'by', 'default)']
getopt: opción inválida -- l
WARNING: /usr/bin/apertium -l returned 1
ACTIVATED
WARNING: /usr/bin/apertium -f html  directory /tmp/infile.tmp /tmp/outfile.tmp returned 1
Traceback (most recent call last):
  • File "/home/erik/.local/share/gaupol/extensions/apertium/apertium.py", line 154 in _on_translate_activate
    self.format(page.project.subtitles)))
  • File "/home/erik/.local/share/gaupol/extensions/apertium/apertium.py", line 203 in translate
    fout = open(outfile, "r")
IOError: [Errno 2] No existe el fichero o el directorio: '/tmp/outfile.tmp'


It always crashes as soon as a double click on one of the options of apertium. 
tried language, directory. And there comes the crash.
Comment 5 Osmo Salomaa 2012-10-24 17:59:17 UTC
(In reply to comment #4)
> WARNING: cannot translate without a project!

Seems like you don't have a file open in gaupol.

"Now open a subtitle file and click the Apertium menu and Translate"

-- http://wiki.apertium.org/wiki/Translating_subtitles
Comment 6 freacer 2012-10-24 18:12:53 UTC
oh yes sorry, that was my second intent, but the other two intents i had a file open. 

and now again. first of all. I cannot choose input nor output language. 
Secondly the /tmp/outfile.tmp cannot be created. which is a fatal error. 

erik@erik:~/Escritorio/gaupol-0.19.2$ python bin/gaupol
getopt: opción inválida -- l
WARNING: /usr/bin/apertium -l returned 1
['USAGE:', 'apertium', '[-d', 'datadir]', '[-f', 'format]', '[-u]', '<translation>', '[in', '[out]]', '-d', 'datadir', 'directory', 'of', 'linguistic', 'data', '-f', 'format', 'one', 'of:', 'txt', '(default),', 'html,', 'rtf,', 'odt,', 'docx,', 'wxml,', 'xlsx,', 'pptx', '-a', 'display', 'ambiguity', '-u', "don't", 'display', 'marks', "'*'", 'for', 'unknown', 'words', '-m', 'memory.tmx', 'use', 'a', 'translation', 'memory', 'to', 'recycle', 'translations', '-o', 'translation', 'translation', 'direction', 'using', 'the', 'translation', 'memory,', 'by', 'default', "'translation'", 'is', 'used', 'instead', 'translation', 'typically,', 'LANG1-LANG2,', 'but', 'see', 'modes.xml', 'in', 'language', 'data', 'in', 'input', 'file', '(stdin', 'by', 'default)', 'out', 'output', 'file', '(stdout', 'by', 'default)']
ACTIVATED
WARNING: /usr/bin/apertium -f html  output /tmp/infile.tmp /tmp/outfile.tmp returned 1
Traceback (most recent call last):
  • File "/home/erik/.local/share/gaupol/extensions/apertium/apertium.py", line 154 in _on_translate_activate
    self.format(page.project.subtitles)))
  • File "/home/erik/.local/share/gaupol/extensions/apertium/apertium.py", line 203 in translate
    fout = open(outfile, "r")
IOError: [Errno 2] No existe el fichero o el directorio: '/tmp/outfile.tmp'

Comment 7 Osmo Salomaa 2012-10-24 18:23:01 UTC
(In reply to comment #6)
> and now again. first of all. I cannot choose input nor output language. 
> Secondly the /tmp/outfile.tmp cannot be created. which is a fatal error.

This is probably because of

> WARNING: /usr/bin/apertium -l returned 1

But I'm not at all familiar with apertium or this extension. I suggest you contact the extension author. gaupol itself seems to me is working fine here.
Comment 8 freacer 2012-10-24 18:28:09 UTC
Ok, thanks!