[gnome-icon-theme-extras] Use python3 syntax
- From: Jakub Steiner <jimmac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-icon-theme-extras] Use python3 syntax
- Date: Wed, 2 Jan 2013 12:59:03 +0000 (UTC)
commit 98f75118a03add7915fdcdb56d93c91789c2b326
Author: Jakub Steiner <jimmac gmail com>
Date: Wed Jan 2 13:58:25 2013 +0100
Use python3 syntax
- patch by Matthias Clasen from https://bugzilla.gnome.org/show_bug.cgi?id=690363
render-icon-theme.py | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/render-icon-theme.py b/render-icon-theme.py
index 4e486d5..c746d9b 100755
--- a/render-icon-theme.py
+++ b/render-icon-theme.py
@@ -57,7 +57,7 @@ class ContentHandler(xml.sax.ContentHandler):
self.inside.append(self.SVG)
return
elif self.inside[-1] == self.SVG:
- if (name == "g" and attrs.has_key('inkscape:groupmode') and attrs.has_key('inkscape:label')
+ if (name == "g" and ('inkscape:groupmode' in attrs) and ('inkscape:label' in attrs)
and attrs['inkscape:groupmode'] == 'layer' and attrs['inkscape:label'] == 'baseplate'):
self.stack.append(self.LAYER)
self.inside.append(self.LAYER)
@@ -66,13 +66,13 @@ class ContentHandler(xml.sax.ContentHandler):
self.rects = []
return
elif self.inside[-1] == self.LAYER:
- if name == "text" and attrs.has_key('inkscape:label') and attrs['inkscape:label'] == 'context':
+ if name == "text" and ('inkscape:label' in attrs) and attrs['inkscape:label'] == 'context':
self.stack.append(self.TEXT)
self.inside.append(self.TEXT)
self.text='context'
self.chars = ""
return
- elif name == "text" and attrs.has_key('inkscape:label') and attrs['inkscape:label'] == 'icon-name':
+ elif name == "text" and ('inkscape:label' in attrs) and attrs['inkscape:label'] == 'icon-name':
self.stack.append(self.TEXT)
self.inside.append(self.TEXT)
self.text='icon-name'
@@ -99,7 +99,7 @@ class ContentHandler(xml.sax.ContentHandler):
elif stacked == self.LAYER:
assert self.icon_name
assert self.context
- print '%s %s' % (self.context, self.icon_name)
+ print (self.context, ' ', self.icon_name)
for rect in self.rects:
width = rect['width']
height = rect['height']
@@ -131,7 +131,7 @@ class ContentHandler(xml.sax.ContentHandler):
if len(sys.argv) == 1:
if not os.path.exists('gnome'):
os.mkdir('gnome')
- print 'Rendering from SVGs in %s' % SRC
+ print ('Rendering from SVGs in ', SRC)
for file in os.listdir(SRC):
if file[-4:] == '.svg':
file = os.path.join(SRC, file)
@@ -143,7 +143,7 @@ else:
handler = ContentHandler(file, True)
xml.sax.parse(open(file), handler)
else:
- print "Error: No such file %s" % file
+ print ("Error: No such file ", file)
sys.exit(1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]