Add an entire element. This is the same as calling :meth:`start`, :meth:`data`, and :meth:`end` in sequence. The *text* argument can be omitted.
(self, tag, text=None, attrib=None, **extra)
| 235 | self.end() |
| 236 | |
| 237 | def element(self, tag, text=None, attrib=None, **extra): |
| 238 | """ |
| 239 | Add an entire element. This is the same as calling :meth:`start`, |
| 240 | :meth:`data`, and :meth:`end` in sequence. The *text* argument can be |
| 241 | omitted. |
| 242 | """ |
| 243 | if attrib is None: |
| 244 | attrib = {} |
| 245 | self.start(tag, attrib, **extra) |
| 246 | if text: |
| 247 | self.data(text) |
| 248 | self.end(indent=False) |
| 249 | |
| 250 | def flush(self): |
| 251 | """Flush the output stream.""" |
no test coverage detected