Get a I{flattened} list of this nodes contents. @param collection: A list to fill. @type collection: list @param filter: A filter used to constrain the result. @type filter: L{Filter} @param history: The history list used to prevent cyclic dependency.
(self, collection=None, filter=Filter(), history=None)
| 400 | setattr(self, n, v) |
| 401 | |
| 402 | def content(self, collection=None, filter=Filter(), history=None): |
| 403 | """ |
| 404 | Get a I{flattened} list of this nodes contents. |
| 405 | @param collection: A list to fill. |
| 406 | @type collection: list |
| 407 | @param filter: A filter used to constrain the result. |
| 408 | @type filter: L{Filter} |
| 409 | @param history: The history list used to prevent cyclic dependency. |
| 410 | @type history: list |
| 411 | @return: The filled list. |
| 412 | @rtype: list |
| 413 | """ |
| 414 | if collection is None: |
| 415 | collection = [] |
| 416 | if history is None: |
| 417 | history = [] |
| 418 | if self in history: |
| 419 | return collection |
| 420 | history.append(self) |
| 421 | if self in filter: |
| 422 | collection.append(self) |
| 423 | for c in self.rawchildren: |
| 424 | c.content(collection, filter, history[:]) |
| 425 | return collection |
| 426 | |
| 427 | def str(self, indent=0, history=None): |
| 428 | """ |
no test coverage detected