From: Neil Date: Mon, 12 May 2014 09:01:17 +0000 (+0200) Subject: better action export X-Git-Tag: 0.1~359 X-Git-Url: https://git.ctpug.org.za/?p=naja.git;a=commitdiff_plain;h=2208db6c69d2dbf05dfd65772a01da2af6553172 better action export --- diff --git a/naja/actions.py b/naja/actions.py index 5a3e6e4..2b4d212 100644 --- a/naja/actions.py +++ b/naja/actions.py @@ -26,7 +26,9 @@ class LocationAction(object): return False def export(self): - raise NotImplementedError("TODO") + return {'required_bits': list(self.required_bits), + 'data': self.data, + 'action_class': self.__class__.__name__} class DoNothing(LocationAction): @@ -35,10 +37,6 @@ class DoNothing(LocationAction): def perform_action(self, board, location): pass - def export(self): - return {'required_bits': list(self.required_bits), - 'action_class': 'DoNothing'} - class LoseHealthOrMSB(LocationAction): TEXT = "Lose health. If MSB is set, it will be cleared instead."