Skip to content

Commit 1848ce4

Browse files
committed
* doc/mkfuncdocs.py, doc/mkqhcp.py: update for python 3.12 warnings
1 parent 31ee05b commit 1848ce4

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

doc/mkfuncdocs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
## along with this program. If not, see
1717
## <https://www.gnu.org/licenses/>.
1818

19-
## mkfuncdocs v1.0.6
19+
## mkfuncdocs v1.0.7
2020
## mkfuncdocs.py will attempt to extract the help texts from functions in src
2121
## dirs, extracting only those that are in the specifed INDEX file and output them
2222
## to stdout in texi format
@@ -79,7 +79,7 @@ def texify_line(line):
7979
def find_defun_line_in_file(filename, fnname):
8080
linecnt = 0
8181

82-
defun_line=re.compile("^DEFUN_DLD\s*\(\s*{}".format(fnname))
82+
defun_line=re.compile(r"^DEFUN_DLD\s*\(\s*{}".format(fnname))
8383
with open(filename, 'rt') as f:
8484
for line in f:
8585
if re.match(defun_line, line):

doc/mkqhcp.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/python3
22

33
## mkqhcp.py
4-
## Version 1.0.2
4+
## Version 1.0.3
55

66
## Copyright 2022-2023 John Donoghue
77
##
@@ -41,7 +41,7 @@ def process(name):
4141
f.write ('</QHelpCollectionProject>\n')
4242

4343
title = name
44-
pat_match = re.compile(".*<title>(?P<title>[^<]+)</title>.*")
44+
pat_match = re.compile(r".*<title>(?P<title>[^<]+)</title>.*")
4545
with open(name + ".html", 'rt') as fin:
4646
# find html
4747
for line in fin:
@@ -51,20 +51,20 @@ def process(name):
5151
title = e.group("title")
5252
break
5353

54-
h2_match = re.compile('.*<h2 class="chapter"[^>]*>(?P<title>[^<]+)</h2>.*')
55-
h3_match = re.compile('.*<h3 class="section"[^>]*>(?P<title>[^<]+)</h3>.*')
56-
h4_match = re.compile('.*<h4 class="subsection"[^>]*>(?P<title>[^<]+)</h4>.*')
57-
tag_match1 = re.compile('.*<span id="(?P<tag>[^"]+)"[^>]*></span>.*')
58-
#tag_match2 = re.compile('.*<div class="[sub]*section" id="(?P<tag>[^"]+)"[^>]*>.*')
59-
tag_match2 = re.compile('.*<div class="[sub]*section[^"]*" id="(?P<tag>[^"]+)"[^>]*>.*')
60-
tag_match3 = re.compile('.*<div class="chapter-level-extent" id="(?P<tag>[^"]+)"[^>]*>.*')
61-
index_match = re.compile('.*<h4 class="subsection"[^>]*>[\d\.\s]*(?P<name>[^<]+)</h4>.*')
54+
h2_match = re.compile(r'.*<h2 class="chapter"[^>]*>(?P<title>[^<]+)</h2>.*')
55+
h3_match = re.compile(r'.*<h3 class="section"[^>]*>(?P<title>[^<]+)</h3>.*')
56+
h4_match = re.compile(r'.*<h4 class="subsection"[^>]*>(?P<title>[^<]+)</h4>.*')
57+
tag_match1 = re.compile(r'.*<span id="(?P<tag>[^"]+)"[^>]*></span>.*')
58+
#tag_match2 = re.compile(r'.*<div class="[sub]*section" id="(?P<tag>[^"]+)"[^>]*>.*')
59+
tag_match2 = re.compile(r'.*<div class="[sub]*section[^"]*" id="(?P<tag>[^"]+)"[^>]*>.*')
60+
tag_match3 = re.compile(r'.*<div class="chapter-level-extent" id="(?P<tag>[^"]+)"[^>]*>.*')
61+
index_match = re.compile(r'.*<h4 class="subsection"[^>]*>[\d\.\s]*(?P<name>[^<]+)</h4>.*')
6262

6363
tag = "top"
6464
has_h2 = False
6565
has_h3 = False
6666

67-
#pat_match = re.compile('.*<span id="(?P<tag>[^"])"></span>(?P<title>[.]+)$')
67+
#pat_match = re.compile(r'.*<span id="(?P<tag>[^"])"></span>(?P<title>[.]+)$')
6868
with open(name + ".html", 'rt') as fin:
6969
with open(name + ".qhp", 'wt') as f:
7070
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')

0 commit comments

Comments
 (0)