Kaynağa Gözat

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

This allows installing in other locations besides /usr.
Heikki Hokkanen 16 yıl önce
ebeveyn
işleme
e774d43ca4
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4
    2
      gitstats

+ 4
- 2
gitstats Dosyayı Görüntüle

@@ -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