Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. fb_tools/bdf_to_c.py: make it compatible with python3 This would break python2 compatibility. Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 --- M src/host/fb_tools/bdf_to_c.py 1 file changed, 33 insertions(+), 33 deletions(-) Approvals: fixeria: Looks good to me, approved pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/fb_tools/bdf_to_c.py b/src/host/fb_tools/bdf_to_c.py index 86be6a6..ebeb7f9 100755 --- a/src/host/fb_tools/bdf_to_c.py +++ b/src/host/fb_tools/bdf_to_c.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' @@ -133,7 +133,7 @@ arr = l.split(None,1) if len(arr) < 2 and \ arr[0].lower() != 'STARTCHAR' : - print >>sys.stderr,'Not start of glyph: %s'%(l) + print('Not start of glyph: %s'%(l), file=sys.stderr) continue inchar = unique_name(arr[1],self.glyphs) continue @@ -159,7 +159,7 @@ continue if len(arr) < 2 : - print >>sys.stderr,'Bad line in font: %s'%(l) + print('Bad line in font: %s'%(l), file=sys.stderr) continue data[arr[0].lower()] = arr[1] @@ -183,40 +183,40 @@ if opts.firstchar == None : opts.firstchar = min(font.enc) - print 'First character in font: %d, %s'%(opts.firstchar, - font.enc[opts.firstchar]) + print('First character in font: %d, %s'%(opts.firstchar, + font.enc[opts.firstchar])) if opts.lastchar == None : opts.lastchar = max(font.enc) - print 'Last character in font: %d, %s'%(opts.lastchar, - font.enc[opts.lastchar]) + print('Last character in font: %d, %s'%(opts.lastchar, + font.enc[opts.lastchar])) if opts.base == None : opts.base = 'font_'+os.path.basename(args[0]) if opts.base[-4:] == '.bdf' : opts.base = opts.base[:-4] - print >>sys.stderr,'Guessing symbol prefix to be %s.'%(opts.base) + print('Guessing symbol prefix to be %s.'%(opts.base), file=sys.stderr) if opts.out == None : opts.out = os.path.basename(args[0]) if opts.out[-4:] == '.bdf' : opts.out = opts.out[:-4] opts.out = opts.out + '.c' - print >>sys.stderr,'Guessing output filename to be %s.'%(opts.out) + print('Guessing output filename to be %s.'%(opts.out), file=sys.stderr) if os.path.exists(opts.out) : - print >>sys.stderr,'Will *NOT* overwrite existing file when guessing output!' + print('Will *NOT* overwrite existing file when guessing output!', file=sys.stderr) sys.exit(1) of = file(opts.out,'w') - print >>of,'#include ' - print >>of,'/* file autogenerated by %s */'%(sys.argv[0]) + print('#include ', file=of) + print('/* file autogenerated by %s */' %(sys.argv[0]), file=of) offsets = list() glyphnames = list() - print >>of,'static const uint8_t %s_data[] = {'%(opts.base) + print('static const uint8_t %s_data[] = {'%(opts.base), file=of) pos = 0 @@ -236,8 +236,8 @@ bitmap = glyph['bitmap'] if bbx[1] != len(bitmap) : - print >>sys.stderr,'ERROR: glyph',charname,'has wrong number of lines of data!' - print >>sys.stderr,' want: ',bbx[1],'but have',len(bitmap) + print('ERROR: glyph',charname,'has wrong number of lines of data!', file=sys.stderr) + print(' want: ',bbx[1],'but have',len(bitmap), file=sys.stderr) sys.exit(1) removedrows = 0 @@ -254,40 +254,40 @@ bitmap = bitmap[:-1] if removedrows > 0 : - print "Glyph %s: removed %d rows."%(charname,removedrows) + print("Glyph %s: removed %d rows."%(charname,removedrows)) w = int(glyph['dwidth'].split(None,1)[0]) - print >>of,'/* --- new character %s %s starting at offset 0x%04x --- */'%( -
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 4: BTW: true Pythonic way would be to use the logging module ;) Anyway, feel free to merge. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: pespin Gerrit-Comment-Date: Fri, 09 Aug 2019 10:26:36 + Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: pespin Gerrit-Comment-Date: Mon, 22 Jul 2019 20:50:37 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: pespin Gerrit-Comment-Date: Mon, 22 Jul 2019 16:43:57 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
Hello pespin, fixeria, laforge, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 to look at the new patch set (#4). Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. fb_tools/bdf_to_c.py: make it compatible with python3 This would break python2 compatibility. Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 --- M src/host/fb_tools/bdf_to_c.py 1 file changed, 33 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/58/14758/4 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 3: -Code-Review Indeed, good catch :) -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: pespin Gerrit-Comment-Date: Fri, 19 Jul 2019 12:46:32 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 3: -Code-Review (1 comment) https://gerrit.osmocom.org/#/c/14758/3/src/host/fb_tools/bdf_to_c.py File src/host/fb_tools/bdf_to_c.py: https://gerrit.osmocom.org/#/c/14758/3/src/host/fb_tools/bdf_to_c.py@1 PS3, Line 1: /usr/bin/python3 wait, let's do it properly '/usr/bin/env python3'. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: pespin Gerrit-Comment-Date: Fri, 19 Jul 2019 12:44:59 + Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: pespin Gerrit-Comment-Date: Fri, 19 Jul 2019 12:43:47 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: pespin Gerrit-Comment-Date: Fri, 19 Jul 2019 12:36:01 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 3: updated shebang -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: pespin Gerrit-Comment-Date: Fri, 19 Jul 2019 12:33:29 + Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
Hello pespin, fixeria, laforge, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 to look at the new patch set (#3). Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. fb_tools/bdf_to_c.py: make it compatible with python3 This would break python2 compatibility. Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 --- M src/host/fb_tools/bdf_to_c.py 1 file changed, 33 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/58/14758/3 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-MessageType: newpatchset
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: laforge Gerrit-Reviewer: pespin Gerrit-Comment-Date: Tue, 16 Jul 2019 18:00:23 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: laforge Gerrit-Comment-Date: Sun, 14 Jul 2019 04:01:03 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 to look at the new patch set (#2). Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. fb_tools/bdf_to_c.py: make it compatible with python3 This would break python2 compatibility. Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 --- M src/host/fb_tools/bdf_to_c.py 1 file changed, 32 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/58/14758/2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-MessageType: newpatchset
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 ) Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/14758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 Gerrit-Change-Number: 14758 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 11 Jul 2019 14:33:28 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
Change in ...osmocom-bb[master]: fb_tools/bdf_to_c.py: make it compatible with python3
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/14758 Change subject: fb_tools/bdf_to_c.py: make it compatible with python3 .. fb_tools/bdf_to_c.py: make it compatible with python3 Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235 --- M src/host/fb_tools/bdf_to_c.py 1 file changed, 32 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/58/14758/1 diff --git a/src/host/fb_tools/bdf_to_c.py b/src/host/fb_tools/bdf_to_c.py index 86be6a6..81b3b44 100755 --- a/src/host/fb_tools/bdf_to_c.py +++ b/src/host/fb_tools/bdf_to_c.py @@ -133,7 +133,7 @@ arr = l.split(None,1) if len(arr) < 2 and \ arr[0].lower() != 'STARTCHAR' : - print >>sys.stderr,'Not start of glyph: %s'%(l) + print('Not start of glyph: %s'%(l), file=sys.stderr) continue inchar = unique_name(arr[1],self.glyphs) continue @@ -159,7 +159,7 @@ continue if len(arr) < 2 : - print >>sys.stderr,'Bad line in font: %s'%(l) + print('Bad line in font: %s'%(l), file=sys.stderr) continue data[arr[0].lower()] = arr[1] @@ -183,40 +183,40 @@ if opts.firstchar == None : opts.firstchar = min(font.enc) - print 'First character in font: %d, %s'%(opts.firstchar, - font.enc[opts.firstchar]) + print('First character in font: %d, %s'%(opts.firstchar, + font.enc[opts.firstchar])) if opts.lastchar == None : opts.lastchar = max(font.enc) - print 'Last character in font: %d, %s'%(opts.lastchar, - font.enc[opts.lastchar]) + print('Last character in font: %d, %s'%(opts.lastchar, + font.enc[opts.lastchar])) if opts.base == None : opts.base = 'font_'+os.path.basename(args[0]) if opts.base[-4:] == '.bdf' : opts.base = opts.base[:-4] - print >>sys.stderr,'Guessing symbol prefix to be %s.'%(opts.base) + print('Guessing symbol prefix to be %s.'%(opts.base), file=sys.stderr) if opts.out == None : opts.out = os.path.basename(args[0]) if opts.out[-4:] == '.bdf' : opts.out = opts.out[:-4] opts.out = opts.out + '.c' - print >>sys.stderr,'Guessing output filename to be %s.'%(opts.out) + print('Guessing output filename to be %s.'%(opts.out), file=sys.stderr) if os.path.exists(opts.out) : - print >>sys.stderr,'Will *NOT* overwrite existing file when guessing output!' + print('Will *NOT* overwrite existing file when guessing output!', file=sys.stderr) sys.exit(1) of = file(opts.out,'w') - print >>of,'#include ' - print >>of,'/* file autogenerated by %s */'%(sys.argv[0]) + print('#include ', file=of) + print('/* file autogenerated by %s */' %(sys.argv[0]), file=of) offsets = list() glyphnames = list() - print >>of,'static const uint8_t %s_data[] = {'%(opts.base) + print('static const uint8_t %s_data[] = {'%(opts.base), file=of) pos = 0 @@ -236,8 +236,8 @@ bitmap = glyph['bitmap'] if bbx[1] != len(bitmap) : - print >>sys.stderr,'ERROR: glyph',charname,'has wrong number of lines of data!' - print >>sys.stderr,' want: ',bbx[1],'but have',len(bitmap) + print('ERROR: glyph',charname,'has wrong number of lines of data!', file=sys.stderr) + print(' want: ',bbx[1],'but have',len(bitmap), file=sys.stderr) sys.exit(1) removedrows = 0 @@ -254,40 +254,40 @@ bitmap = bitmap[:-1] if removedrows > 0 : - print "Glyph %s: removed %d rows."%(charname,removedrows) + print("Glyph %s: removed %d rows."%(charname,removedrows)) w = int(glyph['dwidth'].split(None,1)[0]) - print >>of,'/* --- new character %s %s starting at offset 0x%04x --- */'%( - charname,ascii_charnum(i),pos) - print >>of,'\t/*%04x:*/\t%d, %d, %d, %d, %d, /* width and bbox (w,h,x,y) */'%( - pos,w,bbx[0],bbx[1],bbx[2],bbx[3]) +