naksu / cfengine_beautifier

CFEngine configuration file beautifier
MIT License
9 stars 5 forks source link

Fails to load in SublimeText 3 (Build 3063) #1

Closed MerlinDMC closed 10 years ago

MerlinDMC commented 10 years ago

Seems as if it refuses to accept the relative package name.

reloading plugin cfengine_beautifier.cfengine_beautify_sublime
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 73, in reload_plugin
    m = importlib.import_module(modulename)
  File "./importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/Users/MerlinDMC/Library/Application Support/Sublime Text 3/Packages/cfengine_beautifier/cfengine_beautify_sublime.py", line 6, in <module>
    from cfbeautifier import beautifier
ImportError: No module named 'cfbeautifier'

This diff makes it like itself in SublimeText 3 but I don't have SublimeText 2 here to test against:

diff --git a/cfengine_beautify_sublime.py b/cfengine_beautify_sublime.py
index 5592e31..e6efe03 100644
--- a/cfengine_beautify_sublime.py
+++ b/cfengine_beautify_sublime.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import
-from cfbeautifier import beautifier
-from cfbeautifier.util import ParserError
+from .cfbeautifier import beautifier
+from .cfbeautifier.util import ParserError
 import sublime, sublime_plugin

 STATUS_KEY = 'cfengine-beautifier'
naksu commented 10 years ago

Thanks for the report. The plugin should load now, but there is still an error "Unable to create 'cfbeautifier/parsetab.py'"