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 575771 - I can't activate the opensubs plugin
I can't activate the opensubs plugin
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Subtitle Downloader plugin
2.25.x
Other Linux
: Normal major
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-03-17 23:42 UTC by Ignacio Casal Quinteiro (nacho)
Modified: 2011-04-08 13:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
opensubs (451 bytes, patch)
2009-03-17 23:50 UTC, Ignacio Casal Quinteiro (nacho)
committed Details | Review

Description Ignacio Casal Quinteiro (nacho) 2009-03-17 23:42:58 UTC
nacho@ansalon:~/Projects/gtk+$ totem
/var/lib/python-support/python2.6/gdata/tlslite/utils/cryptomath.py:9: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  import sha
Traceback (most recent call last):
  • File "/usr/local/lib/totem/plugins/opensubtitles/opensubtitles.py", line 26 in <module>
    LANGUAGES_STR = [(D_('iso_639_3', 'Albanian'), 'sq'),
NameError: name 'D_' is not defined

** (totem:2853): WARNING **: Could not load plugin opensubtitles


** (totem:2853): WARNING **: Error, impossible to activate plugin 'Subtitle Downloader'
Comment 1 Ignacio Casal Quinteiro (nacho) 2009-03-17 23:50:40 UTC
Created attachment 130861 [details] [review]
opensubs

This just reverts the latest changes in the plugin.
Comment 2 Gabor Kelemen 2009-03-18 16:33:27 UTC
I see this too on Ubuntu, with 2.26.0.
Comment 3 Philip Withnall 2009-03-18 22:21:50 UTC
Fixed on trunk and the gnome-2-26 branch. The fix should be released in a .1 tarball release tomorrow.

There's got to be a better way to fix this (in src/plugins/totem/__init__.py) on trunk for the future, though. I tried, and I can't understand why what we had didn't work; we need a Python guru. Leaving bug open to deal with improving the fix on trunk.

2009-03-18  Philip Withnall  <philip@tecnocode.co.uk>

	* src/plugins/opensubtitles/opensubtitles.py: Brown paper bag revert
	of part of the last commit to fix the OpenSubtitles plugin.
	(Closes: #575771)
Comment 4 Bastien Nocera 2009-06-30 16:50:01 UTC
Is that the trick: http://katzj.livejournal.com/453658.html

"
import gettext
_ = lambda x: gettext.ldgettext(domain, x)
N_ = lambda x: x
"
Comment 5 Philip Withnall 2009-07-08 15:21:47 UTC
(In reply to comment #4)
> Is that the trick: http://katzj.livejournal.com/453658.html

Nope. The case seems to be that whatever's defined in the "totem" module (totem/__init__.py) doesn't make it into the scope of opensubtitles.py. However, __init__.py is definitely executed sometime, because print statements from it make it to the console.

In fact, the contents of __init__.py are executed even if they're not included by opensubtitles.py. This leaves the question of what exactly opensubtitles.py is including when it includes the "totem" module. It's got to be loading something, because (e.g.) `import "madeupmodulename"` errors out.

Help.
Comment 6 Philip Withnall 2011-04-08 13:08:48 UTC
This shouldn't be relevant since we switched to GIR; the totem Python module is now gone.