gitstats-wrapper.py 993B

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