[Sciviews-commits] r342 - in komodo/SciViews-K: . content/js defaults

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 10 13:09:45 CET 2010


Author: prezez
Date: 2010-11-10 13:09:44 +0100 (Wed, 10 Nov 2010)
New Revision: 342

Modified:
   komodo/SciViews-K/
   komodo/SciViews-K/content/js/sciviews.js
   komodo/SciViews-K/defaults/svStart.R
Log:
svStart.R: better pattern to select available R-package files
sciviews.js: sv.checkToolbox2 cleans up the Temp dir after itself


Property changes on: komodo/SciViews-K
___________________________________________________________________
Modified: svn:ignore
   - !*
*-dev.*
build
*.xpi
*.xpi

   + !*
*-dev.*
build
*.xpi
*.xpi
*.xpi


Modified: komodo/SciViews-K/content/js/sciviews.js
===================================================================
--- komodo/SciViews-K/content/js/sciviews.js	2010-11-09 23:15:12 UTC (rev 341)
+++ komodo/SciViews-K/content/js/sciviews.js	2010-11-10 12:09:44 UTC (rev 342)
@@ -941,6 +941,7 @@
 		toolbox2Svc.importDirectory(toolsDirectory, path);
 		//sv.cmdout.append("path ->" + tbxs[i]);
 	}
+	fTargetDir.remove(true);
 
 	toolbox2Svc.reloadToolsDirectory(toolsDirectory);
 	tbxMgr.view.reloadToolsDirectoryView(-1);

Modified: komodo/SciViews-K/defaults/svStart.R
===================================================================
--- komodo/SciViews-K/defaults/svStart.R	2010-11-09 23:15:12 UTC (rev 341)
+++ komodo/SciViews-K/defaults/svStart.R	2010-11-10 12:09:44 UTC (rev 342)
@@ -4,6 +4,7 @@
 ## Version 0.9.15, 2010-05-01 mod by K. Barton
 ## Version 0.9.19, 2010-10-03 mod by Ph. Grosjean
 ## Version 0.9.20, 2010-10-11 mod by K. Barton
+## Version 0.9.21, 2010-11-10 mod by K. Barton
 
 ## TODO: also use value in koDebug to debug server from within R!
 
@@ -19,13 +20,15 @@
 {
 	## Needed later for tryCatch'ing:
 	err.null <- function (e) return(NULL)
-	
+
 	## If minVersion is not provided, get it from packages in 'default' directory
 	pkg.extpat <- switch(.Platform$pkgType, win.binary = "zip", "tar\\.gz")
-	pkgFiles <- dir(pkg.dir, pattern = pkg.extpat)
+	pkgFiles <- dir(pkg.dir, pattern = paste("^.*_[0-9\\.\\-]+\\.", pkg.extpat,
+											"$", sep=""))
+
 	if (all(is.na(minVersion))) {
-		minVersion <- structure(gsub(sprintf("(^[a-zA-Z]+_|\\.%s$)",
-			pkg.extpat), "", pkgFiles), names = gsub("_.*$", "", pkgFiles))
+		#minVersion <- structure(gsub(sprintf("(^[a-zA-Z]+_|\\.%s$)",
+			#pkg.extpat), "", pkgFiles), names = gsub("_.*$", "", pkgFiles))
 
 		minVersion <- package_version(gsub(sprintf("(^[a-zA-Z]+_|\\.%s$)",
 			pkg.extpat), "", pkgFiles))
@@ -258,7 +261,7 @@
 				i <- order(package_version(pkgVersion), decreasing = TRUE)[1]
 				pkgFile <-  pkgFile[i]
 				pkgVersion <-  pkgVersion[i]
-				
+
 				## For some reasons (bug probably?) I cannot install a package
 				## in R 2.10.1 under Mac OS X when the path to the package has
 				## spaces. Also, correct a bug here when installing package
@@ -307,7 +310,7 @@
 
 		## Determine which packages we don't want to load
 		pkgs <- pkgs[!(pkgs %in% pkgsDontLoad)]
-		
+
 		## Split pkgs to primary and secondary
 		pkgsPrimary <- pkgs[!(pkgs %in% pkgsLast)]
 		pkgsSecondary <- pkgs[pkgs %in% pkgsLast]
@@ -342,12 +345,12 @@
 						res <- !inherits(try(startHttpServer(port =
 							getOption("ko.serve")), silent = TRUE), "try-error")
 					} else res <- TRUE
-					
+
 					if (!all(res)) {
 						cat("Impossible to start the SciViews R HTTP server\n(port",
 							getOption("ko.serve"), "already in use?)\n")
 						cat("Solve the problem, then type: require(svGUI)\n")
-						cat("or choose a different port for the server in Komodo\n")						
+						cat("or choose a different port for the server in Komodo\n")
 					} else {
 						cat("R is SciViews ready!\n")
 						assignTemp(".SciViewsReady", TRUE)
@@ -488,13 +491,13 @@
 		## Record the home page for the help server in an option
 		options(helphome = paste("http://127.0.0.1:", tools:::httpdPort,
 				"/doc/html/index.html", sep = ""))
-		
+
 		## I need to get the help file URL, but help() does not provide it any
 		## more! This is a temporary workaround for this problem
 		assignTemp("getHelpURL", function (x, ...) {
 			file <- as.character(x)
 			if (length(file) == 0) return("")
-			## Extension ".html" may be missing 
+			## Extension ".html" may be missing
 			htmlfile <- basename(file)
 			if (length(file) > 1) {
 				## If more then one topic is found
@@ -605,10 +608,10 @@
 			sep = ";"))
 		)
 	}
-	
+
 	## Do we have a .Rprofile file to source?
 	if (file.exists(".Rprofile")) source(".Rprofile")
-	
+
 	return(invisible(res))
 }
 ### SciViews install end ###



More information about the Sciviews-commits mailing list