Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes
GenericSetup.registry.ToolsetRegistry Class Reference
Inheritance diagram for GenericSetup.registry.ToolsetRegistry:
Inheritance graph
[legend]
Collaboration diagram for GenericSetup.registry.ToolsetRegistry:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def listForbiddenTools
def addForbiddenTool
def listRequiredTools
def getRequiredToolInfo
def listRequiredToolInfo
def addRequiredTool
def generateXML
def parseXML
def clear

Static Public Attributes

tuple security = ClassSecurityInfo()

Private Attributes

 _forbidden
 _required

Static Private Attributes

tuple _toolsetConfig

Detailed Description

Track required / forbidden tools.

Definition at line 533 of file registry.py.


Constructor & Destructor Documentation

Definition at line 542 of file registry.py.

00542 
00543     def __init__( self ):
00544 
00545         self.clear()

Here is the call graph for this function:


Member Function Documentation

See IToolsetRegistry.

Definition at line 559 of file registry.py.

00559 
00560     def addForbiddenTool( self, tool_id ):
00561 
00562         """ See IToolsetRegistry.
00563         """
00564         if tool_id in self._forbidden:
00565             return
00566 
00567         if self._required.get( tool_id ) is not None:
00568             raise ValueError, 'Tool %s is required!' % tool_id
00569 
00570         self._forbidden.append( tool_id )

Here is the caller graph for this function:

def GenericSetup.registry.ToolsetRegistry.addRequiredTool (   self,
  tool_id,
  dotted_name 
)
See IToolsetRegistry.

Definition at line 596 of file registry.py.

00596 
00597     def addRequiredTool( self, tool_id, dotted_name ):
00598 
00599         """ See IToolsetRegistry.
00600         """
00601         if tool_id in self._forbidden:
00602             raise ValueError, "Forbidden tool ID: %s" % tool_id
00603 
00604         self._required[ tool_id ] = { 'id' : tool_id
00605                                     , 'class' : dotted_name
00606                                     }

Here is the caller graph for this function:

Definition at line 634 of file registry.py.

00634 
00635     def clear( self ):
00636 
00637         self._forbidden = []
00638         self._required = {}

Here is the caller graph for this function:

Pseudo API.

Definition at line 608 of file registry.py.

00608 
00609     def generateXML( self ):
00610 
00611         """ Pseudo API.
00612         """
00613         return self._toolsetConfig()

See IToolsetRegistry.

Definition at line 581 of file registry.py.

00581 
00582     def getRequiredToolInfo( self, tool_id ):
00583 
00584         """ See IToolsetRegistry.
00585         """
00586         return self._required[ tool_id ]

Here is the caller graph for this function:

See IToolsetRegistry.

Definition at line 550 of file registry.py.

00550 
00551     def listForbiddenTools( self ):
00552 
00553         """ See IToolsetRegistry.
00554         """
00555         result = list( self._forbidden )
00556         result.sort()
00557         return result

See IToolsetRegistry.

Definition at line 588 of file registry.py.

00588 
00589     def listRequiredToolInfo( self ):
00590 
00591         """ See IToolsetRegistry.
00592         """
00593         return [ self.getRequiredToolInfo( x )
00594                         for x in self.listRequiredTools() ]

Here is the call graph for this function:

See IToolsetRegistry.

Definition at line 572 of file registry.py.

00572 
00573     def listRequiredTools( self ):
00574 
00575         """ See IToolsetRegistry.
00576         """
00577         result = list( self._required.keys() )
00578         result.sort()
00579         return result

Here is the caller graph for this function:

def GenericSetup.registry.ToolsetRegistry.parseXML (   self,
  text,
  encoding = None 
)
Pseudo-API

Definition at line 615 of file registry.py.

00615 
00616     def parseXML( self, text, encoding=None ):
00617 
00618         """ Pseudo-API
00619         """
00620         reader = getattr( text, 'read', None )
00621 
00622         if reader is not None:
00623             text = reader()
00624 
00625         parser = _ToolsetParser( encoding )
00626         parseString( text, parser )
00627 
00628         for tool_id in parser._forbidden:
00629             self.addForbiddenTool( tool_id )
00630 
00631         for tool_id, dotted_name in parser._required.items():
00632             self.addRequiredTool( tool_id, dotted_name )

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 636 of file registry.py.

Definition at line 637 of file registry.py.

Initial value:
PageTemplateFile( 'tscExport.xml'
                                     , _xmldir
                                     , __name__='toolsetConfig'
                                     )

Definition at line 643 of file registry.py.

tuple GenericSetup.registry.ToolsetRegistry.security = ClassSecurityInfo() [static]

Definition at line 539 of file registry.py.


The documentation for this class was generated from the following file: