mirror of
https://github.com/hoxu/gitstats.git
synced 2026-03-01 18:23:26 +01:00
Workaround for git repository.
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
|
||||
- style class for images (<div class="graph">)?
|
||||
- better style for images & tables (keep next to each other?)
|
||||
- parameter --style default.css
|
||||
|
||||
[0.0.1]
|
||||
- copy/link gitstats.css to target dir
|
||||
- rename to gitstats ?
|
||||
- make $PROJECT_NAME a variable
|
||||
- find out pwd or home dir?
|
||||
|
||||
[Unsorted]
|
||||
- use sortable.js
|
||||
|
||||
13
gitstats
13
gitstats
@@ -6,6 +6,7 @@ import datetime
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
import time
|
||||
|
||||
@@ -23,6 +24,7 @@ def getkeyssortedbyvalues(dict):
|
||||
# TODO getdictkeyssortedbyvaluekey(dict, key) - eg. dict['author'] = { 'commits' : 512 } - ...key(dict, 'commits')
|
||||
|
||||
class DataCollector:
|
||||
"""Manages data collection from a revision control repository."""
|
||||
def __init__(self):
|
||||
self.stamp_created = time.time()
|
||||
pass
|
||||
@@ -230,7 +232,10 @@ class GitDataCollector(DataCollector):
|
||||
self.extensions[ext] = {'files': 0, 'lines': 0}
|
||||
|
||||
self.extensions[ext]['files'] += 1
|
||||
self.extensions[ext]['lines'] += int(getoutput('wc -l < %s' % line, quiet = True))
|
||||
try:
|
||||
self.extensions[ext]['lines'] += int(getoutput('wc -l < %s' % line, quiet = True))
|
||||
except:
|
||||
print 'Warning: Could not count lines for file "%s"' % line
|
||||
|
||||
def getActivityByDayOfWeek(self):
|
||||
return self.activity_by_day_of_week
|
||||
@@ -283,6 +288,7 @@ class GitDataCollector(DataCollector):
|
||||
return datetime.datetime.fromtimestamp(stamp).strftime('%Y-%m-%d')
|
||||
|
||||
class ReportCreator:
|
||||
"""Creates the actual report based on given data."""
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@@ -294,6 +300,11 @@ class HTMLReportCreator(ReportCreator):
|
||||
def create(self, data, path):
|
||||
ReportCreator.create(self, data, path)
|
||||
|
||||
# TODO copy the CSS if it does not exist
|
||||
if not os.path.exists(path + '/gitstats.css'):
|
||||
#shutil.copyfile('')
|
||||
pass
|
||||
|
||||
f = open(path + "/index.html", 'w')
|
||||
format = '%Y-%m-%d %H:%m:%S'
|
||||
self.printHeader(f)
|
||||
|
||||
Reference in New Issue
Block a user