Thread: [Mathlib-commitlog] SF.net SVN: mathlib:[792] JMathLib/trunk/src/jmathlib/toolbox/jmathlib/ system
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-01-29 20:26:03
|
Revision: 792
http://mathlib.svn.sourceforge.net/mathlib/?rev=792&view=rev
Author: st_mueller
Date: 2009-01-29 20:26:00 +0000 (Thu, 29 Jan 2009)
Log Message:
-----------
changed name to lower
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
Added: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java 2009-01-29 20:26:00 UTC (rev 792)
@@ -0,0 +1,151 @@
+package jmathlib.toolbox.jmathlib.system;
+
+/* This file is part or JMathLib
+
+
+ Author: Stefan Mueller 2002/03/31
+*/
+
+//ToDo: do not include empty directories in the list
+// relative path names
+
+import jmathlib.core.tokens.*;
+import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
+import jmathlib.core.interpreter.*;
+import jmathlib.core.functions.FunctionLoader;
+import jmathlib.core.functions.FileFunctionLoader;
+import jmathlib.core.functions.ExternalFunction;
+import java.util.Vector;
+import java.io.*;
+
+/**An external function for creating a filelist used by the class
+ loader for java applets */
+public class createfunctionslist extends ExternalFunction
+{
+
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
+ {
+
+ Vector pathVector = new Vector();
+
+ // get all search paths from all file loaders
+ for (int i=0;i<globals.getFunctionManager().getFunctionLoaderCount();i++)
+ {
+
+ FunctionLoader loader = globals.getFunctionManager().getFunctionLoader(i);
+
+ if (loader instanceof FileFunctionLoader)
+ {
+ FileFunctionLoader ffl = (FileFunctionLoader)loader;
+
+ for (int pathIdx=0;pathIdx<ffl.getPathCount();pathIdx++)
+ {
+ File path = ffl.getPath(pathIdx).getAbsoluteFile();
+
+ pathVector.add(path.toString());
+ }
+ }
+ }
+
+
+ int size = pathVector.size();
+ String path = "";
+ String line = "";
+
+ ErrorLogger.debugLine("working directory: "+globals.getWorkingDirectory().getAbsolutePath());
+
+ try
+ {
+
+ // create file to store all class-, m-files and images
+ File funcFile = new File(globals.getWorkingDirectory().getAbsoluteFile() +
+ File.separator + "bin" +
+ File.separator + "jmathlib" +
+ File.separator + "webFunctionsList.dat");
+ BufferedWriter outWriter = new BufferedWriter( new FileWriter(funcFile));
+ ErrorLogger.debugLine("funcFile ="+funcFile.toString());
+
+
+ /* The first line of the file is a comment */
+ line = "# created with createFunctionsList.java";
+ outWriter.write(line, 0, line.length());
+ outWriter.newLine();
+ line = "# This is a generated file. DO NOT EDIT!";
+ outWriter.write(line, 0, line.length());
+ outWriter.newLine();
+
+ // search through all serach directories
+ for(int n = 0; n < size; n++)
+ {
+ path = (String)pathVector.elementAt(n);
+ ErrorLogger.debugLine("path func manager = "+path);
+
+ File dir = new File(path);
+ String[] files = dir.list();
+
+ // do not use empty directories
+ if (files != null)
+ {
+ for(int fileNo = 0; (fileNo < files.length); fileNo++)
+ {
+ line = path + "/" + files[fileNo];
+
+ // use unix-style file separator as default
+ line = line.replace('\\', '/');
+
+ // do not put CVS directories and files into functions list
+ if (!line.endsWith("/CVS") &&
+ !line.endsWith("/CVS/Entries") &&
+ !line.endsWith("/CVS/Root") &&
+ !line.endsWith("/CVS/Repository") &&
+ !line.contains(".svn") )
+ {
+ // remove preceding absolute path
+ line = line.substring((globals.getWorkingDirectory().getAbsolutePath()+"/bin/").length());
+
+ ErrorLogger.debugLine("path = "+ line);
+
+ // also remove unwanted directories
+ if (!line.startsWith("jmathlibtests") &&
+ !line.startsWith("jmathlib/tools") )
+ {
+ // write relative path and filename to dat-file
+ outWriter.write(line, 0, line.length());
+ outWriter.newLine();
+ }
+ }
+
+ }
+ }
+ else
+ ErrorLogger.debugLine("directory is empty");
+ }
+ outWriter.close();
+
+ }
+ catch (Exception e)
+ {
+ ErrorLogger.debugLine("createFunctionsList");
+ e.printStackTrace();
+ }
+ return DoubleNumberToken.one;
+
+ } // end evaluate
+}
+
+/*
+@GROUP
+system
+@SYNTAX
+createfunctionslist()
+@DOC
+Creates a file called webFunctionList.dat containing the name
+of all external functions.
+This functions is used when running JMathLib as an applet.
+@NOTES
+@EXAMPLES
+createfunctionslist()
+@SEE
+path, setpath, rmpath
+*/
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-30 18:22:54
|
Revision: 794
http://mathlib.svn.sourceforge.net/mathlib/?rev=794&view=rev
Author: st_mueller
Date: 2009-01-30 18:22:45 +0000 (Fri, 30 Jan 2009)
Log Message:
-----------
Added Paths:
-----------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
Added: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java (rev 0)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java 2009-01-30 18:22:45 UTC (rev 794)
@@ -0,0 +1,151 @@
+package jmathlib.toolbox.jmathlib.system;
+
+/* This file is part or JMathLib
+
+
+ Author: Stefan Mueller 2002/03/31
+*/
+
+//ToDo: do not include empty directories in the list
+// relative path names
+
+import jmathlib.core.tokens.*;
+import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
+import jmathlib.core.interpreter.*;
+import jmathlib.core.functions.FunctionLoader;
+import jmathlib.core.functions.FileFunctionLoader;
+import jmathlib.core.functions.ExternalFunction;
+import java.util.Vector;
+import java.io.*;
+
+/**An external function for creating a filelist used by the class
+ loader for java applets */
+public class createfunctionslist extends ExternalFunction
+{
+
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
+ {
+
+ Vector pathVector = new Vector();
+
+ // get all search paths from all file loaders
+ for (int i=0;i<globals.getFunctionManager().getFunctionLoaderCount();i++)
+ {
+
+ FunctionLoader loader = globals.getFunctionManager().getFunctionLoader(i);
+
+ if (loader instanceof FileFunctionLoader)
+ {
+ FileFunctionLoader ffl = (FileFunctionLoader)loader;
+
+ for (int pathIdx=0;pathIdx<ffl.getPathCount();pathIdx++)
+ {
+ File path = ffl.getPath(pathIdx).getAbsoluteFile();
+
+ pathVector.add(path.toString());
+ }
+ }
+ }
+
+
+ int size = pathVector.size();
+ String path = "";
+ String line = "";
+
+ ErrorLogger.debugLine("working directory: "+globals.getWorkingDirectory().getAbsolutePath());
+
+ try
+ {
+
+ // create file to store all class-, m-files and images
+ File funcFile = new File(globals.getWorkingDirectory().getAbsoluteFile() +
+ File.separator + "bin" +
+ File.separator + "jmathlib" +
+ File.separator + "webFunctionsList.dat");
+ BufferedWriter outWriter = new BufferedWriter( new FileWriter(funcFile));
+ ErrorLogger.debugLine("funcFile ="+funcFile.toString());
+
+
+ /* The first line of the file is a comment */
+ line = "# created with createFunctionsList.java";
+ outWriter.write(line, 0, line.length());
+ outWriter.newLine();
+ line = "# This is a generated file. DO NOT EDIT!";
+ outWriter.write(line, 0, line.length());
+ outWriter.newLine();
+
+ // search through all serach directories
+ for(int n = 0; n < size; n++)
+ {
+ path = (String)pathVector.elementAt(n);
+ ErrorLogger.debugLine("path func manager = "+path);
+
+ File dir = new File(path);
+ String[] files = dir.list();
+
+ // do not use empty directories
+ if (files != null)
+ {
+ for(int fileNo = 0; (fileNo < files.length); fileNo++)
+ {
+ line = path + "/" + files[fileNo];
+
+ // use unix-style file separator as default
+ line = line.replace('\\', '/');
+
+ // do not put CVS directories and files into functions list
+ if (!line.endsWith("/CVS") &&
+ !line.endsWith("/CVS/Entries") &&
+ !line.endsWith("/CVS/Root") &&
+ !line.endsWith("/CVS/Repository") &&
+ !line.contains(".svn") )
+ {
+ // remove preceding absolute path
+ line = line.substring((globals.getWorkingDirectory().getAbsolutePath()+"/bin/").length());
+
+ ErrorLogger.debugLine("path = "+ line);
+
+ // also remove unwanted directories
+ if (!line.startsWith("jmathlibtests") &&
+ !line.startsWith("jmathlib/tools") )
+ {
+ // write relative path and filename to dat-file
+ outWriter.write(line, 0, line.length());
+ outWriter.newLine();
+ }
+ }
+
+ }
+ }
+ else
+ ErrorLogger.debugLine("directory is empty");
+ }
+ outWriter.close();
+
+ }
+ catch (Exception e)
+ {
+ ErrorLogger.debugLine("createFunctionsList");
+ e.printStackTrace();
+ }
+ return DoubleNumberToken.one;
+
+ } // end evaluate
+}
+
+/*
+@GROUP
+system
+@SYNTAX
+createfunctionslist()
+@DOC
+Creates a file called webFunctionList.dat containing the name
+of all external functions.
+This functions is used when running JMathLib as an applet.
+@NOTES
+@EXAMPLES
+createfunctionslist()
+@SEE
+path, setpath, rmpath
+*/
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-01-30 21:06:02
|
Revision: 802
http://mathlib.svn.sourceforge.net/mathlib/?rev=802&view=rev
Author: st_mueller
Date: 2009-01-30 21:06:00 +0000 (Fri, 30 Jan 2009)
Log Message:
-----------
correction on working directory
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java 2009-01-30 21:05:33 UTC (rev 801)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java 2009-01-30 21:06:00 UTC (rev 802)
@@ -67,7 +67,7 @@
/* The first line of the file is a comment */
- line = "# created with createFunctionsList.java";
+ line = "# created with createfunctionslist()";
outWriter.write(line, 0, line.length());
outWriter.newLine();
line = "# This is a generated file. DO NOT EDIT!";
@@ -101,7 +101,10 @@
!line.contains(".svn") )
{
// remove preceding absolute path
- line = line.substring((globals.getWorkingDirectory().getAbsolutePath()+"/bin/").length());
+ File f = new File(globals.getWorkingDirectory(),"bin/");
+
+ //ErrorLogger.debugLine(f.getCanonicalPath().toString());
+ line = line.substring(f.getCanonicalPath().toString().length()+1);
ErrorLogger.debugLine("path = "+ line);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-01 12:38:21
|
Revision: 813
http://mathlib.svn.sourceforge.net/mathlib/?rev=813&view=rev
Author: st_mueller
Date: 2009-02-01 12:38:19 +0000 (Sun, 01 Feb 2009)
Log Message:
-----------
changed location of webfunctionslist.dat
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java 2009-02-01 12:37:09 UTC (rev 812)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java 2009-02-01 12:38:19 UTC (rev 813)
@@ -1,4 +1,3 @@
-package jmathlib.toolbox.jmathlib.system;
/* This file is part or JMathLib
@@ -8,6 +7,7 @@
//ToDo: do not include empty directories in the list
// relative path names
+package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.tokens.*;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
@@ -60,7 +60,6 @@
// create file to store all class-, m-files and images
File funcFile = new File(globals.getWorkingDirectory().getAbsoluteFile() +
File.separator + "bin" +
- File.separator + "jmathlib" +
File.separator + "webFunctionsList.dat");
BufferedWriter outWriter = new BufferedWriter( new FileWriter(funcFile));
ErrorLogger.debugLine("funcFile ="+funcFile.toString());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <st_...@us...> - 2009-02-21 18:13:53
|
Revision: 863
http://mathlib.svn.sourceforge.net/mathlib/?rev=863&view=rev
Author: st_mueller
Date: 2009-02-21 18:13:48 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java 2009-02-21 17:55:12 UTC (rev 862)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/createfunctionslist.java 2009-02-21 18:13:48 UTC (rev 863)
@@ -15,6 +15,8 @@
import jmathlib.core.functions.FunctionLoader;
import jmathlib.core.functions.FileFunctionLoader;
import jmathlib.core.functions.ExternalFunction;
+
+import java.util.Calendar;
import java.util.Vector;
import java.io.*;
@@ -72,7 +74,19 @@
line = "# This is a generated file. DO NOT EDIT!";
outWriter.write(line, 0, line.length());
outWriter.newLine();
-
+
+ // add date and time to the webFunctionsList
+ Calendar cal = Calendar.getInstance();
+ String date = Integer.toString(cal.get(Calendar.YEAR)) + "/"
+ + Integer.toString(cal.get(Calendar.MONTH)+1) + "/"
+ + Integer.toString(cal.get(Calendar.DAY_OF_MONTH))+ " "
+ + Integer.toString(cal.get(Calendar.HOUR_OF_DAY)) + ":"
+ + Integer.toString(cal.get(Calendar.MINUTE)) + ":"
+ + Integer.toString(cal.get(Calendar.SECOND));
+ line = "# created on "+ date;
+ outWriter.write(line, 0, line.length());
+ outWriter.newLine();
+
// search through all serach directories
for(int n = 0; n < size; n++)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|