Show More
@@ -299,6 +299,7 b' class DisplayObject(object):' | |||||
299 | """An object that wraps data to be displayed.""" |
|
299 | """An object that wraps data to be displayed.""" | |
300 |
|
300 | |||
301 | _read_flags = 'r' |
|
301 | _read_flags = 'r' | |
|
302 | _show_mem_addr = False | |||
302 |
|
303 | |||
303 | def __init__(self, data=None, url=None, filename=None): |
|
304 | def __init__(self, data=None, url=None, filename=None): | |
304 | """Create a display object given raw data. |
|
305 | """Create a display object given raw data. | |
@@ -335,7 +336,15 b' class DisplayObject(object):' | |||||
335 |
|
336 | |||
336 | self.reload() |
|
337 | self.reload() | |
337 | self._check_data() |
|
338 | self._check_data() | |
338 |
|
339 | |||
|
340 | def __repr__(self): | |||
|
341 | if not self._show_mem_addr: | |||
|
342 | cls = self.__class__ | |||
|
343 | r = "<%s.%s object>" % (cls.__module__, cls.__name__) | |||
|
344 | else: | |||
|
345 | r = super(DisplayObject, self).__repr__() | |||
|
346 | return r | |||
|
347 | ||||
339 | def _check_data(self): |
|
348 | def _check_data(self): | |
340 | """Override in subclasses if there's something to check.""" |
|
349 | """Override in subclasses if there's something to check.""" | |
341 | pass |
|
350 | pass |
General Comments 0
You need to be logged in to leave comments.
Login now