Skip to content

Commit

Permalink
fix #418 - refactor supporting code into its own library
Browse files Browse the repository at this point in the history
Abstract out Sublime Text-related helpers, utils, etc.
  • Loading branch information
guillermooo committed Nov 6, 2014
1 parent 8746884 commit c589f06
Show file tree
Hide file tree
Showing 61 changed files with 271 additions and 363 deletions.
6 changes: 3 additions & 3 deletions AAA.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import os

from Dart.lib.sdk import SDK
from Dart.lib.panels import OutputPanel
from Dart.sublime_plugin_lib.panels import OutputPanel
from Dart.lib.error import FatalConfigError
from Dart.lib.io import touch
from Dart.sublime_plugin_lib.io import touch
from Dart.lib import ga


Expand Down Expand Up @@ -52,7 +52,7 @@ def check_install():
touch(install_record)
with open(install_record, 'wt') as f:
f.write('autogenerated file. please do not delete.')

ga.Event(category='actions',
action='install',
label='Plugin installed',
Expand Down
102 changes: 0 additions & 102 deletions __init__.py

This file was deleted.

14 changes: 7 additions & 7 deletions analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import threading
import time

from Dart import PluginLogger
from Dart.lib.sublime import after
from Dart.sublime_plugin_lib import PluginLogger
from Dart.sublime_plugin_lib.sublime import after
from Dart.lib.editor_context import EditorContext
from Dart.lib.error import ConfigError
from Dart.lib.analyzer import actions
Expand All @@ -25,14 +25,14 @@
from Dart.lib.analyzer.response import Response
from Dart.lib.analyzer.response import ResponseMaker
from Dart.lib.analyzer.response import ResponseType
from Dart.lib.path import find_pubspec_path
from Dart.lib.path import is_active
from Dart.lib.path import is_view_dart_script
from Dart.lib.plat import supress_window
from Dart.sublime_plugin_lib.path import find_pubspec_path
from Dart.sublime_plugin_lib.path import is_active
from Dart.sublime_plugin_lib.path import is_view_dart_script
from Dart.sublime_plugin_lib.plat import supress_window
from Dart.lib.sdk import SDK
from Dart.lib.analyzer.queue import AnalyzerQueue
from Dart.lib.analyzer.queue import TaskPriority
from Dart.lib.panels import OutputPanel
from Dart.sublime_plugin_lib.panels import OutputPanel


_logger = PluginLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion cmds_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sublime
import sublime_plugin

from Dart import PluginLogger
from Dart.sublime_plugin_lib import PluginLogger
from Dart import analyzer


Expand Down
18 changes: 9 additions & 9 deletions dartlint.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
import threading
import queue

from . import PluginLogger
from .lib.panels import OutputPanel
from .lib.path import extension_equals
from .lib.path import is_dart_script
from .lib.path import is_view_dart_script
from .lib.plat import is_windows
from .lib.plat import supress_window
from .lib.pub_package import PubspecFile
from .lib.sdk import SDK
from Dart.sublime_plugin_lib import PluginLogger
from Dart.lib.panels import OutputPanel
from Dart.lib.path import extension_equals
from Dart.lib.path import is_dart_script
from Dart.lib.path import is_view_dart_script
from Dart.lib.plat import is_windows
from Dart.lib.plat import supress_window
from Dart.lib.pub_package import PubspecFile
from Dart.lib.sdk import SDK

_logger = PluginLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

from Default.exec import ProcessListener
from Default.exec import AsyncProcess
from Dart.lib.sublime import after
from Dart.sublime_plugin_lib.sublime import after

from Dart.lib.panels import OutputPanel
from Dart.sublime_plugin_lib.panels import OutputPanel


class DartExecCommand(sublime_plugin.WindowCommand, ProcessListener):
Expand Down
4 changes: 2 additions & 2 deletions format.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import sublime
import sublime_plugin

from Dart import PluginLogger
from Dart.lib.plat import supress_window
from Dart.sublime_plugin_lib import PluginLogger
from Dart.sublime_plugin_lib.plat import supress_window
from Dart.lib.sdk import DartFormat

from subprocess import PIPE
Expand Down
4 changes: 2 additions & 2 deletions lib/analyzer/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import sublime

from Dart import PluginLogger
from Dart.lib.panels import OutputPanel
from Dart.sublime_plugin_lib import PluginLogger
from Dart.sublime_plugin_lib.panels import OutputPanel


_logger = PluginLogger(__name__)
Expand Down
6 changes: 3 additions & 3 deletions lib/analyzer/pipe_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from subprocess import PIPE
import threading

from Dart import PluginLogger
from Dart.lib.plat import supress_window
from Dart.lib.path import pushd
from Dart.sublime_plugin_lib import PluginLogger
from Dart.sublime_plugin_lib.plat import supress_window
from Dart.sublime_plugin_lib.path import pushd


_logger = PluginLogger(__name__)
Expand Down
6 changes: 3 additions & 3 deletions lib/analyzer/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

import threading

from Dart import PluginLogger
from Dart.lib.path import is_active
from Dart.lib.path import is_active_path
from Dart.sublime_plugin_lib import PluginLogger
from Dart.sublime_plugin_lib.path import is_active
from Dart.sublime_plugin_lib.path import is_active_path


_logger = PluginLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion lib/analyzer/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import queue

from Dart import PluginLogger
from Dart.sublime_plugin_lib import PluginLogger


_logger = PluginLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions lib/base_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import os

from Dart.lib.pub_package import PubPackage
from Dart.lib.panels import ErrorPanel
from Dart import PluginLogger
from Dart.sublime_plugin_lib.panels import ErrorPanel
from Dart.sublime_plugin_lib import PluginLogger


_logger = PluginLogger(__name__)
Expand Down
6 changes: 3 additions & 3 deletions lib/dart_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import os

from Dart.lib.path import find_pubspec_path
from Dart.lib.out_there.yaml import load
from Dart.lib.path import is_view_dart_script
from Dart.sublime_plugin_lib.path import find_pubspec_path
from Dart.out_there.yaml import load
from Dart.sublime_plugin_lib.path import is_view_dart_script


class DartProject(object):
Expand Down
2 changes: 1 addition & 1 deletion lib/editor_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import threading

from Dart.lib.panels import OutputPanel
from Dart.sublime_plugin_lib.panels import OutputPanel


class EditorContext(object):
Expand Down
6 changes: 3 additions & 3 deletions lib/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# All rights reserved. Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.)

from Dart import PluginLogger
from Dart.sublime_plugin_lib import PluginLogger

_logger = PluginLogger(__name__)

Expand All @@ -14,9 +14,9 @@ class EventSource(object):

handlers = {
ON_PUB_BUILD: [],
ON_DART_RUN: [],
ON_DART_RUN: [],
}

def raise_event(self, source, name, *args, **kwargs):
for handler in EventSource.handlers.get(name, []):
handler(source.__class__.__qualname__, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion lib/ga.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import urllib.request
import random

from Dart import PluginLogger
from Dart.sublime_plugin_lib import PluginLogger
from Dart.lib.sdk import SDK


Expand Down
Loading

0 comments on commit c589f06

Please sign in to comment.