[med-svn] [Git][med-team/python-biopython][master] muscle3.patch: fix my broken logic.

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Thu Nov 24 18:26:16 GMT 2022



Étienne Mollier pushed to branch master at Debian Med / python-biopython


Commits:
25c5fe42 by Étienne Mollier at 2022-11-24T19:25:37+01:00
muscle3.patch: fix my broken logic.

Gbp-Dch: ignore

- - - - -


1 changed file:

- debian/patches/muscle3.patch


Changes:

=====================================
debian/patches/muscle3.patch
=====================================
@@ -13,20 +13,19 @@ Last-Update: 2022-11-24
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
 --- python-biopython.orig/Bio/Align/Applications/_Muscle.py
 +++ python-biopython/Bio/Align/Applications/_Muscle.py
-@@ -10,6 +10,12 @@
+@@ -10,6 +10,11 @@
  from Bio.Application import _Option, _Switch, AbstractCommandline
  from subprocess import getoutput
  
 +# Prefer defaulting to muscle3, as can be installed alongside muscle version 5.
 +default_muscle = "muscle3"
-+try:
-+    _ = getoutput(default_muscle + " --version")
-+except FileNotFoundError:
++output = getoutput(default_muscle + " --version")
++if "not found" in output or "not recognized" in output:
 +    default_muscle = "muscle"
  
  class MuscleCommandline(AbstractCommandline):
      r"""Command line wrapper for the multiple alignment program MUSCLE.
-@@ -43,7 +49,7 @@
+@@ -43,7 +48,7 @@
  
      """
  
@@ -42,19 +41,15 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
      from subprocess import getoutput
  
 -    output = getoutput("muscle -version")
--    # Since "not found" may be in another language, try and be sure this is
--    # really the MUSCLE tool's output
--    if "not found" not in output and "not recognized" not in output:
--        if "MUSCLE" in output and "Edgar" in output:
++    output = getoutput("muscle3 -version")
+     # Since "not found" may be in another language, try and be sure this is
+     # really the MUSCLE tool's output
+     if "not found" not in output and "not recognized" not in output:
+         if "MUSCLE" in output and "Edgar" in output:
 -            muscle_exe = "muscle"
-+    try:
-+        output = getoutput("muscle3 -version")
-+	# Since "not found" may be in another language, try and be sure this is
-+	# really the MUSCLE tool's output
-+        if "not found" not in output and "not recognized" not in output:
-+            if "MUSCLE" in output and "Edgar" in output:
-+                muscle_exe = "muscle3"
-+    except FileNotFoundError:
++            muscle_exe = "muscle3"
++    else:
++        # Maybe the unversionned version will still be muscle 3.
 +        output = getoutput("muscle -version")
 +        if "not found" not in output and "not recognized" not in output:
 +            if "MUSCLE" in output and "Edgar" in output:



View it on GitLab: https://salsa.debian.org/med-team/python-biopython/-/commit/25c5fe429eb811b343fc6647b52d943f75443f90

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-biopython/-/commit/25c5fe429eb811b343fc6647b52d943f75443f90
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20221124/ec66b567/attachment-0001.htm>


More information about the debian-med-commit mailing list