From 732a6e3c8134cb9bed61612e27fdc02461a28db5 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 2 Aug 2011 13:42:41 -0400 Subject: STORM-1534: Derive Credits in About Second Life from doc/ sources --- indra/newview/viewer_manifest.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'indra/newview/viewer_manifest.py') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 8aa94616d6..bd0193e0f6 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -31,6 +31,7 @@ import os.path import re import tarfile import time +import random viewer_dir = os.path.dirname(__file__) # add llmanifest library to our path so we don't have to muck with PYTHONPATH sys.path.append(os.path.join(viewer_dir, '../lib/python/indra/util')) @@ -62,6 +63,12 @@ class ViewerManifest(LLManifest): # include the entire shaders directory recursively self.path("shaders") + # inclue the extracted lists of contributors + contributor_names = self.extract_names("../../doc/contributions.txt") + self.put_in_file(contributor_names, "contributors.txt") + # inclue the extracted lists of translators + translator_names = self.extract_names("../../doc/translations.txt") + self.put_in_file(translator_names, "translators.txt") # ... and the entire windlight directory self.path("windlight") self.end_prefix("app_settings") @@ -174,6 +181,28 @@ class ViewerManifest(LLManifest): return " ".join((channel_flags, grid_flags, setting_flags)).strip() + def extract_names(self,src): + try: + contrib_file = open(src,'r') + except IOError: + print "Failed to open '%s'" % src + raise + lines = contrib_file.readlines() + contrib_file.close() + + # All lines up to and including the first blank line are the file header; skip them + lines.reverse() # so that pop will pull from first to last line + while not re.match("\s*$", lines.pop()) : + pass # do nothing + + # A line that starts with a non-whitespace character is a name; all others describe contributions, so collect the names + names = [] + for line in lines : + if re.match("\S", line) : + names.append(line.rstrip()) + # It's not fair to always put the same people at the head of the list + random.shuffle(names) + return ', '.join(names) class WindowsManifest(ViewerManifest): def final_exe(self): -- cgit v1.2.3 From 1ccb5f855c46999259c3a755a71917cddd50df28 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 5 Aug 2011 18:35:30 -0400 Subject: add reading Linden names at build time from enviroment-specified file --- indra/newview/viewer_manifest.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra/newview/viewer_manifest.py') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index bd0193e0f6..d81809b3a5 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -63,12 +63,25 @@ class ViewerManifest(LLManifest): # include the entire shaders directory recursively self.path("shaders") - # inclue the extracted lists of contributors + # include the extracted list of contributors contributor_names = self.extract_names("../../doc/contributions.txt") self.put_in_file(contributor_names, "contributors.txt") - # inclue the extracted lists of translators + # include the extracted list of translators translator_names = self.extract_names("../../doc/translations.txt") self.put_in_file(translator_names, "translators.txt") + # include the list of Lindens (if any) + # see https://wiki.lindenlab.com/wiki/Generated_Linden_Credits + linden_names_path = os.getenv("linden_credits") + if linden_names_path : + try: + linden_file = open(linden_names_path,'r') + linden_names = linden_file.readlines() # all names are on one line + self.put_in_file(linden_names, "lindens.txt") + linden_file.close() + except IOError: + print "No Linden names found at '%s', using built-in list" % linden_names_path + pass + # ... and the entire windlight directory self.path("windlight") self.end_prefix("app_settings") -- cgit v1.2.3 From 2ba175befd66d94715719aa6f6bed606c786d64b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 10 Aug 2011 15:50:04 -0400 Subject: convert linden names list to string --- indra/newview/viewer_manifest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/viewer_manifest.py') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index d81809b3a5..3629b2d4e7 100644 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -75,7 +75,8 @@ class ViewerManifest(LLManifest): if linden_names_path : try: linden_file = open(linden_names_path,'r') - linden_names = linden_file.readlines() # all names are on one line + # all names should be one line, but the join below also converts to a string + linden_names = ', '.join(linden_file.readlines()) self.put_in_file(linden_names, "lindens.txt") linden_file.close() except IOError: -- cgit v1.2.3