Converts this object into a dictionary representation. Note: If no properies or attributes are set other than ``value``, this will return a string.
(self)
| 55 | return plain |
| 56 | |
| 57 | def to_dict(self): |
| 58 | """Converts this object into a dictionary representation. |
| 59 | |
| 60 | Note: |
| 61 | If no properies or attributes are set other than ``value``, |
| 62 | this will return a string. |
| 63 | |
| 64 | """ |
| 65 | # Return a plain string if there is no format specified. |
| 66 | if self.is_plain(): |
| 67 | return self.value |
| 68 | else: |
| 69 | return super(StructuredText, self).to_dict() |
| 70 | |
| 71 | def __str__(self): |
| 72 | """Returns a UTF-8 encoded string representation of the ``value``. |