Explorar el Código

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

This allows installing in other locations besides /usr.
Heikki Hokkanen hace 16 años
padre
commit
e774d43ca4
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4
    2
      gitstats

+ 4
- 2
gitstats Ver fichero

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