Tree command.
(self, *args)
| 487 | self.bound = True |
| 488 | |
| 489 | def tree(self, *args): |
| 490 | """ |
| 491 | Tree command. |
| 492 | """ |
| 493 | if not self.connected: |
| 494 | return |
| 495 | |
| 496 | # Get namingContexts from rootDSE |
| 497 | try: |
| 498 | results = self.client.search(attributes=["namingContexts"]) |
| 499 | except LDAP_Exception as ex: |
| 500 | self.tprint( |
| 501 | ex.diagnosticMessage or "Error: %s" % ex.resultCode, |
| 502 | tags=["error"], |
| 503 | ) |
| 504 | return |
| 505 | |
| 506 | attrs = results.get("", None) # root |
| 507 | if attrs is None: |
| 508 | return |
| 509 | |
| 510 | if "namingContexts" in attrs: |
| 511 | self.tk_tree.delete(*self.tk_tree.get_children()) |
| 512 | for root in attrs["namingContexts"]: |
| 513 | self.tk_tree.insert("", "end", root, text=root) |
| 514 | |
| 515 | def _showsearchresult(self, baseObject, results): |
| 516 | """ |