Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 662afd2e authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- added a parameter argument to the read method

- corrected a bug that made -p and -D option optional
- corrected a bug that made erasing the debug option with parameter file
parent 999d30af
No related branches found
No related tags found
No related merge requests found
...@@ -94,9 +94,10 @@ public class BasicParameters implements Parameters { ...@@ -94,9 +94,10 @@ public class BasicParameters implements Parameters {
} }
public static Parameters read(String filename){ public static Parameters read(String filename){
Parameters p = new BasicParameters(); return read(new BasicParameters(), filename);
// String filename = "params.xml"; }
public static Parameters read(Parameters p, String filename){
try { try {
// open the stream // open the stream
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory docBuilderFactory =
......
...@@ -137,7 +137,7 @@ public class GroupAlign { ...@@ -137,7 +137,7 @@ public class GroupAlign {
// Is there a way for that in LongOpt ??? // Is there a way for that in LongOpt ???
longopts[11] = new LongOpt("D", LongOpt.REQUIRED_ARGUMENT, null, 'D'); longopts[11] = new LongOpt("D", LongOpt.REQUIRED_ARGUMENT, null, 'D');
Getopt g = new Getopt("", args, "ho:a:d::n:u:r:i:s:t:p::D::", longopts); Getopt g = new Getopt("", args, "ho:a:d::n:u:r:i:s:t:p:D:", longopts);
int c; int c;
String arg; String arg;
...@@ -212,6 +212,9 @@ public class GroupAlign { ...@@ -212,6 +212,9 @@ public class GroupAlign {
int i = g.getOptind(); int i = g.getOptind();
if (debug == 0 && params.getParameter("debug") != null) {
debug = Integer.parseInt((String)params.getParameter("debug"));
}
if (debug > 0) params.setParameter("debug", new Integer(debug-1)); if (debug > 0) params.setParameter("debug", new Integer(debug-1));
iterateDirectories(); iterateDirectories();
......
...@@ -148,7 +148,7 @@ public class Procalign { ...@@ -148,7 +148,7 @@ public class Procalign {
// Is there a way for that in LongOpt ??? // Is there a way for that in LongOpt ???
longopts[9] = new LongOpt("D", LongOpt.REQUIRED_ARGUMENT, null, 'D'); longopts[9] = new LongOpt("D", LongOpt.REQUIRED_ARGUMENT, null, 'D');
Getopt g = new Getopt("", args, "ho:a:p:d::r:t:T:i:D::", longopts); Getopt g = new Getopt("", args, "ho:a:p:d::r:t:T:i:D:", longopts);
int c; int c;
String arg; String arg;
...@@ -215,6 +215,12 @@ public class Procalign { ...@@ -215,6 +215,12 @@ public class Procalign {
int i = g.getOptind(); int i = g.getOptind();
if (debug > 0) {
params.setParameter("debug", new Integer(debug));
} else if ( params.getParameter("debug") != null ) {
debug = Integer.parseInt((String)params.getParameter("debug"));
}
loadedOntologies = new Hashtable(); loadedOntologies = new Hashtable();
if (debug > 0) { if (debug > 0) {
params.setParameter("debug", new Integer(debug)); params.setParameter("debug", new Integer(debug));
......
...@@ -43,5 +43,6 @@ public interface Parameters { ...@@ -43,5 +43,6 @@ public interface Parameters {
public Enumeration getNames(); public Enumeration getNames();
public void write(); public void write();
//public static Parameters read(); //public static Parameters read(String filename);
//public static Parameters read(Parameters params, String filename);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment