Overrideable messages
authorStefano Rivera <stefano@rivera.za.net>
Sat, 17 May 2014 17:42:36 +0000 (19:42 +0200)
committerStefano Rivera <stefano@rivera.za.net>
Sat, 17 May 2014 17:42:51 +0000 (19:42 +0200)
naja/actions.py

index c0f19c634cf62443bd2af5bce8bf145bd7098a59..c96a219a6ec28e9382d0abc81c88d8736f7498b1 100644 (file)
@@ -46,7 +46,11 @@ class LocationAction(object):
             substitutions['location_bits'] = bit_glyphs(
                 location.bitwise_operand)
 
-        return self.TEXT % substitutions
+        text = self.TEXT
+        if self.data.get('message', None) is not None:
+            text = self.data['message']
+
+        return text % substitutions
 
     def check_available(self, player):
         return player.bits.check_bits(self.required_bits)