|
|
@@ -731,6 +731,38 @@ def html_header(level, text):
|
|
731
|
731
|
return '\n<h%d id="%s"><a href="#%s">%s</a></h%d>\n\n' % (level, name, name, text, level)
|
|
732
|
732
|
|
|
733
|
733
|
class HTMLReportCreator(ReportCreator):
|
|
|
734
|
+
|
|
|
735
|
+
|
|
|
736
|
+ # New function for TSV write ins, put this in a more organized place later
|
|
|
737
|
+
|
|
|
738
|
+ def writeHeaderstoNewTSV(fileName,headers):
|
|
|
739
|
+ """
|
|
|
740
|
+ Writes the headers to the first line of the .tsv file
|
|
|
741
|
+
|
|
|
742
|
+ Args:
|
|
|
743
|
+ fileName (String): Name of the destination file, ex: "data.tsv"
|
|
|
744
|
+ headers (List(String)): Headers to be written, ex: ["header1","header2"....]
|
|
|
745
|
+
|
|
|
746
|
+ """
|
|
|
747
|
+ assert fileName[-4:] ==".tsv", "fileName must be '.tsv' file not '%s'" %(fileName)
|
|
|
748
|
+
|
|
|
749
|
+ f = open (fileName,"w")
|
|
|
750
|
+ for headerIndex in range(len(headers)):
|
|
|
751
|
+ if headerIndex!=len(headers)-1:
|
|
|
752
|
+ # write header along with\t
|
|
|
753
|
+ f.write(headers[headerIndex]+"\t")
|
|
|
754
|
+ else:
|
|
|
755
|
+ # write last word along with\n
|
|
|
756
|
+ f.write(headers[len(headers)-1]+"\n")
|
|
|
757
|
+ f.close()
|
|
|
758
|
+
|
|
|
759
|
+
|
|
|
760
|
+
|
|
|
761
|
+
|
|
|
762
|
+
|
|
|
763
|
+
|
|
|
764
|
+
|
|
|
765
|
+
|
|
734
|
766
|
def create(self, data, path):
|
|
735
|
767
|
ReportCreator.create(self, data, path)
|
|
736
|
768
|
self.title = data.projectname
|
|
|
@@ -877,29 +909,7 @@ class HTMLReportCreator(ReportCreator):
|
|
877
|
909
|
f.write('<img src="day_of_week.png" alt="Day of Week">')
|
|
878
|
910
|
fp.close()
|
|
879
|
911
|
|
|
880
|
|
- # New function for TSV write ins, put this in a more organized place later
|
|
881
|
|
-
|
|
882
|
|
- def writeHeaderstoNewTSV(fileName,headers):
|
|
883
|
|
- """
|
|
884
|
|
- Writes the headers to the first line of the .tsv file
|
|
885
|
|
-
|
|
886
|
|
- Args:
|
|
887
|
|
- fileName (String): Name of the destination file, ex: "data.tsv"
|
|
888
|
|
- headers (List(String)): Headers to be written, ex: ["header1","header2"....]
|
|
889
|
|
-
|
|
890
|
|
- """
|
|
891
|
|
- assert fileName[-4:] ==".tsv", "fileName must be '.tsv' file not '%s'" %(fileName)
|
|
892
|
|
-
|
|
893
|
|
- f = open (fileName,"w")
|
|
894
|
|
- for headerIndex in range(len(headers)):
|
|
895
|
|
- if headerIndex!=len(headers)-1:
|
|
896
|
|
- # write header along with\t
|
|
897
|
|
- f.write(headers[headerIndex]+"\t")
|
|
898
|
|
- else:
|
|
899
|
|
- # write last word along with\n
|
|
900
|
|
- f.write(headers[len(headers)-1]+"\n")
|
|
901
|
|
- f.close()
|
|
902
|
|
-
|
|
|
912
|
+
|
|
903
|
913
|
writeHeaderstoNewTSV("FlaskTest/static/data/commits_by_author_TEST.tsv", ['day','hour','value'])
|
|
904
|
914
|
commits_by_author_tsv=open("FlaskTest/static/data/commits_by_author_TEST.tsv", "a+")
|
|
905
|
915
|
|