]> git.parisson.com Git - gix.git/commitdiff
ignore more tmp files
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 25 Nov 2013 11:30:58 +0000 (12:30 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 25 Nov 2013 11:30:58 +0000 (12:30 +0100)
gix.py

diff --git a/gix.py b/gix.py
index 0e007f487149044ae18e2d757d6851dc79fa7648..fe6769de6bdf172a8335ec3a286b175a9dc4f5f4 100644 (file)
--- a/gix.py
+++ b/gix.py
@@ -8,10 +8,8 @@ from watchdog.events import *
 
 from git import *
 
-logging.basicConfig(level=logging.INFO,
-                        format='%(asctime)s - %(message)s',
-                        datefmt='%Y-%m-%d %H:%M:%S')
 
+IGNORE_PATTERNS = ['*.git/*', '*.swp', '*.swpx', '*~', ]
 
 
 class GIXEventHandler(PatternMatchingEventHandler):
@@ -22,6 +20,10 @@ class GIXEventHandler(PatternMatchingEventHandler):
                                               ignore_patterns=ignore_patterns,
                                               ignore_directories=ignore_directories, 
                                               case_sensitive=case_sensitive)
+        logging.basicConfig(level=logging.INFO,
+                        format='%(asctime)s - %(message)s',
+                        datefmt='%Y-%m-%d %H:%M:%S')
+
         self.git = git    
         self.message = ' '
 
@@ -65,7 +67,7 @@ class GIX(Thread):
         self.repo = Repo(self.path)
         self.git = self.repo.git
         self.event_handler = GIXEventHandler(self.git, patterns=['*'+path+'*'], 
-                                                ignore_patterns=['*.git/*',])
+                                                ignore_patterns=IGNORE_PATTERNS)
         self.observer = Observer()
         self.observer.schedule(self.event_handler, path, recursive=True)