phoenix_title wx.lib.pubsub.utils.topictreeprinter.TopicTreePrinter

Example topic tree visitor that prints a prettified representation of topic tree by doing a depth-first traversal of topic tree and print information at each (topic) node of tree. Extra info to be printed is specified via the ‘extra’ kwarg. Its value must be a list of characters, the order determines output order: - D: print description of topic - a: print kwarg names only - A: print topic kwargs and their description - L: print listeners currently subscribed to topic

E.g. TopicTreePrinter(extra=’LaDA’) would print, for each topic, the list of subscribed listeners, the topic’s list of kwargs, the topic description, and the description for each kwarg,

>>> Topic "delTopic"
   >> Listeners:
      > listener1_2880 (from yourModule)
      > listener2_3450 (from yourModule)
   >> Names of Message arguments:
      > arg1
      > arg2
   >> Description: whenever a topic is deleted
   >> Descriptions of Message arguments:
      > arg1: (required) its description
      > arg2: some other description

class_hierarchy Class Hierarchy

Inheritance diagram for class TopicTreePrinter:

method_summary Methods Summary

__init__

Topic tree printer will print listeners for each topic only

getOutput


api Class API

class TopicTreePrinter(ITopicTreeVisitor)

Example topic tree visitor that prints a prettified representation of topic tree by doing a depth-first traversal of topic tree and print information at each (topic) node of tree. Extra info to be printed is specified via the ‘extra’ kwarg. Its value must be a list of characters, the order determines output order: - D: print description of topic - a: print kwarg names only - A: print topic kwargs and their description - L: print listeners currently subscribed to topic

E.g. TopicTreePrinter(extra=’LaDA’) would print, for each topic, the list of subscribed listeners, the topic’s list of kwargs, the topic description, and the description for each kwarg,

>>> Topic "delTopic"
   >> Listeners:
      > listener1_2880 (from yourModule)
      > listener2_3450 (from yourModule)
   >> Names of Message arguments:
      > arg1
      > arg2
   >> Description: whenever a topic is deleted
   >> Descriptions of Message arguments:
      > arg1: (required) its description
      > arg2: some other description

Methods

__init__(self, extra=None, width=70, indentStep=4, bulletTopic='\--', bulletTopicItem='|==', bulletTopicArg='-', fileObj=None)

Topic tree printer will print listeners for each topic only if printListeners is True. The width will be used to limit the width of text output, while indentStep is the number of spaces added each time the text is indented further. The three bullet parameters define the strings used for each item (topic, topic items, and kwargs).



getOutput(self)