From a395b89a9f4729b0ee707d32074f3f66bcf6972a Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Mon, 1 Oct 2007 17:56:23 +0200 Subject: Added get_stripped to the Event-class to get an override-free line. --- pykfx/__init__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pykfx/__init__.py') diff --git a/pykfx/__init__.py b/pykfx/__init__.py index 4ef55f1..cac268d 100644 --- a/pykfx/__init__.py +++ b/pykfx/__init__.py @@ -104,6 +104,9 @@ class Event: def __str__(self): return '%s: %s' % (self.kind.capitalize(), ','.join([getattr(self, x.lower()) for x in self.format])) + def get_stripped(self): + return re.sub(r'\{[^}]*\}', '', self.text) + def parse(self, s): s = s.split(': ', 1) self.kind = s[0].lower() -- cgit v1.2.3