Commits

Konstantin Kabanov committed 05de665

variables renamed back

  • Participants
  • Parent commits 34f57b7

Comments (0)

Files changed (1)

File sublime_tfs.py

         self.auto_checkout_enabled = settings.get("auto_checkout_enabled", True)
         self.cwd = os.path.expandvars('%HOMEDRIVE%\\')
 
-    def is_under_tfs(self, p_path):
-        return self.status(p_path)
+    def is_under_tfs(self, path):
+        return self.status(path)
 
-    def checkout(self, p_path):
-        if self.auto_checkout_enabled or sublime.ok_cancel_dialog("Checkout " + p_path + "?"):
-            return self.run_command("checkout", p_path)
+    def checkout(self, path):
+        if self.auto_checkout_enabled or sublime.ok_cancel_dialog("Checkout " + path + "?"):
+            return self.run_command("checkout", path)
         else:
             return (False, "Checkout is cancelled by user!")
 
-    def checkin(self, p_path):
-        return self.run_command("checkin", p_path, True)
+    def checkin(self, path):
+        return self.run_command("checkin", path, True)
 
-    def undo(self, p_path):
-        return self.run_command("undo", p_path)
+    def undo(self, path):
+        return self.run_command("undo", path)
 
-    def history(self, p_path):
-        return self.run_command("history", p_path, True)
+    def history(self, path):
+        return self.run_command("history", path, True)
 
-    def add(self, p_path):
-        return self.run_command("add", p_path)
+    def add(self, path):
+        return self.run_command("add", path)
 
-    def get_latest(self, p_path):
-        return self.run_command("get", p_path)
+    def get_latest(self, path):
+        return self.run_command("get", path)
 
-    def difference(self, p_path):
-        return self.run_command("difference", p_path, True)
+    def difference(self, path):
+        return self.run_command("difference", path, True)
 
-    def delete(self, p_path):
-        return self.run_command("delete", p_path)
+    def delete(self, path):
+        return self.run_command("delete", path)
 
-    def status(self, p_path):
-        return self.run_command("status", p_path)
+    def status(self, path):
+        return self.run_command("status", path)
 
-    def annotate(self, p_path):
-        return self.run_command("annotate", p_path, True, True)
+    def annotate(self, path):
+        return self.run_command("annotate", path, True, True)
 
-    def auto_checkout(self, p_path):
-        if self.status(p_path)[0]:
-            return self.checkout(p_path)
+    def auto_checkout(self, path):
+        if self.status(path)[0]:
+            return self.checkout(path)
         else:
             return (False, "")
 
-    def run_command(self, command, p_path, is_graph = False, is_tfpt = False):
-        commands = [self.tfpt_path if is_tfpt else self.tf_path, command, p_path]
+    def run_command(self, command, path, is_graph = False, is_tfpt = False):
+        commands = [self.tfpt_path if is_tfpt else self.tf_path, command, path]
         if (is_graph):
             p = subprocess.Popen(commands, cwd=self.cwd)
         else:
 
 class TfsRunnerThread(threading.Thread):
     """docstring for ClearLogTread"""
-    def __init__(self, p_path, method):
+    def __init__(self, path, method):
         super(TfsRunnerThread, self).__init__()
         self.method = method
-        self.m_path = p_path
+        self.m_path = path
         self.success = False
         self.message = ""
 
 
 class TfsCheckoutCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.checkout)
+            thread = TfsRunnerThread(path, manager.checkout)
             thread.start()
-            ThreadProgress(self.view, thread, "Checkout...", "Checkout success: %s" % v_path)
+            ThreadProgress(self.view, thread, "Checkout...", "Checkout success: %s" % path)
 
 class TfsUndoCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.undo)
+            thread = TfsRunnerThread(path, manager.undo)
             thread.start()
-            ThreadProgress(self.view, thread, "Undo...", "Undo success: %s" % v_path)
+            ThreadProgress(self.view, thread, "Undo...", "Undo success: %s" % path)
 
 class TfsCheckinCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
-            if (not isReadonly(v_path)):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
+            if (not isReadonly(path)):
                 self.view.run_command('save')
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.checkin)
+            thread = TfsRunnerThread(path, manager.checkin)
             thread.start()
-            ThreadProgress(self.view, thread, "Checkin...", "Checkin success: %s" % v_path)
+            ThreadProgress(self.view, thread, "Checkin...", "Checkin success: %s" % path)
 
 class TfsHistoryCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.history)
+            thread = TfsRunnerThread(path, manager.history)
             thread.start()
-            ThreadProgress(self.view, thread, "History...", "History success: %s" % v_path)
+            ThreadProgress(self.view, thread, "History...", "History success: %s" % path)
 
 class TfsAddCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.add)
+            thread = TfsRunnerThread(path, manager.add)
             thread.start()
-            ThreadProgress(self.view, thread, "Adding...", "Added success: %s" % v_path)
+            ThreadProgress(self.view, thread, "Adding...", "Added success: %s" % path)
 
 class TfsGetLatestCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
-            if (not isReadonly(v_path)):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
+            if (not isReadonly(path)):
                 self.view.run_command('save')
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.get_latest)
+            thread = TfsRunnerThread(path, manager.get_latest)
             thread.start()
-            ThreadProgress(self.view, thread, "Getting...", "Get latest success: %s" % v_path)
+            ThreadProgress(self.view, thread, "Getting...", "Get latest success: %s" % path)
 
 class TfsDifferenceCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
-            if (not isReadonly(v_path)):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
+            if (not isReadonly(path)):
                 self.view.run_command('save')
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.difference)
+            thread = TfsRunnerThread(path, manager.difference)
             thread.start()
-            ThreadProgress(self.view, thread, "Comparing...", "Comparing success: %s" % v_path)
+            ThreadProgress(self.view, thread, "Comparing...", "Comparing success: %s" % path)
 
 class TfsDeleteCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.delete)
+            thread = TfsRunnerThread(path, manager.delete)
             thread.start()
-            ThreadProgress(self.view, thread, "Deleting...", "Delete success: %s" % v_path)
+            ThreadProgress(self.view, thread, "Deleting...", "Delete success: %s" % path)
 
 class TfsStatusCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.status)
+            thread = TfsRunnerThread(path, manager.status)
             thread.start()
             ThreadProgress(self.view, thread, "Getting status...")
 
 class TfsAnnotateCommand(sublime_plugin.TextCommand):
     def run(self, edit):
-        v_path = get_unicode_filename(self.view)
-        if not (v_path is None):
+        path = get_unicode_filename(self.view)
+        if not (path is None):
             manager = TfsManager()
-            thread = TfsRunnerThread(v_path, manager.annotate)
+            thread = TfsRunnerThread(path, manager.annotate)
             thread.start()
             ThreadProgress(self.view, thread, "Annotating...")
 
 class TfsEventListener(sublime_plugin.EventListener):
     def on_modified(self, view):
-        v_path = get_unicode_filename(view)
-        if not (v_path is None):
+        path = get_unicode_filename(view)
+        if not (path is None):
             manager = TfsManager()
-            if isReadonly(v_path):
+            if isReadonly(path):
                 if manager.auto_checkout_enabled:
-                    thread = TfsRunnerThread(v_path, manager.auto_checkout)
+                    thread = TfsRunnerThread(path, manager.auto_checkout)
                     thread.start()
-                    ThreadProgress(view, thread, "Checkout...", "Checkout success: %s" % v_path)
+                    ThreadProgress(view, thread, "Checkout...", "Checkout success: %s" % path)
 
 def isReadonly(p_path):
     try: