Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get plugin to work in gedit 3.14 (Debian Testing) #6

Closed
speendo opened this issue Jan 3, 2015 · 9 comments
Closed

Cannot get plugin to work in gedit 3.14 (Debian Testing) #6

speendo opened this issue Jan 3, 2015 · 9 comments
Assignees

Comments

@speendo
Copy link

speendo commented Jan 3, 2015

I cannot get the plugin running on Debian x64 (Testing) with gedit 3.14

Here's the error message:
http://imgur.com/htAc538

Please contact me, if I can provide any additional information.

@bittner
Copy link
Owner

bittner commented Jan 4, 2015

Can you please start gedit from a terminal, reproduce the situation of the screenshot, and paste the error output (in the terminal) here?
Most probably, some paths are different on Debian as opposed to Ubuntu, or you're using Python 2.7 instead of Python 3.

@speendo
Copy link
Author

speendo commented Jan 4, 2015

Thanks for the reply!

I'd love to, but when I start gedit in a terminal, I don't "see it" in the terminal anymore.

I type "$ gedit", a gedit window opens but the terminal shows me a new prompt.

I thought, maybe gedit is backgrounded, but "$ fg" wouldn't get it to the foreground as well.

I don't know how to get debug information. Do you have an idea?

@bittner
Copy link
Owner

bittner commented Jan 4, 2015

I'm running gedit version 3.10.4 in a GNOME Terminal version 3.6.2 on an (Ed)ubuntu 14.04 Trusty box, and it opens in foreground spitting out (debug) output on the console. -- Try one of the following:

  • Make sure only one gedit instance is running
  • Try using standalone mode (--standalone), run gedit --help for more options
  • Try gnome-text-editor
  • Check whether gedit points to a binary, or it's an alias, or whatever (alias gedit, which gedit, ls -lAF --color=auto $(which gedit), ps aux | grep [g]edit, ...)
  • Install and use reptyr, e.g.
sudo apt-get install reptyr
PID=`ps -A | grep [g]edit | sed -E -e 's/\s*//' -e 's/\s+.*//'`
reptyr -s $PID

As soon as you can see text output of gedit on the terminal console go to Edit -> Preferences -> Plugins in gedit, and deactivate and re-activate the reST plugin.

@speendo
Copy link
Author

speendo commented Jan 4, 2015

Hey!

gnome-text-editor worked. Cool!

Here's the output:

$ gnome-text-editor
ImportError: No module named 'reST'

(gnome-text-editor:2287): libpeas-WARNING **: Error loading plugin 'reST'

By the way - Python 3 is at least installed - but Python 2.7 is the standard.

@bittner
Copy link
Owner

bittner commented Jan 4, 2015

Good, so the plugin (i.e. the Python module reST) is not found in the gedit plugins folder.

  • Can you please follow the installation process step by step, and let me know whether both the reST folder and the reST.plugin file are in either your local or the system's global plugin folder for gedit?
  • Also check whether there are any other working gedit plugins, and where their code is located. You may try to place the reST plugin to the same location.

@speendo
Copy link
Author

speendo commented Jan 4, 2015

Thank you for your support!

Previously I linked the plugin and the reST-folder to the /plugins-folder. Obviously, that didn't work. Now I copied them there, which solved the issue. I can now activate the plugin. However, the plugin doesn't work yet. I get

$ gnome-text-editor
Traceback (most recent call last):
  File "/home/<username>/.local/share/gedit/plugins/reST/__init__.py", line 116, in do_activate
    bottom.add_item(scrolled_window, "rest-preview", "reStructuredText Preview", image)
AttributeError: 'Stack' object has no attribute 'add_item'

Maybe it's my fault (again) and not the fault of the plugin.

@bittner bittner changed the title Cannot get plugin to work in gedit 3.14 Cannot get plugin to work in gedit 3.14 (Debian Testing) Jan 4, 2015
@bittner
Copy link
Owner

bittner commented Jan 4, 2015

Looks like an API change that other gedit plugins experience as well (e.g. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746430 and related changes). I'll try to figure out what to do (in order to keep the plugin working also for gedit < v3.12). Would be nice if you could play the guinea pig and test the resulting code. Please drop me an email (see my profile).

@speendo
Copy link
Author

speendo commented Jan 5, 2015

of course!

@bittner
Copy link
Owner

bittner commented Jan 13, 2015

I have overhauled the code base, and the basics of the plugin are now working in Gedit 3.14. The working code is currently in the gedit-3.14 branch. Please clone the source code as follows and follow the README:

$ git clone -b gedit-3.14 git@github.com:bittner/gedit-reST-plugin.git

Thanks @speendo for testing even though you're already using another editor!

Rendering is automatic at the moment (i.e. each change triggers a re-generation of the HTML to be displayed). I couldn't manage to integrate the menu actions yet (Ctrl+R to render, etc.). I would clean up the source files afterwards and "release" version 3.14 by tagging a commit. (PRs welcome!)
Until then please use the gedit-3.14 branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants