diff options
author | Walther Neuper <neuper@neuper.(none)> | 2009-12-16 11:45:20 (GMT) |
---|---|---|
committer | Walther Neuper <neuper@neuper.(none)> | 2009-12-16 11:45:20 (GMT) |
commit | 597276ae03251fc1e71fdf20467d1c794c3c232e (patch) | |
tree | 398cdae273174bed40f98e5763b9bbacad877a1e /ReckonPrimer.tests | |
parent | ee3fec155d170b9a8a801bc28e0f6934043b185f (diff) |
added collection/test_, started debug setts
Diffstat (limited to 'ReckonPrimer.tests')
-rw-r--r-- | ReckonPrimer.tests/collection/test_collection_MM091214.py | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/ReckonPrimer.tests/collection/test_collection_MM091214.py b/ReckonPrimer.tests/collection/test_collection_MM091214.py deleted file mode 100644 index 8e1134b..0000000 --- a/ReckonPrimer.tests/collection/test_collection_MM091214.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: UTF8 -*- -"""tests on collection class""" - -class collection: - - def __init__(self, name): - self._data = [] - self._name = name - self._pic = "" - - def add(self, x): - self._data.append(x) - - def delete(self, n): - del self._data[n] - - def show(self, top): - """ prints recursively all elements of this collection """ - #only for test reasons - print("**********") - print "collection: ", self._name - print "elements:" - for el in self._data: - el.show(False) - print "---- end of ", self._name - if top: - print # print an empty line after the last element - -class task: - def __init__(self, name): - self._name = name - def show(self, top): - print "task: ", self._name - - -root = collection("root") -c1 = collection("c1") -t1 = task("t1") -t2 = task("t2") -c1.add(t1) -c1.add(t2) -c3 = collection("c3") -c3.add(t2) -c3.add(t1) -c1.add(c3) -root.add(c1) -# created: [[t1, t2, [t2, t1]]] -root.show(True) - -# Versuch in einer Schleife dynamisch auf ein mit Koordinaten spezifiertes Object zuzugreifen -co=[0,2] # Koordinaten -print "pick element ", co -el = root -for n in co: - el = el._data[n] - -el.show(True) # gewähltes Element anzeigen - -# funktioniert! - - - - |