wistful / SublimeAutoPEP8

Automatically formats Python code to conform to the PEP 8 style guide using autopep8 and pep8 modules
144 stars 23 forks source link

Added .no-sublime-package to support Sublime3 #21

Closed danielmagnussons closed 11 years ago

danielmagnussons commented 11 years ago

No shortcuts worked in Sublime3.

Easy fix was to add .no-sublime-package, meaning package will not be packed in a *.sublime-package file.

Basic functionality is working now, ctrl+shift+p -> autoformat =)

wistful commented 11 years ago

Could you please explain this ? I've just checked shortcuts in ST3(#3037) and AutoPEP8(1.0.2) on Linux: it works.

danielmagnussons commented 11 years ago

Im using window7, x64.

  1. Installed AutoPep with packagemanager in sublime3.
  2. restart sublime3
  3. ctrl+shift+p, search "pep8" , no auto format options is visible, only key settings.

my fix; remove autopep8.sublime-package in Installed Packages/ and extract it into User/DataPackages/AutoPEP8/*

Restart sublime 3, search for pep, and "format" appears.

".no-sublime-package" automizes the extract thing i did in fix when installing with packagemanager

wistful commented 11 years ago

looks like plugin doesn't work with Windows(ST3) at all. The core issue is KeyError Exception: "There is no item named 'packages_py3\lib2to3\Grammar.txt' in the archive". Exception raises because ZipFile.extract(member, path=None, pwd=None) method waits member in Unix path, i.e. the correct member is 'packages_py3/lib2to3/Grammar.txt'. http://docs.python.org/3/library/zipfile.html?highlight=zipfile#zipfile.ZipFile.extract