gedit-latex-plugin will not load

Bug #335538 reported by Alex Valavanis
74
This bug affects 9 people
Affects Status Importance Assigned to Milestone
gedit-latex-plugin (Ubuntu)
Fix Released
Undecided
Andrea Gasparini

Bug Description

Binary package hint: gedit-latex-plugin

When loading gedit in 32-bit Jaunty, the gedit-latex-plugin does not load:

The following message is displayed in the terminal:

ImportError: Import by filename is not supported.

** (gedit:22606): WARNING **: Error loading plugin 'Gedit LaTeX Plugin 0.2 rc1'

Revision history for this message
Rafael Sachetto (rsachetto) wrote :

I have the same bug here using jaunty with all updates applied. I have the problem either installing from the source or installing using apt.

ImportError: Import by filename is not supported.

** (gedit:11778): WARNING **: Error loading plugin 'Gedit LaTeX Plugin 0.2 rc1'

Changed in gedit-latex-plugin:
status: New → Confirmed
Revision history for this message
Alessandro Scarozza (xan.scale) wrote :

same bug in 64bit jaunty all updates

Revision history for this message
Adam Schreiber (sadam) wrote :
Revision history for this message
hannibal (hanniba1) wrote :

gedit doesn't accept a path like "GeditLaTeXPlugin/src" in Module-line of the "gedit-plugin"-file, so maybe this is the bug (it worked in intrepid-version of gedit)

a workaround for the gedit-latex-plugin could be to cut the files and folders from /usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src and paste in /usr/lib/gedit-2/plugins/GeditLateXPlugin and change in /usr/lib/gedit-2/plugins/GeditLateXPlugin.gedit-plugin "Module=GeditLaTeXPlugin/src" to "Module=GeditLaTeXPlugin"

Revision history for this message
Tobias Wolf (towolf) wrote :

Yes, that avoids the ImportError. But it gives this traceback:

DEBUG:LaTeXOutlineView:init
Traceback (most recent call last):
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/__init__.py", line 89, in activate
    self._window_decorators[window] = GeditWindowDecorator(window)
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/base/decorators.py", line 80, in __init__
    self._init_tab_decorators()
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/base/decorators.py", line 182, in _init_tab_decorators
    decorator = self._create_tab_decorator(tab, init=True)
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/base/decorators.py", line 585, in _create_tab_decorator
    decorator = GeditTabDecorator(self, tab, init)
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/base/decorators.py", line 646, in __init__
    self._adjust_editor()
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/base/decorators.py", line 714, in _adjust_editor
    editor_class.__init__(self._editor, self, file)
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/base/__init__.py", line 353, in __init__
    self.init(file, self._window_context)
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/latex/editor.py", line 102, in init
    self.__parse()
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/latex/editor.py", line 271, in __parse
    self._outline_view.set_outline(self._outline)
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/latex/views.py", line 228, in set_outline
    OutlineConverter().convert(self._store, outline, self._offset_map, self._context.active_editor.edited_file)
  File "/home/towolf/.gnome2/gedit/plugins/GeditLaTeXPlugin/base/__init__.py", line 1000, in active_editor
    return self._window_decorator._active_tab_decorator.editor
AttributeError: 'NoneType' object has no attribute 'editor'

Revision history for this message
Andrea Gasparini (gaspa) wrote :

The problem is due to python2.6 transitions. Code of g-l-p isn't tested with it.
I'll fix asap, or you'll have to wait upstream releasing a new revision.

Changed in gedit-latex-plugin (Ubuntu):
assignee: nobody → gaspa
Revision history for this message
Tobias Wolf (towolf) wrote :

That would be much appreciated.

Revision history for this message
Andrea Gasparini (gaspa) wrote :

I think I solved the problem, but I need some feedback.
Please do the following:
1) change /usr/lib/gedit-2/plugins/GeditLateXPlugin.gedit-plugin as said by hannibal:
from "Module=GeditLaTeXPlugin/src" to "Module=GeditLaTeXPlugin"
2) add a __init__.py file in /usr/lib/gedit-2/plugins/GeditLateXPlugin/, containing the following code:

#!/usr/bin/python
from src import *

3) restart gedit, and try to activate the plugin.

Let me know, if it'll solve completely the problem, I'll upload asap in both ubuntu and debian.
thanks.

Changed in gedit-latex-plugin (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Tobias Wolf (towolf) wrote :

Yes, it works. Don’t know if this is the right way to fix it, but it certainly does the trick.

Revision history for this message
Doyen Philippe (dyphil-deactivatedaccount) wrote :

I confirm it is working.

Revision history for this message
Tobias Wolf (towolf) wrote :

Could you also take care of the related compatibility problem in bug #338285 ?

Revision history for this message
Andrea Gasparini (gaspa) wrote :

@Tobias: the right way to fix is rework completely the plugin.
As said, python2.6 doesn't support calling __import__ with a directory name. (and it was somehow accidental that it worked until now).

Anyway: thanks for the feedback, I'll upload a new revision as soon as possible. :)

Revision history for this message
LaserJock (laserjock) wrote :

Well, Andrea's method but I still can't activate the Latex Plugin. It just becomes grey'ed out.

Revision history for this message
Andrea Gasparini (gaspa) wrote :

Jordan, if you have a bunch of time, please launch gedit from a terminal, and paste the output somewhere.
thanks!

Revision history for this message
Alex Valavanis (valavanisalex) wrote : Re: [Bug 335538] Re: gedit-latex-plugin will not load

Fix works for me. Thanks!

On Wed, Mar 25, 2009 at 3:46 PM, Andrea Gasparini <email address hidden> wrote:

> Jordan, if you have a bunch of time, please launch gedit from a terminal,
> and paste the output somewhere.
> thanks!
>
> --
> gedit-latex-plugin will not load
> https://bugs.launchpad.net/bugs/335538
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Andrea Gasparini (gaspa) wrote :

The diff should fix this, #328479, and some bug reported in debian.

Revision history for this message
Andrea Gasparini (gaspa) wrote :

updated patch:

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gedit-latex-plugin - 0.2rc1-1ubuntu1

---------------
gedit-latex-plugin (0.2rc1-1ubuntu1) jaunty; urgency=low

  * debian/rules: fixed calls to pysupport
  * debian/control:
    - added python-enchant as Recommends (LP: #328479)
  * debian/pathes/03_changes_for_python26.patch: make plugin work with
    python2.6 (LP: #335538)
  * debian/patches/04_name_clashing_with_bzr_gedit_plugin.patch: MenuToolAction clash
    with bzr plugin that has a gobject with the same name.

 -- Andrea Gasparini <email address hidden> Sat, 25 Mar 2009 18:10:46 +0100

Changed in gedit-latex-plugin:
status: In Progress → Fix Released
Revision history for this message
Marc Nieper-Wißkirchen (marc-nieper-wisskirchen) wrote :

I am not sure whether the bug was really fixed. I am using the version 0.2rc3 under Lucid. Whenever I want to toggle the embedded preview, it results in an error "'NoneType' object has no attribute 'editor'" as in post #5, which is displayed in a popup window.

The traceback here reads:
**
Traceback (most recent call last):
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/util.py", line 150, in decorated_function
    return function(*args, **kw)
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/latex/actions.py", line 267, in activate
    editor = context.active_editor
  File "/usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/base/__init__.py", line 1043, in active_editor
    return self._window_decorator._active_tab_decorator.editor
AttributeError: 'NoneType' object has no attribute 'editor'
**

Best,

Marc

Revision history for this message
Florian Demmer (fdemmer) wrote :

as Marc reported back in May, the plugin is still not working with Lucid. I too get the popup and traceback he reported.

Revision history for this message
karsibali (karsibali) wrote :

None of these worked for me either. I have maverick (10.10) installed here. I installed it from the repository.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.