git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a997f12
)
JAL-3660 Fix for specified output format when using command line arg to convert a...
author
Ben Soares
<b.soares@dundee.ac.uk>
Fri, 27 Nov 2020 17:24:08 +0000
(17:24 +0000)
committer
Ben Soares
<b.soares@dundee.ac.uk>
Fri, 27 Nov 2020 17:24:08 +0000
(17:24 +0000)
src/jalview/bin/Jalview.java
patch
|
blob
|
history
diff --git
a/src/jalview/bin/Jalview.java
b/src/jalview/bin/Jalview.java
index
e130277
..
08cbcb2
100755
(executable)
--- a/
src/jalview/bin/Jalview.java
+++ b/
src/jalview/bin/Jalview.java
@@
-60,6
+60,7
@@
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
import jalview.io.FileFormatException;
import jalview.io.FileFormatI;
import jalview.io.FileFormat;
import jalview.io.FileFormatException;
import jalview.io.FileFormatI;
+import jalview.io.FileFormats;
import jalview.io.FileLoader;
import jalview.io.HtmlSvgOutput;
import jalview.io.IdentifyFile;
import jalview.io.FileLoader;
import jalview.io.HtmlSvgOutput;
import jalview.io.IdentifyFile;
@@
-793,17
+794,37
@@
public class Jalview
af.createEPS(outputFile);
continue;
}
af.createEPS(outputFile);
continue;
}
-
- af.saveAlignment(file, format);
- if (af.isSaveAlignmentSuccessful())
+ FileFormatI outFormat = null;
+ try
+ {
+ outFormat = FileFormats.getInstance().forName(outputFormat);
+ } catch (Exception formatP)
{
{
- System.out.println("Written alignment in " + format
- + " format to " + file);
+ System.out.println("Couldn't parse " + outFormat
+ + " as a valid Jalview format string.");
}
}
- else
+ if (outFormat != null)
{
{
- System.out.println("Error writing file " + file + " in "
- + format + " format!!");
+ if (!outFormat.isWritable())
+ {
+ System.out.println(
+ "This version of Jalview does not support alignment export as "
+ + outputFormat);
+ }
+ else
+ {
+ af.saveAlignment(file, outFormat);
+ if (af.isSaveAlignmentSuccessful())
+ {
+ System.out.println("Written alignment in "
+ + outFormat.getName() + " format to " + file);
+ }
+ else
+ {
+ System.out.println("Error writing file " + file + " in "
+ + outFormat.getName() + " format!!");
+ }
+ }
}
}
}
}