|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+import libraries
|
|
|
2
|
+
|
|
|
3
|
+path = './8956n'
|
|
|
4
|
+
|
|
|
5
|
+# Global DataCollector:
|
|
|
6
|
+class GlobalDataCollector:
|
|
|
7
|
+ """Manages data collection from the parent revision control repository."""
|
|
|
8
|
+ def __init__(self):
|
|
|
9
|
+ self.global_stamp_created = time.time()
|
|
|
10
|
+ self.global_cache = {}
|
|
|
11
|
+ self.global_total_authors = 0
|
|
|
12
|
+ self.global_activity_by_hour_of_day = {} # hour -> commits
|
|
|
13
|
+ # All other collector definitions
|
|
|
14
|
+
|
|
|
15
|
+# Go through each sub directory
|
|
|
16
|
+directory_content = list_files(path)
|
|
|
17
|
+cd(path)
|
|
|
18
|
+for file in directory_content:
|
|
|
19
|
+ current_path = pwd()
|
|
|
20
|
+ if type(file) == "directory"
|
|
|
21
|
+ cd(file)
|
|
|
22
|
+ if ".git" in current_directory
|
|
|
23
|
+ data = gitstats()
|
|
|
24
|
+ get_total_authors(data, global_total_author)
|
|
|
25
|
+ get_total_line_of_code(data, global_line_of_code)
|
|
|
26
|
+ ...
|
|
|
27
|
+ cd(current_path)
|
|
|
28
|
+
|
|
|
29
|
+# Now we should have all the data for 8956n project
|
|
|
30
|
+cd(current_path)
|
|
|
31
|
+print 'Generating global report
|
|
|
32
|
+report = HTMLReportCreator()
|
|
|
33
|
+report.create(data, outputpath)
|