Module Expr Str Import alias Import alias ImportFrom alias alias ImportFrom alias Import alias ImportFrom alias alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore SubscriptLoad BinOpAdd ListComp NameLoad comprehension NameStore NameLoad CompareIs Call NameLoad NameLoad NameLoad ListLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call NameLoad NameLoad Str NameLoad If CompareIsNot NameLoad NameLoad body Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore ListLoad Assign NameStore ListLoad For NameStore NameLoad body If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad SubscriptLoad TupleLoad NameLoad NameLoad Index Call NameLoad NameLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return TupleLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Dict Return Assign NameStore Call NameLoad For NameStore AttributeLoad NameLoad attr body If CompareIsNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str If CompareEq Call NameLoad NameLoad Num body Return SubscriptLoad NameLoad Index Num Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body If UnaryOpNot Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Call NameLoad NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Call NameLoad NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore AttributeLoad NameLoad attr For NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Break orelse Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body TryExcept body If BoolOpAnd SubscriptLoad NameLoad Index Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Num body If Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Num body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index SubscriptLoad SubscriptLoad NameLoad Index Str Index Num orelse Expr Call AttributeLoad NameLoad attr Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Num Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass If BoolOpOr CompareIs NameLoad NameLoad CompareEq NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore ListLoad Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad keyword Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str TryExcept body For NameStore SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type NameLoad body Pass Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Num Call NameLoad BinOpSub AttributeLoad NameLoad attr Num BinOpMod Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Return TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If CompareIn AttributeLoad NameLoad attr TupleLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr body Return Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore BinOpAdd BinOpAdd NameLoad NameLoad NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr NameLoad NameLoad handlers ExceptHandler type NameLoad body Pass Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list decorator_list
N/A N/A 
This module provides one useful class:  NodeHandler

The NodeHandler class is designed to be subclassed.  Each subclass
should support the processing that createpdf.RstToPdf needs to do
on a particular type of node that could appear in a document tree.

When the subclass is defined, it should reference NodeHandler as
the first base class, and one or more docutils node classes as
subsequent base classes.

These docutils node classes will not actually wind up in the
base classes of the subclass.  Instead, they will be used as
keys in a dispatch dictionary which is used to find the correct
NodeHandler subclass to use to process an instance of a given
docutils node class.

When an instance of createpdf.RstToPdf is created, a NodeHandler
instance will be called to return dispatchers for gather_elements
and gather_pdftext, wrapped up as methods of the createpdf.RstToPdf
class.

When a dispatcher is called, it will dispatch to the correct subclass
to handle the given docutils node instance.

If no NodeHandler subclass has been created to handle that particular
type of docutils node, then default processing will occur and a warning
will be logged.
 N/A types N/A inspect log log nodeid smartypants smartyPants N/A docutils.nodes flowables BoundByWidth TocEntry MetaHelper N/A type N/A N/A  MetaHelper is designed to generically enable a few of the benefits of
        using metaclasses by encapsulating some of the complexity of setting
        them up.

        If a base class uses MetaHelper (by assigning __metaclass__ = MetaHelper),
        then that class (and its metaclass inheriting subclasses) can control
        class creation behavior by defining a couple of helper functions.

        1) A base class can define a _classpreinit function.  This function
           is called during __new__ processing of the class object itself,
           but only during subclass creation (not when the class defining
           the _classpreinit is itself created).

           The subclass object does not yet exist at the time _classpreinit
           is called.  _classpreinit accepts all the parameters of the
           __new__ function for the class itself (not the same as the __new__
           function for the instantiation of class objects!) and must return
           a tuple of the same objects.  A typical use of this would be to
           modify the class bases before class creation.

        2) Either a base class or a subclass can define a _classinit() function.
           This function will be called immediately after the actual class has
           been created, and can do whatever setup is required for the class.
           Note that every base class (but not every subclass) which uses
           MetaHelper MUST define _classinit, even if that definition is None.

         MetaHelper also places an attribute into each class created with it.
         _baseclass is set to None if this class has no superclasses which
         also use MetaHelper, or to the first such MetaHelper-using baseclass.
         _baseclass can be explicitly set inside the class definition, in
         which case MetaHelper will not override it.
     __new__ N/A N/A clstype name bases clsdict N/A N/A N/A base N/A N/A N/A x N/A x bases N/A N/A type x MetaHelper N/A None N/A 0 N/A N/A N/A clsdict setdefault _baseclass base N/A preinit N/A getattr base _classpreinit None N/A N/A preinit None N/A N/A N/A clstype name bases clsdict N/A preinit clstype name bases clsdict N/A N/A N/A type __new__ clstype name bases clsdict N/A __init__ N/A N/A cls name bases clsdict N/A N/A N/A N/A N/A type __init__ cls name bases clsdict N/A N/A N/A cls _classinit None N/A N/A N/A N/A cls _classinit N/A N/A NodeHandler N/A object N/A N/A  NodeHandler classes are used to dispatch
       to the correct class to handle some node class
       type, via a dispatchdict in the main class.
     N/A __metaclass__ MetaHelper _classpreinit N/A N/A baseclass clstype name bases clsdict N/A N/A N/A new_bases N/A N/A targets N/A N/A target bases N/A N/A N/A target object N/A N/A N/A N/A N/A N/A targets new_bases N/A N/A issubclass target NodeHandler append target N/A N/A clsdict N/A _targets targets N/A N/A clstype name N/A tuple new_bases clsdict N/A classmethod _classinit N/A N/A cls N/A N/A N/A N/A N/A cls _baseclass None N/A N/A N/A cls dispatchdict N/A N/A N/A self N/A cls N/A target N/A cls _targets N/A N/A N/A N/A N/A N/A cls dispatchdict setdefault target self self N/A N/A t N/A repr target N/A old N/A repr N/A N/A cls dispatchdict N/A target N/A new N/A repr self N/A N/A N/A log debug N/A Dispatch handler %s for node type %s overridden by %s N/A old t new N/A N/A N/A cls dispatchdict N/A target self N/A classmethod getclassname N/A N/A obj N/A N/A N/A cln N/A repr N/A obj __class__ N/A info N/A N/A cln split ' N/A N/A N/A len info 3 N/A N/A N/A info N/A 1 N/A cln N/A staticmethod log_unknown N/A N/A self node during N/A N/A N/A N/A N/A hasattr self unkn_node N/A N/A N/A self unkn_node N/A set N/A cln N/A N/A self getclassname node N/A N/A N/A cln N/A self unkn_node N/A N/A N/A N/A N/A self unkn_node add cln N/A N/A N/A log warning Unkn. node (self.%s): %s [%s] during cln N/A nodeid node N/A N/A N/A N/A N/A log debug node N/A N/A N/A N/A UnicodeDecodeError UnicodeEncodeError N/A N/A N/A N/A log debug N/A repr node N/A findsubclass N/A N/A self node during N/A N/A N/A handlerinfo N/A %s.%s N/A N/A N/A self getclassname self during N/A N/A N/A log debug %s: %s handlerinfo N/A N/A self getclassname node N/A N/A N/A log debug %s: [%s] handlerinfo N/A nodeid node N/A N/A N/A N/A N/A log debug %s: %s handlerinfo node N/A N/A N/A N/A UnicodeDecodeError UnicodeEncodeError N/A N/A N/A N/A log debug %s: %r handlerninfo node N/A N/A N/A log debug N/A dispatchdict N/A self dispatchdict N/A baseclass N/A N/A inspect getmro N/A node __class__ N/A N/A result N/A N/A dispatchdict get baseclass N/A N/A result None N/A N/A N/A N/A N/A N/A self log_unknown node during N/A result self N/A result N/A __call__ N/A N/A self client N/A N/A N/A  Get the dispatchers, wrapped up as methods for the client N/A textdispatch N/A N/A types MethodType N/A self textdispatch client N/A elemdispatch N/A N/A types MethodType N/A self elemdispatch client N/A N/A textdispatch elemdispatch N/A N/A sphinxmode False gather_elements N/A N/A self client node style N/A N/A N/A N/A N/A client gather_elements node style style N/A getstyle N/A N/A self client node style N/A N/A N/A N/A N/A N/A N/A node N/A classes N/A N/A node N/A classes N/A 0 N/A N/A N/A N/A N/A N/A client styles StyleSheet has_key N/A N/A node N/A classes N/A 0 N/A N/A style N/A N/A client styles N/A N/A N/A node N/A classes N/A 0 N/A N/A N/A N/A log info Unknown class %s, ignoring. [%s] N/A N/A node N/A classes N/A 0 N/A nodeid node N/A N/A N/A TypeError N/A N/A N/A N/A N/A style None N/A style N/A N/A client styles N/A bodytext N/A N/A style N/A N/A N/A client styles styleForNode node N/A style N/A getelements N/A N/A self client node style N/A N/A N/A style N/A N/A self getstyle client node style N/A elements N/A N/A self gather_elements client node style N/A N/A width N/A style __dict__ N/A N/A elements N/A N/A BoundByWidth N/A style width elements style mode shrink N/A elements N/A elemdispatch N/A N/A self client node style N/A None N/A N/A self N/A N/A self findsubclass node elemdispatch N/A N/A N/A i N/A node N/A ids N/A N/A N/A N/A N/A client pending_targets append i N/A N/A N/A TypeError N/A N/A N/A elements N/A N/A self getelements client node style N/A N/A N/A node line N/A client debugLinesPdf N/A N/A N/A N/A elements insert 0 N/A TocEntry N/A N/A client depth 1 N/A LINE-%s N/A node line N/A N/A node elements elements N/A elements N/A N/A pre N/A post get_pre_post N/A N/A self client node replaceEnt N/A N/A N/A N/A N/A self pre N/A self post N/A get_text N/A N/A self client node replaceEnt N/A N/A N/A N/A N/A client gather_pdftext node N/A apply_smartypants N/A N/A self text smarty node N/A N/A N/A N/A N/A node __class__ N/A N/A N/A docutils nodes paragraph N/A N/A docutils nodes block_quote N/A N/A docutils nodes title N/A N/A N/A smartyPants text smarty N/A text N/A textdispatch N/A N/A self client node replaceEnt N/A True N/A N/A self N/A N/A self findsubclass node textdispatch N/A N/A pre post N/A N/A self get_pre_post client node replaceEnt N/A text N/A N/A self get_text client node replaceEnt N/A text N/A N/A pre text post N/A N/A N/A N/A N/A log debug N/A %s.textdispatch: %s N/A N/A N/A self getclassname self text N/A N/A N/A UnicodeDecodeError N/A N/A N/A text N/A N/A self apply_smartypants text N/A client smarty node N/A N/A node pdftext text N/A text N/A N/A