From 24148ee604dd03ceaeab63c123f3afc5cc2a57a7 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Sat, 16 Sep 2023 16:56:54 +0100 Subject: [PATCH] JAL-629 Fix a test and omit an incorrect error message for structureviewer=none --- src/jalview/bin/Commands.java | 7 +++++-- src/jalview/bin/argparser/Arg.java | 6 +++--- test/jalview/bin/CommandsTest2.java | 3 ++- test/jalview/bin/commandsTest2.argfile1 | 5 ++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index 0565111..9a85f1e 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -582,8 +582,11 @@ public class Commands if (structureViewer == null) { - addError("Failed to import and open structure view for file '" - + structureFile + "'."); + if (!StringUtils.equalsIgnoreCase(sViewerName, "none")) + { + addError("Failed to import and open structure view for file '" + + structureFile + "'."); + } continue; } try diff --git a/src/jalview/bin/argparser/Arg.java b/src/jalview/bin/argparser/Arg.java index 9bb5f38..b69ed61 100644 --- a/src/jalview/bin/argparser/Arg.java +++ b/src/jalview/bin/argparser/Arg.java @@ -139,7 +139,7 @@ public enum Arg TEMPFAC(Type.STRUCTURE, "Set the type of temperature factor. Possible values are:\n" + "default,\n" + "plddt.", - Opt.STRING, Opt.LINKED, Opt.ALLOWMULTIID), + Opt.STRING, Opt.LINKED, Opt.MULTIVALUE, Opt.ALLOWMULTIID), STRUCTUREVIEWER(Type.STRUCTURE, "Set the structure viewer to use to open the 3D structure file specified in previous --structure to name. Possible values of name are:\n" + "none,\n" + "jmol,\n" + "chimera,\n" + "chimerax,\n" @@ -148,8 +148,8 @@ public enum Arg NOTEMPFAC(Type.STRUCTURE, "Do not show the temperature factor annotation for the preceding --structure.", Opt.UNARY, Opt.LINKED, Opt.ALLOWMULTIID, Opt.SECRET), // keep this - // secret - // until it works! + // secret until + // it works! SHOWSSANNOTATIONS(Type.STRUCTURE, null, Opt.BOOLEAN, Opt.LINKED, Opt.ALLOWMULTIID), diff --git a/test/jalview/bin/CommandsTest2.java b/test/jalview/bin/CommandsTest2.java index d6b6f3c..ae14c1a 100644 --- a/test/jalview/bin/CommandsTest2.java +++ b/test/jalview/bin/CommandsTest2.java @@ -65,7 +65,8 @@ public class CommandsTest2 String[] args = cmdLine.split("\\s+"); CommandsTest.callJalviewMain(args); - while (Desktop.instance!=null && Desktop.instance.operationsAreInProgress()) + while (Desktop.instance != null + && Desktop.instance.operationsAreInProgress()) { try { diff --git a/test/jalview/bin/commandsTest2.argfile1 b/test/jalview/bin/commandsTest2.argfile1 index ea3a1be..85eccd9 100644 --- a/test/jalview/bin/commandsTest2.argfile1 +++ b/test/jalview/bin/commandsTest2.argfile1 @@ -1,9 +1,8 @@ ---substitutions --append=examples/test_fab41.result/sample.a2m --showannotations --showssannotations --colour=gecos-flower ---structure=[viewer=jmol,tempfac=plddt,paematrix={dirname}/test_fab41_unrelaxed_rank_1_model_3_scores.json]{dirname}/test_fab41_unrelaxed_rank_1_model_3.pdb +--structure=[structureviewer=jmol,tempfac=plddt,paematrix={dirname}/test_fab41_unrelaxed_rank_1_model_3_scores.json]{dirname}/test_fab41_unrelaxed_rank_1_model_3.pdb --structure={dirname}/test_fab41_unrelaxed_rank_2_model_4.pdb --structureviewer=jmol --paematrix={dirname}/test_fab41_unrelaxed_rank_2_model_4_scores.json @@ -12,7 +11,7 @@ --structureviewer=jmol --paematrix={dirname}/test_fab41_unrelaxed_rank_3_model_2_scores.json --tempfac=plddt ---structure=[viewer=none]{dirname}/test_fab41_unrelaxed_rank_4_model_5.pdb +--structure=[structureviewer=none]{dirname}/test_fab41_unrelaxed_rank_4_model_5.pdb --paematrix={dirname}/test_fab41_unrelaxed_rank_4_model_5_scores.json --tempfac=plddt --structure={dirname}/test_fab41_unrelaxed_rank_5_model_1.pdb -- 1.7.10.2