From: Merlijn van Deen (valhallasw) Date: Mon, 26 Sep 2011 08:39:53 +0000 (+0200) Subject: Added nicer __repr__esentation to Wave and Folder objects X-Git-Tag: v0.2~24^2~5^2^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f805b08f2ddfcbcfbcedce2cf57f43b234d9739c;p=igor.git Added nicer __repr__esentation to Wave and Folder objects --- 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):