Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Fixes various deprecation issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
lexicalunit committed May 22, 2015
1 parent d290a8a commit eb0ed3a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
14 changes: 10 additions & 4 deletions lib/index.coffee
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
6 changes: 3 additions & 3 deletions lib/python-isort.coffee
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -37,7 +37,7 @@ class PythonIsort
statusBarElement.text(message)

getFilePath: ->
editor = atom.workspace.getActiveEditor()
editor = atom.workspace.getActiveTextEditor()
return editor.getPath()

checkImports: ->
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit eb0ed3a

Please sign in to comment.