gtksourceview2: patch for python3
This commit is contained in:
parent
7704098950
commit
1c541dafb3
|
@ -0,0 +1,59 @@
|
|||
--- a/gtksourceview/language-specs/convert.py
|
||||
+++ b/gtksourceview/language-specs/convert.py
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import xml.dom.minidom as dom
|
||||
-import cgi
|
||||
+import html
|
||||
|
||||
default_styles = {
|
||||
'Comment' : 'def:comment',
|
||||
@@ -29,7 +29,7 @@
|
||||
raise RuntimeError("don't know how to escape '%s'" % (ch,))
|
||||
|
||||
def escape_regex(s):
|
||||
- return cgi.escape(s)
|
||||
+ return html.escape(s)
|
||||
|
||||
def normalize_id(id):
|
||||
if id == "C#":
|
||||
@@ -91,9 +91,9 @@
|
||||
if self.mimetypes or self.globs:
|
||||
string += indent + '<metadata>\n'
|
||||
if self.mimetypes:
|
||||
- string += 2*indent + '<property name="mimetypes">%s</property>\n' % (cgi.escape(self.mimetypes),)
|
||||
+ string += 2*indent + '<property name="mimetypes">%s</property>\n' % (html.escape(self.mimetypes),)
|
||||
if self.globs:
|
||||
- string += 2*indent + '<property name="globs">%s</property>\n' % (cgi.escape(self.globs),)
|
||||
+ string += 2*indent + '<property name="globs">%s</property>\n' % (html.escape(self.globs),)
|
||||
string += indent + '</metadata>\n\n'
|
||||
|
||||
return string
|
||||
@@ -175,7 +175,7 @@
|
||||
self.is_container = False
|
||||
|
||||
def format(self, indent, esc_ctx, line_esc_ctx):
|
||||
- print "Implement me: %s.format()" % (type(self).__name__,)
|
||||
+ print("Implement me: %s.format()" % (type(self).__name__,))
|
||||
return indent*2 + '<context id="%s"/>\n' % (self.id)
|
||||
|
||||
def format_escape(self, indent, esc_ctx, line_esc_ctx):
|
||||
@@ -472,7 +472,7 @@
|
||||
elif cur.tagName == "syntax-item":
|
||||
ctx = parseSyntaxItem(cur, name, _name, style)
|
||||
else:
|
||||
- print "Unknown tag: %s" % (cur.tagName,)
|
||||
+ print("Unknown tag: %s" % (cur.tagName,))
|
||||
ctx = None
|
||||
|
||||
return ctx
|
||||
@@ -510,7 +510,7 @@
|
||||
import sys
|
||||
|
||||
if not sys.argv[1:]:
|
||||
- print "usage: %s LANG_FILE" % (sys.argv[0])
|
||||
+ print("usage: %s LANG_FILE" % (sys.argv[0]))
|
||||
sys.exit(1)
|
||||
|
||||
lang_file = parse_file(sys.argv[1])
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'gtksourceview2'
|
||||
pkgname=gtksourceview2
|
||||
version=2.10.5
|
||||
revision=7
|
||||
revision=8
|
||||
build_style=gnu-configure
|
||||
configure_args="--disable-static"
|
||||
hostmakedepends="pkg-config intltool glib-devel"
|
||||
|
@ -12,8 +12,7 @@ license="GPL-2.0-or-later"
|
|||
homepage="http://www.gnome.org"
|
||||
distfiles="${GNOME_SITE}/gtksourceview/2.10/gtksourceview-${version}.tar.bz2"
|
||||
checksum=c585773743b1df8a04b1be7f7d90eecdf22681490d6810be54c81a7ae152191e
|
||||
# convert.py:178
|
||||
python_version=2
|
||||
python_version=3
|
||||
|
||||
post_patch() {
|
||||
vsed -i -e 's/DATADIRNAME=lib/DATADIRNAME=share/' configure
|
||||
|
|
Loading…
Reference in New Issue