File: 0001-More-hotfix-on-python2-print.patch

package info (click to toggle)
bookworm 1.1.2%2Bgit20210715-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,428 kB
  • sloc: python: 5,482; xml: 222; javascript: 84; sh: 16; makefile: 11
file content (59 lines) | stat: -rw-r--r-- 2,671 bytes parent folder | download | duplicates (3)
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
From: Boyuan Yang <byang@debian.org>
Date: Tue, 20 Jul 2021 16:59:00 -0400
Subject: More hotfix on python2 print

---
 data/scripts/mobi_lib/mobiml2xhtml.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/data/scripts/mobi_lib/mobiml2xhtml.py b/data/scripts/mobi_lib/mobiml2xhtml.py
index 5337fb4..bcd6dbc 100755
--- a/data/scripts/mobi_lib/mobiml2xhtml.py
+++ b/data/scripts/mobi_lib/mobiml2xhtml.py
@@ -241,18 +241,18 @@ class MobiMLConverter(object):
                     self.path.append(tname)
                 elif ttype == 'end':
                     if tname != self.path[-1]:
-                        print ('improper nesting: ', self.path, tname, ttype)
+                        print('improper nesting: ', self.path, tname, ttype)
                         if tname not in self.path:
                             # handle case of end tag with no beginning by injecting empty begin tag
                             taginfo = ('begin', tname, None)
                             htmlstr += self.processtag(taginfo)
-                            print "     - fixed by injecting empty start tag ", tname
+                            print("     - fixed by injecting empty start tag ", tname)
                             self.path.append(tname)
                         elif len(self.path) >  1 and tname == self.path[-2]:
                             # handle case of dangling missing end
                             taginfo = ('end', self.path[-1], None)
                             htmlstr += self.processtag(taginfo)
-                            print "     - fixed by injecting end tag ", self.path[-1]
+                            print("     - fixed by injecting end tag ", self.path[-1])
                             self.path.pop()
                     self.path.pop()
 
@@ -504,18 +504,18 @@ def main(argv=sys.argv):
         infile = argv[1]
 
     try:
-        print 'Converting Mobi Markup Language to XHTML'
+        print('Converting Mobi Markup Language to XHTML')
         mlc = MobiMLConverter(infile)
-        print 'Processing ...'
+        print('Processing ...')
         htmlstr, css, cssname = mlc.processml()
         outname = infile.rsplit('.',1)[0] + '_converted.html'
         file(outname, 'wb').write(htmlstr)
         file(cssname, 'wb').write(css)
-        print 'Completed'
-        print 'XHTML version of book can be found at: ' + outname
+        print('Completed')
+        print('XHTML version of book can be found at: ' + outname)
 
-    except ValueError, e:
-        print "Error: %s" % e
+    except ValueError as e:
+        print("Error: " + e)
         return 1
 
     return 0