浏览代码

hour_of_week changes

Schultz 8 年前
父节点
当前提交
ee2e633bd0
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 4
    4
      gitstats
  2. 1
    1
      toWriteTest.py

+ 4
- 4
gitstats 查看文件

915
                     commits = 0
915
                     commits = 0
916
                 if commits != 0:
916
                 if commits != 0:
917
                     f.write('<td')
917
                     f.write('<td')
918
-                    value = 127 + int((float(commits) / data.activity_by_hour_of_week_busiest) * 128)
919
-                    f.write(' style="background-color: rgb(%d, 0, 0)"' % value)
918
+                    r = 127 + int((float(commits) / data.activity_by_hour_of_week_busiest) * 128)
919
+                    f.write(' style="background-color: rgb(%d, 0, 0)"' % r)
920
                     f.write('>%d</td>' % commits)
920
                     f.write('>%d</td>' % commits)
921
-                    commits_by_author_tsv.write("%d\t%d\%d\n" %(weekday,hour,value))
921
+                    commits_by_author_tsv.write("%d\t%d\t%d\n" %(weekday,hour,commits))
922
                 else:
922
                 else:
923
                     f.write('<td></td>')
923
                     f.write('<td></td>')
924
-                    commits_by_author_tsv.write("%d\t%d\%d\n" %(weekday,hour,0))
924
+                    commits_by_author_tsv.write("%d\t%d\t%d\n" %(weekday,hour,0))
925
             f.write('</tr>')
925
             f.write('</tr>')
926
 
926
 
927
         f.write('</table>')
927
         f.write('</table>')

+ 1
- 1
toWriteTest.py 查看文件

32
 
32
 
33
 
33
 
34
 
34
 
35
-# ./gitstats /home/gschultz/gitstats/Tools_Portal_TESTING /home/gschultz/gitstats/output_test
35
+# ./gitstats /home/gschultz/gitstats/test_repository /home/gschultz/gitstats/output_test
36
 # ./gitstats /home/gschultz/gitstats/Tools_Portal_TESTING ~/var/www/html/output_TEST
36
 # ./gitstats /home/gschultz/gitstats/Tools_Portal_TESTING ~/var/www/html/output_TEST