nat_linden avatar nat_linden committed e36a05c

Remove HelpUseLocal setting variable. Hide local html skin dir.
We assert that the local html directory is no longer used. Remove machinery
related to its use, notably HelpUseLocal, the code that checks it and the
code that sets and examines special flag URL "__local".
Before actually killing off the local skins/default/html directory, make rename it but continue packaging it as html.old. If this
doesn't cause a panic, we can proceed with removing it entirely.

Comments (0)

Files changed (5)


-    <key>HelpUseLocal</key>
-    <map>
-      <key>Comment</key>
-      <string>If set, always use this for help: skins/default/html/[LANGUAGE]/help-offline/index.html</string>
-      <key>Persist</key>
-      <integer>0</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>


 	gSavedSettings.setBOOL("HelpFloaterOpen", TRUE);
 	std::string topic = key.asString();
-	if (topic == "__local")
-	{
-		mBrowser->navigateToLocalPage( "help-offline" , "index.html" );
-	}
-	else
-	{
-		mBrowser->navigateTo(LLViewerHelp::instance().getURL(topic));
-	}
+	mBrowser->navigateTo(LLViewerHelp::instance().getURL(topic));


 		// replace the default help URL format
-		// don't fall back to Standalone's pre-connection static help
-		gSavedSettings.setBOOL("HelpUseLocal", false);
 	std::string home_location = response["home"];


 std::string LLViewerHelp::getURL(const std::string &topic)
-	// allow overriding the help server with a local help file
-	if( gSavedSettings.getBOOL("HelpUseLocal") )
-	{
-		return "__local";
-	}
 	// if the help topic is empty, use the default topic
 	std::string help_topic = topic;
 	if (help_topic.empty())


 import sys
 import os.path
+import errno
+import glob
 import re
+import shutil
 import tarfile
 import time
 import random
+                    # The claim is that we never use local html files any
+                    # longer. But rather than commenting out the "*/html"
+                    # block above, let's rename every html subdirectory we
+                    # copied as html.old. That way, if we're wrong, a user
+                    # actually does have the relevant files; s/he just needs
+                    # to rename every html.old directory back to html to
+                    # recover them. (Possibly I could accomplish the rename
+                    # with clever use of self.prefix(), but the leading "*"
+                    # perplexes me.)
+                    for htmldir in glob.glob(os.path.join(self.get_dst_prefix(), "*", "html")):
+                        htmlold = htmldir + ".old"
+                        print "Renaming %r => %r" % (htmldir, os.path.basename(htmlold))
+                        try:
+                            os.rename(htmldir, htmlold)
+                        except OSError, err:
+                            if err.errno != errno.ENOTEMPTY:
+                                raise
+                            # If we already have a directory by that name and
+                            # it's not empty, remove it and retry.
+                            shutil.rmtree(htmlold)
+                            # If it still blows up, let the exception propagate.
+                            os.rename(htmldir, htmlold)
             # local_assets dir (for pre-cached textures)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.