浏览代码

Copy gitstats.css to output path if it does not exist.

Heikki Hokkanen 18 年前
父节点
当前提交
3f2fc8db00
共有 2 个文件被更改,包括 5 次插入6 次删除
  1. 1
    5
      doc/TODO.txt
  2. 4
    1
      gitstats

+ 1
- 5
doc/TODO.txt 查看文件

@@ -1,15 +1,11 @@
1 1
 []
2
-- Files
3
-	- (T) File count by date
4
-
2
+- separate "web" branch for homepage
5 3
 - better style for images & tables (keep next to each other?)
6 4
 - parameter --style default.css
7 5
 - styles/default.css
8 6
 
9 7
 [0.0.1]
10 8
 - style: fix table colors
11
-- copy/link gitstats.css to target dir
12
-	- find out pwd or home dir?
13 9
 
14 10
 [Unsorted]
15 11
 - could show some statistics from last year, month, etc... pisg-like?

+ 4
- 1
gitstats 查看文件

@@ -342,7 +342,7 @@ class HTMLReportCreator(ReportCreator):
342 342
 
343 343
 		# TODO copy the CSS if it does not exist
344 344
 		if not os.path.exists(path + '/gitstats.css'):
345
-			#shutil.copyfile('')
345
+			shutil.copyfile('gitstats.css', path + '/gitstats.css')
346 346
 			pass
347 347
 
348 348
 		f = open(path + "/index.html", 'w')
@@ -779,6 +779,7 @@ if len(sys.argv) <  3:
779 779
 
780 780
 gitpath = sys.argv[1]
781 781
 outputpath = os.path.abspath(sys.argv[2])
782
+rundir = os.getcwd()
782 783
 
783 784
 try:
784 785
 	os.makedirs(outputpath)
@@ -797,6 +798,8 @@ print 'Collecting data...'
797 798
 data = GitDataCollector()
798 799
 data.collect(gitpath)
799 800
 
801
+os.chdir(rundir)
802
+
800 803
 print 'Generating report...'
801 804
 report = HTMLReportCreator()
802 805
 report.create(data, outputpath)