File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ """
2
+ report how many days it has been since each developer committed. You
3
+ must do an
4
+
5
+ svn log > log.txt
6
+
7
+ and place the output next to this file before running
8
+
9
+ """
10
+ import os , datetime
11
+
12
+ import matplotlib .cbook as cbook
13
+
14
+ todate = cbook .todate ('%Y-%m-%d' )
15
+ today = datetime .date .today ()
16
+ if not os .path .exists ('log.txt' ):
17
+ print ('You must place the "svn log" output into a file "log.txt"' )
18
+ raise SystemExit
19
+
20
+ parse = False
21
+
22
+ lastd = dict ()
23
+ for line in file ('log.txt' ):
24
+ if line .startswith ('--------' ):
25
+ parse = True
26
+ continue
27
+
28
+ if parse :
29
+ parts = [part .strip () for part in line .split ('|' )]
30
+ developer = parts [1 ]
31
+ dateparts = parts [2 ].split (' ' )
32
+ ymd = todate (dateparts [0 ])
33
+
34
+
35
+ if developer not in lastd :
36
+ lastd [developer ] = ymd
37
+
38
+ parse = False
39
+
40
+ dsu = [((today - lastdate ).days , developer ) for developer , lastdate in lastd .items ()]
41
+
42
+ dsu .sort ()
43
+ for timedelta , developer in dsu :
44
+ print ('%s : %d' % (developer , timedelta ))
You can’t perform that action at this time.
0 commit comments