Permalink
Browse files

Clean up imports

  • Loading branch information...
1 parent ab342b6 commit ea8eb869ff856ca41ec71dfae6a6e5fa61a1f347 @jisaacks committed Dec 13, 2012
Showing with 14 additions and 14 deletions.
  1. +2 −2 git_gutter.py
  2. +5 −5 git_gutter_events.py
  3. +5 −5 git_gutter_handler.py
  4. +2 −2 view_collection.py
View
4 git_gutter.py
@@ -1,12 +1,12 @@
import sublime
import sublime_plugin
-import view_collection
+from view_collection import ViewCollection
class GitGutterCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.clear_all()
- (inserted, modified, deleted) = view_collection.ViewCollection.diff(self.view)
+ (inserted, modified, deleted) = ViewCollection.diff(self.view)
self.lines_removed(deleted)
self.lines_added(inserted)
View
10 git_gutter_events.py
@@ -1,18 +1,18 @@
import sublime
import sublime_plugin
-import view_collection
+from view_collection import ViewCollection
class GitGutterEvents(sublime_plugin.EventListener):
def on_load(self, view):
- view_collection.ViewCollection.add(view)
+ ViewCollection.add(view)
def on_modified(self, view):
if view.settings().get('git_gutter_live_mode', True):
- view_collection.ViewCollection.add(view)
+ ViewCollection.add(view)
def on_clone(self, view):
- view_collection.ViewCollection.add(view)
+ ViewCollection.add(view)
def on_post_save(self, view):
- view_collection.ViewCollection.add(view)
+ ViewCollection.add(view)
View
10 git_gutter_handler.py
@@ -2,13 +2,13 @@
import sublime
import subprocess
import re
-import view_collection
+from view_collection import ViewCollection
class GitGutterHandler:
def __init__(self, view):
self.view = view
- self.git_temp_file = view_collection.ViewCollection.git_tmp_file(self.view)
- self.buf_temp_file = view_collection.ViewCollection.buf_tmp_file(self.view)
+ self.git_temp_file = ViewCollection.git_tmp_file(self.view)
+ self.buf_temp_file = ViewCollection.buf_tmp_file(self.view)
if self.on_disk():
self.git_tree = git_helper.git_tree(self.view)
self.git_dir = git_helper.git_dir(self.git_tree)
@@ -37,12 +37,12 @@ def update_git_file(self):
# the git repo won't change that often
# so we can easily wait 5 seconds
# between updates for performance
- if view_collection.ViewCollection.git_time(self.view) > 5:
+ if ViewCollection.git_time(self.view) > 5:
self.git_temp_file.truncate()
args = ['git','--git-dir='+self.git_dir,'--work-tree='+self.git_tree,'show','head:'+self.git_path]
try:
subprocess.call(args, stdout=self.git_temp_file)
- view_collection.ViewCollection.update_git_time(self.view)
+ ViewCollection.update_git_time(self.view)
except Exception:
pass
View
4 view_collection.py
@@ -1,4 +1,3 @@
-import git_gutter_handler
import tempfile
import time
@@ -11,7 +10,8 @@ class ViewCollection:
@staticmethod
def add(view):
key = ViewCollection.get_key(view)
- ViewCollection.views[key] = git_gutter_handler.GitGutterHandler(view)
+ from git_gutter_handler import GitGutterHandler
+ ViewCollection.views[key] = GitGutterHandler(view)
ViewCollection.views[key].reset()
@staticmethod

0 comments on commit ea8eb86

Please sign in to comment.