Browse Source

new config option which can be used more than once to exclude file paths from stats.

Alan Hamlett 10 years ago
parent
commit
a41cdb4c3a
1 changed files with 12 additions and 1 deletions
  1. 12
    1
      gitstats

+ 12
- 1
gitstats View File

47
     'linear_linestats': 1,
47
     'linear_linestats': 1,
48
     'project_name': '',
48
     'project_name': '',
49
     'processes': 8,
49
     'processes': 8,
50
-    'start_date': ''
50
+    'start_date': '',
51
+    'exclude_paths': [],
51
 }
52
 }
52
 
53
 
53
 def getpipeoutput(cmds, quiet = False):
54
 def getpipeoutput(cmds, quiet = False):
490
             size = int(parts[3])
491
             size = int(parts[3])
491
             fullpath = parts[4]
492
             fullpath = parts[4]
492
 
493
 
494
+            exclude = False
495
+            for path in conf['exclude_paths']:
496
+                if path in fullpath:
497
+                    exclude = True
498
+                    break
499
+            if exclude:
500
+                continue
501
+
493
             self.total_size += size
502
             self.total_size += size
494
             self.total_files += 1
503
             self.total_files += 1
495
 
504
 
1424
                     raise KeyError('no such key "%s" in config' % key)
1433
                     raise KeyError('no such key "%s" in config' % key)
1425
                 if isinstance(conf[key], int):
1434
                 if isinstance(conf[key], int):
1426
                     conf[key] = int(value)
1435
                     conf[key] = int(value)
1436
+                elif isinstance(conf[key], list):
1437
+                    conf[key].append(value)
1427
                 else:
1438
                 else:
1428
                     conf[key] = value
1439
                     conf[key] = value
1429
             elif o in ('-h', '--help'):
1440
             elif o in ('-h', '--help'):