abrookins / OpenSearchResult

a Sublime Text 2 plugin that opens files listed in the Find in File output
MIT License
21 stars 4 forks source link

fix: SublimeText 2 load of util #6

Closed Iristyle closed 11 years ago

Iristyle commented 11 years ago

Util.py was not loading with the following error:

Writing file /C/Users/Parity/AppData/Roaming/Sublime Text 2/Packages/OpenSearchResult/open_search_result.py with encoding UTF-8
Reloading plugin C:\Users\Parity\AppData\Roaming\Sublime Text 2\Packages\OpenSearchResult\open_search_result.py
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 62, in reload_plugin
    m = imp.load_module(modulename, *m_info)
  File ".\open_search_result.py", line 3, in <module>
    from .util import parse_line_number, is_file_path
ValueError: Attempted relative import in non-package

I have not verified this also works in ST3 -- but before pulling, you should do that.

abrookins commented 11 years ago

Thanks. It appears Python 3 deprecated implicit relative imports, so I'll need to do some fiddling to get imports to work in both ST 2 and ST 3.

As it stands, this patch will drop ST 3 support. ST 3 is in public beta now, if you're interested in taking a look at the issue.

If not, I'm a bit swamped right now but will try to get to it soon.

On Tue, Jul 16, 2013 at 9:17 AM, Ethan J. Brown notifications@github.com wrote:

Util.py was not loading with the following error:

Writing file /C/Users/Parity/AppData/Roaming/Sublime Text 2/Packages/OpenSearchResult/open_search_result.py with encoding UTF-8 Reloading plugin C:\Users\Parity\AppData\Roaming\Sublime Text 2\Packages\OpenSearchResult\open_search_result.py Traceback (most recent call last): File ".\sublime_plugin.py", line 62, in reload_plugin m = imp.load_module(modulename, *m_info) File ".\open_search_result.py", line 3, in from .util import parse_line_number, is_file_path ValueError: Attempted relative import in non-package

I have not verified this also works in ST3 -- but before pulling, you should do that.


You can merge this Pull Request by running

git pull https://github.com/Iristyle/OpenSearchResult patch-2

Or view, comment on, or merge it at:

https://github.com/abrookins/OpenSearchResult/pull/6

Commit Summary

fix: SublimeText 2 load of util

File Changes

M open_search_result.py (2)

Patch Links:

https://github.com/abrookins/OpenSearchResult/pull/6.patch https://github.com/abrookins/OpenSearchResult/pull/6.diff

Iristyle commented 11 years ago

No worries... Will see if I can learn enough python to fix it.

I'm a licensed sublime user, so I've had st3 installed for a while, but all the plugins I use weren't ported yet, so was stuck on 2.

When I get home, will see if this is applicable ...

http://stackoverflow.com/questions/1875259/importing-a-module-based-on-installed-python-version

-e On Jul 21, 2013 4:57 AM, "Andrew Brookins" notifications@github.com wrote:

Thanks. It appears Python 3 deprecated implicit relative imports, so I'll need to do some fiddling to get imports to work in both ST 2 and ST 3.

As it stands, this patch will drop ST 3 support. ST 3 is in public beta now, if you're interested in taking a look at the issue.

If not, I'm a bit swamped right now but will try to get to it soon.

On Tue, Jul 16, 2013 at 9:17 AM, Ethan J. Brown notifications@github.com wrote:

Util.py was not loading with the following error:

Writing file /C/Users/Parity/AppData/Roaming/Sublime Text 2/Packages/OpenSearchResult/open_search_result.py with encoding UTF-8 Reloading plugin C:\Users\Parity\AppData\Roaming\Sublime Text 2\Packages\OpenSearchResult\open_search_result.py Traceback (most recent call last): File ".\sublime_plugin.py", line 62, in reload_plugin m = imp.load_module(modulename, *m_info) File ".\open_search_result.py", line 3, in from .util import parse_line_number, is_file_path ValueError: Attempted relative import in non-package

I have not verified this also works in ST3 -- but before pulling, you should do that.


You can merge this Pull Request by running

git pull https://github.com/Iristyle/OpenSearchResult patch-2

Or view, comment on, or merge it at:

https://github.com/abrookins/OpenSearchResult/pull/6

Commit Summary

fix: SublimeText 2 load of util

File Changes

M open_search_result.py (2)

Patch Links:

https://github.com/abrookins/OpenSearchResult/pull/6.patch https://github.com/abrookins/OpenSearchResult/pull/6.diff

— Reply to this email directly or view it on GitHubhttps://github.com/abrookins/OpenSearchResult/pull/6#issuecomment-21307135 .

Iristyle commented 11 years ago

FYI -- I think this should do the trick on the import....

Iristyle commented 11 years ago

I just verified in ST3 as well -- no problemo -- works like a charm.

abrookins commented 11 years ago

Thanks! I appreciate you looking into this.