浏览代码

Also look for resource files in ../share/gitstats.

This allows installing in other locations besides /usr.
Heikki Hokkanen 16 年前
父节点
当前提交
e774d43ca4
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4
    2
      gitstats

+ 4
- 2
gitstats 查看文件

@@ -481,8 +481,10 @@ class HTMLReportCreator(ReportCreator):
481 481
 		ReportCreator.create(self, data, path)
482 482
 		self.title = data.projectname
483 483
 
484
-		# copy static files if they do not exist
485
-		basedirs = [os.path.dirname(os.path.abspath(__file__)), '/usr/share/gitstats']
484
+		# copy static files. Looks in the binary directory, ../share/gitstats and /usr/share/gitstats
485
+		binarypath = os.path.dirname(os.path.abspath(__file__))
486
+		secondarypath = os.path.join(binarypath, '..', 'share', 'gitstats')
487
+		basedirs = [binarypath, secondarypath, '/usr/share/gitstats']
486 488
 		for file in ('gitstats.css', 'sortable.js', 'arrow-up.gif', 'arrow-down.gif', 'arrow-none.gif'):
487 489
 			for base in basedirs:
488 490
 				src = base + '/' + file