From f805b08f2ddfcbcfbcedce2cf57f43b234d9739c Mon Sep 17 00:00:00 2001 From: "Merlijn van Deen (valhallasw)" Date: Mon, 26 Sep 2011 10:39:53 +0200 Subject: [PATCH] Added nicer __repr__esentation to Wave and Folder objects --- igor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/igor.py b/igor.py index 9c68111..16704be 100644 --- a/igor.py +++ b/igor.py @@ -208,6 +208,8 @@ class Wave(ParseObject): def __array__(self): return self.data + __repr__ = __str__ = lambda s: u"" % s.format() + class Recreation(ParseObject): """ Contains the experiment's recreation procedures as plain text. @@ -279,6 +281,12 @@ class Folder(object): if isinstance(r, (Folder,Wave)) and r.name == key: return r raise KeyError("Folder %s does not exist"%key) + + def __str__(self): + return u"" % "/".join(self.path) + + __repr__ = __str__ + def append(self, record): self.children.append(record) def format(self, indent=0): -- 2.26.2