-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpy312_fix.patch
85 lines (75 loc) · 3.21 KB
/
py312_fix.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
diff -uNrp a/ldoce5viewer/ldoce5/extract.py b/ldoce5viewer/ldoce5/extract.py
--- a/ldoce5viewer/ldoce5/extract.py 2018-03-09 07:31:10.000000000 +0000
+++ b/ldoce5viewer/ldoce5/extract.py 2024-04-04 01:46:43.391462108 +0100
@@ -6,7 +6,7 @@ from __future__ import absolute_import
from __future__ import unicode_literals
import re
-from cgi import escape
+from html import escape
from itertools import chain
import lxml.etree as et
diff -uNrp a/ldoce5viewer/ldoce5/idmreader.py b/ldoce5viewer/ldoce5/idmreader.py
--- a/ldoce5viewer/ldoce5/idmreader.py 2018-03-09 07:31:10.000000000 +0000
+++ b/ldoce5viewer/ldoce5/idmreader.py 2024-04-04 02:27:26.733504457 +0100
@@ -6,7 +6,7 @@ import os.path
from struct import unpack
from zlib import decompress
try:
- from configparser import SafeConfigParser
+ from configparser import ConfigParser
except:
from ConfigParser import SafeConfigParser
@@ -82,9 +82,9 @@ def is_ldoce5_dir(path):
def list_files(data_root, archive_name):
def _parse_cft(path):
- cp = SafeConfigParser()
+ cp = ConfigParser()
with open(path, 'r') as f:
- cp.readfp(f)
+ cp.read_file(f)
r = {}
r['offsets'] = {}
offset = 0
diff -uNrp a/ldoce5viewer/ldoce5/transform.py b/ldoce5viewer/ldoce5/transform.py
--- a/ldoce5viewer/ldoce5/transform.py 2018-03-09 07:31:10.000000000 +0000
+++ b/ldoce5viewer/ldoce5/transform.py 2024-04-04 01:47:09.961908140 +0100
@@ -6,7 +6,7 @@ This module generates HTML data from LDO
from __future__ import absolute_import
from __future__ import unicode_literals
-from cgi import escape
+from html import escape
import lxml.etree as et
diff -uNrp a/ldoce5viewer/qtgui/indexer.py b/ldoce5viewer/qtgui/indexer.py
--- a/ldoce5viewer/qtgui/indexer.py 2018-03-09 07:31:10.000000000 +0000
+++ b/ldoce5viewer/qtgui/indexer.py 2024-04-04 01:46:04.610811106 +0100
@@ -10,7 +10,7 @@ try:
import cPickle as pickle
except:
import pickle
-from cgi import escape
+from html import escape
from struct import Struct
import traceback
diff -uNrp a/ldoce5viewer/qtgui/ui/custom.py b/ldoce5viewer/qtgui/ui/custom.py
--- a/ldoce5viewer/qtgui/ui/custom.py 2018-03-09 07:31:10.000000000 +0000
+++ b/ldoce5viewer/qtgui/ui/custom.py 2024-04-04 02:04:45.003621642 +0100
@@ -83,10 +83,10 @@ class LineEdit(QLineEdit):
rect = self.rect()
self._buttonFind.move(
framewidth + 3 - 1,
- (rect.height() - ICONSIZE) / 2 - 1)
+ (rect.height() - ICONSIZE) // 2 - 1)
self._buttonClear.move(
rect.width() - framewidth - 3 - ICONSIZE - 1,
- (rect.height() - ICONSIZE) / 2 - 1)
+ (rect.height() - ICONSIZE) // 2 - 1)
def __onTextChanged(self, text):
self._buttonClear.setVisible(bool(text))
@@ -147,7 +147,7 @@ class HtmlListWidget(QListWidget):
doc = self._doc
doc.setDefaultFont(option.font)
doc.setHtml('<body>MNmn012<span class="p">012</span></body>')
- height = doc.size().height() + self.MARGIN_V * 2
+ height = int(doc.size().height() + self.MARGIN_V * 2)
s = self._item_size = QSize(0, height)
return s