From eb0ed3a2ad2caedefc54a53b69bb1eaef7c753bc Mon Sep 17 00:00:00 2001 From: lexicalunit Date: Fri, 22 May 2015 00:02:37 -0500 Subject: [PATCH] Fixes various deprecation issues. --- lib/index.coffee | 14 ++++++++++---- lib/python-isort.coffee | 6 +++--- package.json | 6 ++++-- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/index.coffee b/lib/index.coffee index 4d0b5ae..3f4b863 100644 --- a/lib/index.coffee +++ b/lib/index.coffee @@ -1,10 +1,16 @@ PythonIsort = require './python-isort' module.exports = - configDefaults: - isortPath: "isort" - sortOnSave: false - checkOnSave: true + config: + isortPath: + type: 'string' + default: 'isort' + sortOnSave: + type: 'boolean' + default: false + checkOnSave: + type: 'boolean' + default: true activate: -> pi = new PythonIsort() diff --git a/lib/python-isort.coffee b/lib/python-isort.coffee index 166709d..8ffb600 100644 --- a/lib/python-isort.coffee +++ b/lib/python-isort.coffee @@ -1,12 +1,12 @@ fs = require 'fs' -$ = require('atom').$ +$ = require 'jquery' process = require 'child_process' module.exports = class PythonIsort checkForPythonContext: -> - editor = atom.workspace.getActiveEditor() + editor = atom.workspace.getActiveTextEditor() if not editor? return false return editor.getGrammar().name == 'Python' @@ -37,7 +37,7 @@ class PythonIsort statusBarElement.text(message) getFilePath: -> - editor = atom.workspace.getActiveEditor() + editor = atom.workspace.getActiveTextEditor() return editor.getPath() checkImports: -> diff --git a/package.json b/package.json index 54f3eac..a85583f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "repository": "https://github.com/bh/atom-python-isort", "license": "MIT", "engines": { - "atom": ">0.50.0" + "atom": ">=0.185.0 <2.0.0" }, - "dependencies": {} + "dependencies": { + "jquery": "^2.1.4" + } }