Skip to content

Commit

Permalink
Make entities generator run under Python 3
Browse files Browse the repository at this point in the history
Fixes #220
  • Loading branch information
sideshowbarker authored and domenic committed May 27, 2020
1 parent 3593258 commit e385e9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion entities/entity-processor-json.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ def codePointToString(codePoint):
else:
codes = str(int(value[1:], 16))
glyphs = codePointToString(int(value[1:], 16))
print ' "&' + name + ';": { "codepoints": [' + codes + '], "characters": "' + glyphs + '" },'
print(' "&' + name + ';": { "codepoints": [' + codes + '], "characters": "' + glyphs + '" },')
4 changes: 2 additions & 2 deletions entities/entity-processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
value1 = value[1:6];
value2 = value[7:];
glyph = '<span data-x="" class="glyph compound">&#x' + value1 + ';&#x' + value2 + ';</span>'
print ' <tr id="entity-' + name + '"> <td> <code data-x="">' + name + ';</code> </td> <td> U+' + value1 + ' U+' + value2 + ' </td> <td> ' + glyph + ' </td> </tr>';
print(' <tr id="entity-' + name + '"> <td> <code data-x="">' + name + ';</code> </td> <td> U+' + value1 + ' U+' + value2 + ' </td> <td> ' + glyph + ' </td> </tr>');
else:
if (value[1:] in ['020DC', '00311', '020DB', '020DB']):
glyph = '<span data-x="" class="glyph composition">&#x025CC;' + '&#x' + value[1:] + ';</span>'
elif ('00000' < value[1:] < '00020'):
glyph = '<span data-x="" class="glyph control">&#x024' + value[4:] + ';</span>'
else:
glyph = '<span data-x="" class="glyph">&#x' + value[1:] + ';</span>'
print ' <tr id="entity-' + name + '"> <td> <code data-x="">' + name + ';</code> </td> <td> U+' + value[1:] + ' </td> <td> ' + glyph + ' </td> </tr>';
print(' <tr id="entity-' + name + '"> <td> <code data-x="">' + name + ';</code> </td> <td> U+' + value[1:] + ' </td> <td> ' + glyph + ' </td> </tr>');

0 comments on commit e385e9b

Please sign in to comment.