Browse Source

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

This allows installing in other locations besides /usr.
Heikki Hokkanen 16 years ago
parent
commit
e774d43ca4
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      gitstats

+ 4
- 2
gitstats View File

481
 		ReportCreator.create(self, data, path)
481
 		ReportCreator.create(self, data, path)
482
 		self.title = data.projectname
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
 		for file in ('gitstats.css', 'sortable.js', 'arrow-up.gif', 'arrow-down.gif', 'arrow-none.gif'):
488
 		for file in ('gitstats.css', 'sortable.js', 'arrow-up.gif', 'arrow-down.gif', 'arrow-none.gif'):
487
 			for base in basedirs:
489
 			for base in basedirs:
488
 				src = base + '/' + file
490
 				src = base + '/' + file