+from naja.widgets.base import Widget
+
+
+MARKUP_MAP = {
+ 'NORTH': ('glyphs/arrow_up.png', None),
+ 'SOUTH': ('glyphs/arrow_down.png', None),
+ 'EAST': ('glyphs/arrow_right.png', None),
+ 'WEST': ('glyphs/arrow_left.png', None),
+ 'HEALTH': ('glyphs/health.png', PALETTE.DARK_RED),
+ 'WINTOKEN': ('glyphs/win.png', PALETTE.DARK_OLIVE),
+ 'KEY': ('glyphs/key.png', None),
+ 'MSB': ('glyphs/msb.png', None),
+ 'RED': ('glyphs/key.png', PALETTE.ORANGE),
+ 'GREEN': ('glyphs/key.png', PALETTE.GREEN),
+ 'BLUE': ('glyphs/key.png', PALETTE.BLUE),
+ 'CLOCKWISE': ('glyphs/clockwise.png', None),
+ 'ANTICLOCKWISE': ('glyphs/anticlockwise.png', None),
+ 'SHIFT_LEFT': ('glyphs/shift_left.png', None),
+ 'SHIFT_RIGHT': ('glyphs/shift_right.png', None),
+ 'COUNTDOWN': ('glyphs/countdown_4.png', PALETTE.DARK_VIOLET),
+
+ 'HEALTH_NOCOLOUR': ('glyphs/health.png', None),
+ 'WINTOKEN_NOCOLOUR': ('glyphs/win.png', None),
+}
+
+
+class Glyph(object):
+ def __init__(self, markup_text, glyph_keys, suffix=''):
+ self.markup_text = markup_text
+ self.glyph_keys = glyph_keys
+ self.text = ' ' * len(self.glyph_keys) + suffix