From 585b343bc9e69f1f0ea8047b6e34ca9725d5bee0 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 17 Sep 2015 15:48:38 +0200 Subject: [PATCH] Add property to return key with utf8 alterations --- patacrep/songs/chordpro/ast.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/patacrep/songs/chordpro/ast.py b/patacrep/songs/chordpro/ast.py index 09fc5acd..b2cc6c08 100644 --- a/patacrep/songs/chordpro/ast.py +++ b/patacrep/songs/chordpro/ast.py @@ -341,6 +341,11 @@ class Define(Directive): self.fingers = fingers # Can be None super().__init__("define", None) + @property + def pretty_key(self): + """Return the key with nicer (utf8) alteration""" + return self.key.chord.replace('&', '♭').replace('#', '♯') + def __str__(self): return None