Debian Codegraph @

debian/patches/python3.13.patch

raw
1 --- a/cgecore/cmdline.py
2 +++ b/cgecore/cmdline.py
3 @@ -6,7 +6,7 @@
4 # This script is part of the CGE Pipeline structure
5 import sys, os
6 from subprocess import Popen, PIPE
7 -from pipes import quote
8 +from shlex import quote
9 from time import time, sleep
10 from datetime import timedelta
11
12 --- a/cgecore/cgefinder.py
13 +++ b/cgecore/cgefinder.py
14 @@ -239,8 +239,8 @@
15 align_homo = "".join(kma_results[db][hit]['homo_string'])
16
17 # Extract only aligned sequences
18 - start = re.search("^-*(\w+)", align_query).start(1)
19 - end = re.search("\w+(-*)$", align_query).start(1)
20 + start = re.search(r"^-*(\w+)", align_query).start(1)
21 + end = re.search(r"\w+(-*)$", align_query).start(1)
22
23 kma_results[db][hit]['sbjct_string'] = align_sbjct[start:end]
24 kma_results[db][hit]['query_string'] = align_query[start:end]
25 --- a/cgecore/utility.py
26 +++ b/cgecore/utility.py
27 @@ -134,7 +134,7 @@
28 return inv_map
29
30 class Reg:
31 - """
32 + r"""
33 NAME: Reg - Extended Regular Expression Handler
34 AUTHOR: Martin Thomsen
35 DESCRIPTION:
36 @@ -488,9 +488,9 @@
37 path given as input
38 """
39 # Sanity checkpoint
40 - src = re.sub('[^\w/\-\.\*]', '', src)
41 - dst = re.sub('[^\w/\-\.\*]', '', dst)
42 - if len(re.sub('[\W]', '', src)) < 5 or len(re.sub('[\W]', '', dst)) < 5:
43 + src = re.sub(r'[^\w/\-\.\*]', '', src)
44 + dst = re.sub(r'[^\w/\-\.\*]', '', dst)
45 + if len(re.sub(r'[\W]', '', src)) < 5 or len(re.sub(r'[\W]', '', dst)) < 5:
46 debug.log("Error: Moving file failed. Provided paths are invalid! src='%s' dst='%s'"%(src, dst))
47 else:
48 # Check destination
49 @@ -517,7 +517,7 @@
50 debug.log("Moving File(s)...", "Move from %s"%src, "to %s"%dst)
51 for file_ in files:
52 # Check if file contains invalid symbols:
53 - invalid_chars = re.findall('[^\w/\-\.\*]', os.path.basename(file_))
54 + invalid_chars = re.findall(r'[^\w/\-\.\*]', os.path.basename(file_))
55 if invalid_chars:
56 debug.graceful_exit(("Error: File %s contains invalid "
57 "characters %s!"
58 @@ -536,9 +536,9 @@
59 path given as input
60 """
61 # Sanity checkpoint
62 - src = re.sub('[^\w/\-\.\*]', '', src)
63 - dst = re.sub('[^\w/\-\.\*]', '', dst)
64 - if len(re.sub('[\W]', '', src)) < 5 or len(re.sub('[\W]', '', dst)) < 5:
65 + src = re.sub(r'[^\w/\-\.\*]', '', src)
66 + dst = re.sub(r'[^\w/\-\.\*]', '', dst)
67 + if len(re.sub(r'[\W]', '', src)) < 5 or len(re.sub(r'[\W]', '', dst)) < 5:
68 debug.log("Error: Copying file failed. Provided paths are invalid! src='%s' dst='%s'"%(src, dst))
69 else:
70 # Check destination