[gedit-plugins] Small cleanup



commit c7fb71b0693f03a6045510ae035fb9fa4ddf4879
Author: Garrett Regier <garrettregier gmail com>
Date:   Sat Jun 28 14:59:05 2014 -0700

    Small cleanup

 plugins/git/git/windowactivatable.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/plugins/git/git/windowactivatable.py b/plugins/git/git/windowactivatable.py
index c48d329..504aea1 100644
--- a/plugins/git/git/windowactivatable.py
+++ b/plugins/git/git/windowactivatable.py
@@ -147,22 +147,23 @@ class GitWindowActivatable(GObject.Object, Gedit.WindowActivatable):
         self.clear_monitors()
         self.git_status_thread.clear()
 
-        if not msg.location.has_uri_scheme('file'):
+        location = msg.location
+        if not location.has_uri_scheme('file'):
             return
 
         try:
-            repo_file = Ggit.Repository.discover(msg.location)
+            repo_file = Ggit.Repository.discover(location)
             self.repo = Ggit.Repository.open(repo_file)
             head = self.repo.get_head()
             commit = self.repo.lookup(head.get_target(), Ggit.Commit.__gtype__)
             self.tree = commit.get_tree()
 
-        except Exception as e:
+        except Exception:
             self.repo = None
             self.tree = None
 
         else:
-            self.monitor_directory(msg.location)
+            self.monitor_directory(location)
 
     def inserted(self, bus, msg, data=None):
         location = msg.location


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]