projects
/
koperkapel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a509360
)
Poppable.
author
Simon Cross
<hodgestar@gmail.com>
Sat, 5 Mar 2016 22:30:06 +0000
(
00:30
+0200)
committer
Simon Cross
<hodgestar@gmail.com>
Sat, 5 Mar 2016 22:30:06 +0000
(
00:30
+0200)
koperkapel/world.py
patch
|
blob
|
history
diff --git
a/koperkapel/world.py
b/koperkapel/world.py
index 14746f530760e6a092345b7f78abf834430a7598..a07b719a41a79e5882d8fcb7b2da03dfdb8bb7b9 100644
(file)
--- a/
koperkapel/world.py
+++ b/
koperkapel/world.py
@@
-66,6
+66,11
@@
class World:
obj, key = self._get_obj(name)
obj.append(value)
+ def _apply_pop(self, action, updates):
+ for name, pos in updates.items():
+ obj, key = self._get_obj(name)
+ obj.pop(pos)
+
def _apply_reset(self, action):
self._state = self._build_initial_state()
@@
-156,3
+161,6
@@
class WorldListProxy(WorldBaseProxy):
def append(self, value):
self._top._record_change(self._prefix, value, action="append")
+
+ def pop(self, pos=0):
+ self._top._record_change(self._prefix, pos, action="pop")