editorconfig / editorconfig-gedit

EditorConfig plugin for Gedit
http://editorconfig.org
Other
54 stars 13 forks source link

Doesn't load on Ubuntu 12.04 #6

Closed mdrmike closed 9 years ago

mdrmike commented 9 years ago

Version=0.5.3 doesn't load on Ubuntu 12.04 ... ?

Tried a couple previous tags, and no luck. Maybe I'm missing something obvious... but could use some guidance.

treyhunner commented 9 years ago

@mediadoneright thanks for reporting this. A stack trace would help diagnose this.

You can find a stack trace that should note the exact error by closing Gedit and running it from a terminal:

gedit

Then enable the EditorConfig plugin and see what errors appear.

mdrmike commented 9 years ago

hope this helps ...

Traceback (most recent call last):
  File "/home/foo/.local/share/gedit/plugins/editorconfig_gedit3.py", line 1, in <module>
    from editorconfig_plugin.gedit3 import *
  File "/home/foo/.local/share/gedit/plugins/editorconfig_plugin/gedit3.py", line 27, in <module>
    from .shared import EditorConfigPluginMixin
  File "/home/foo/.local/share/gedit/plugins/editorconfig_plugin/shared.py", line 9, in <module>
    from editorconfig import get_properties, EditorConfigError
ImportError: No module named 'editorconfig'

(gedit:5219): libpeas-WARNING **: Error loading plugin 'editorconfig_gedit3'

FWIW, I'm actually on (master: cd097ca) -- but appears only changes in master since v0.5.3 TAG are to readme.md

johnfraney commented 9 years ago

I can reproduce this issue. The error goes away and the plugin works as expected if you install the EditorConfig Python package: pip install EditorConfig

xuhdev commented 9 years ago

@johnfraney The problem is that it should always fall back to the bundled Core package.

johnfraney commented 9 years ago

Ah, makes sense. I also dug around editorconfig_plugin/shared.py to see what was going on there. The editorconfig-core-py folder isn't anywhere to be found. My .local/share/gedit/plugins/ folder contains the following files/folders after installing:

editorconfig_gedit3.py  editorconfig_plugin/  editorconfig.plugin

Maybe I'm missing something, but there's no mention of the editorconfig-core-py folder in the installer.

Edit: Also, isn't the plugin's working directory .local/share/gedit/plugins/? If so, shared.py is looking for the editorconfig-core-py folder in .local/share/gedit/:

editorconfig_path = abspath('../editorconfig-core-py/')