 
     @storeFocusedElement()
 
+    @setLoading('Running Flake8 Linter...')
+
     if @previouslyFocusedElement[0] and @previouslyFocusedElement[0] isnt document.body
       @eventElement = @previouslyFocusedElement[0]
     else
       @eventElement = atom.views.getView(atom.workspace)
-    @keyBindings = atom.keymap.findKeyBindings(target: @eventElement)
 
-    @setLoading('Running Flake8 Linter...')
-
-    # atom.workspaceView.append(this)
-    # @focusFilterEditor()
     filePath = editor.getPath()
 
     flake filePath, (errors) =>

    ignoreErrors: ""
    mcCabeComplexityThreshold: ""
    validateOnSave: true

  @activate: ->
    view = new SimpleFlake8View
    @disposable = atom.commands.add 'atom-workspace', 'simple-flake8:toggle', -> view.toggle()

  # @activate: ->
  #   new SimpleFlake8View

  @deactivate: ->
    @disposable.dispose()

  cancelled: -> @hide()

  activate: (state) ->
    atom.workspaceView.command 'simple-flake8:toggle', => @toggle()

    else
      @attach()

  show: ->
    # Get out of here unless this is a python file
    editor = atom.workspace.getActiveEditor()
    return unless editor?
    return unless editor.getGrammar().name == 'Python'


    @panel ?= atom.workspace.addModalPanel(item: this)
