Skip to content

Commit

Permalink
Update jsbeautify to 1.6.2 and six to 1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieug committed Mar 29, 2016
1 parent 9cf8e82 commit 08131e9
Show file tree
Hide file tree
Showing 51 changed files with 1,744 additions and 3,559 deletions.
18 changes: 2 additions & 16 deletions js_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# Python 2.x on Windows can't properly import from non-ASCII paths, so
# this code added the DOC 8.3 version of the lib folder to the path in
# case the user's username includes non-ASCII characters


def add_lib_path(lib_path):
def _try_get_short_path(path):
path = os.path.normpath(path)
Expand All @@ -34,32 +32,22 @@ def _try_get_short_path(path):
# crazyness to get jsbeautifier.unpackers to actually import
# with sublime's weird hackery of the path and module loading
add_lib_path(libs_path)
add_lib_path(os.path.join(libs_path, "six-1.8.0"))
add_lib_path(os.path.join(libs_path, "jsbeautifier"))
add_lib_path(os.path.join(libs_path, "jsbeautifier", "jsbeautifier"))
add_lib_path(src_path)

import jsbeautifier
import jsbeautifier.unpackers
import jsf
import jsf_activation
import jsf_rc
import jsbeautifier, jsbeautifier.unpackers
import jsf, jsf_activation, jsf_rc

s = None


def plugin_loaded():
global s
s = sublime.load_settings("JsFormat.sublime-settings")

if is_py2k:
plugin_loaded()


class PreSaveFormatListner(sublime_plugin.EventListener):

"""Event listener to run JsFormat during the presave event"""

def on_pre_save(self, view):
extOrClause = "|".join(s.get("format_on_save_extensions"))
extRegex = "\\.(" + extOrClause + ")$"
Expand All @@ -72,9 +60,7 @@ def on_pre_save(self, view):
return
view.run_command("js_format")


class JsFormatCommand(sublime_plugin.TextCommand):

def run(self, edit):
settings = self.view.settings()
file_name = self.view.file_name()
Expand Down
2 changes: 0 additions & 2 deletions libs/jsbeautifier/MANIFEST.in

This file was deleted.

548 changes: 366 additions & 182 deletions libs/jsbeautifier/jsbeautifier/__init__.py → libs/jsbeautifier/__init__.py
100755 → 100644

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions libs/jsbeautifier/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.6.2'
Loading

0 comments on commit 08131e9

Please sign in to comment.