Added state persistence to commands. For commands that want to, their state will be saved for the next command to access through the self.caller.ndb.last_cmd variable. The state only persists one command before it is cleared or replaced.

This commit is contained in:
Griatch 2012-02-17 18:53:47 +01:00
parent a6f3e1f47f
commit 6e53e6a1fd
4 changed files with 14 additions and 3 deletions

View file

@ -26,6 +26,8 @@ class CommandMeta(type):
except Exception:
mcs.aliases = []
mcs.aliases = [str(alias).strip() for alias in mcs.aliases]
if not hasattr(mcs, "save_next"):
mcs.save_next = False
# pre-process locks as defined in class definition
temp = []