X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fpymol%2FPymolManager.java;h=e3b913b608ae6750483fb6103fb8cef99101ff5f;hb=aa643d0f2f5f506df2771e216af1618549d32050;hp=f410b54c4648227af4771d7f34aed1a307a8dfac;hpb=26eac0ada672f0b0377054cef2899c1161931655;p=jalview.git diff --git a/src/jalview/ext/pymol/PymolManager.java b/src/jalview/ext/pymol/PymolManager.java index f410b54..e3b913b 100644 --- a/src/jalview/ext/pymol/PymolManager.java +++ b/src/jalview/ext/pymol/PymolManager.java @@ -43,20 +43,34 @@ public class PymolManager */ public static List getPymolPaths() { + return getPymolPaths(System.getProperty("os.name")); + } + + /** + * Returns a list of paths to try for the PyMOL executable. Any user + * preference is placed first, otherwise 'standard' paths depending on the + * operating system. + * + * @param os + * operating system as reported by environment variable + * {@code os.name} + * @return + */ + protected static List getPymolPaths(String os) + { List pathList = new ArrayList<>(); String userPath = Cache .getDefault(Preferences.PYMOL_PATH, null); if (userPath != null) { - pathList.add(0, userPath); + pathList.add(userPath); } /* * add default installation paths */ String pymol = "PyMOL"; - String os = System.getProperty("os.name"); if (os.startsWith("Linux")) { pathList.add("/usr/local/pymol/bin/" + pymol);