Show More
@@ -389,7 +389,19 b' class DisplayObject(object):' | |||||
389 |
|
389 | |||
390 |
|
390 | |||
391 | class TextDisplayObject(DisplayObject): |
|
391 | class TextDisplayObject(DisplayObject): | |
392 | """Validate that display data is text""" |
|
392 | """Create a text display object given raw data. | |
|
393 | ||||
|
394 | Parameters | |||
|
395 | ---------- | |||
|
396 | data : str or unicode | |||
|
397 | The raw data or a URL or file to load the data from. | |||
|
398 | url : unicode | |||
|
399 | A URL to download the data from. | |||
|
400 | filename : unicode | |||
|
401 | Path to a local file to load the data from. | |||
|
402 | metadata : dict | |||
|
403 | Dict of metadata associated to be the object when displayed | |||
|
404 | """ | |||
393 | def _check_data(self): |
|
405 | def _check_data(self): | |
394 | if self.data is not None and not isinstance(self.data, str): |
|
406 | if self.data is not None and not isinstance(self.data, str): | |
395 | raise TypeError("%s expects text, not %r" % (self.__class__.__name__, self.data)) |
|
407 | raise TypeError("%s expects text, not %r" % (self.__class__.__name__, self.data)) |
General Comments 0
You need to be logged in to leave comments.
Login now