36 lines
1.0 KiB
Plaintext
36 lines
1.0 KiB
Plaintext
|
#!/usr/bin/env python
|
||
|
import argparse
|
||
|
import jinja2
|
||
|
import os
|
||
|
import subprocess
|
||
|
import teamanalysis.git
|
||
|
import teamanalysis.repos
|
||
|
import webbrowser
|
||
|
|
||
|
def _git_stats(abspath):
|
||
|
output = subprocess.check_output(['git_stats', 'generate', '--path=' + abspath, '--out-path=' + os.path.join(abspath, 'git_stats')])
|
||
|
return output
|
||
|
|
||
|
def main():
|
||
|
for repo in teamanalysis.repos.REPOSITORIES:
|
||
|
print(repo)
|
||
|
abspath = '/Users/eliribble/src/{}/'.format(repo)
|
||
|
#output = _git_stats(abspath)
|
||
|
|
||
|
template_loader = jinja2.FileSystemLoader(searchpath=os.path.abspath('./templates/'))
|
||
|
template_environment = jinja2.Environment(loader=template_loader)
|
||
|
template = template_environment.get_template('git_stats.html')
|
||
|
output = template.render(repos=teamanalysis.repos.REPOSITORIES)
|
||
|
|
||
|
try:
|
||
|
os.mkdir('git_stats')
|
||
|
except OSError:
|
||
|
pass
|
||
|
|
||
|
with open('git_stats/index.html', 'w') as f:
|
||
|
f.write(output)
|
||
|
webbrowser.open(os.path.abspath('./git_stats/index.html'))
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
main()
|