Back to index

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

List of all members.

Public Member Functions

def __init__

Public Attributes

 context
 environ

Private Member Functions

def _getObjectNode
def _getNodeText
def _convertToBoolean

Private Attributes

 _logger
 _doc
 _i18n_props

Static Private Attributes

string _LOGGER_ID = ''

Detailed Description

Node im- and exporter base.

Definition at line 444 of file utils.py.


Constructor & Destructor Documentation

def GenericSetup.utils.NodeAdapterBase.__init__ (   self,
  context,
  environ 
)

Definition at line 453 of file utils.py.

00453 
00454     def __init__(self, context, environ):
00455         self.context = context
00456         self.environ = environ
00457         self._logger = environ.getLogger(self._LOGGER_ID)
00458         self._doc = PrettyDocument()


Member Function Documentation

def GenericSetup.utils.NodeAdapterBase._convertToBoolean (   self,
  val 
) [private]

Definition at line 478 of file utils.py.

00478 
00479     def _convertToBoolean(self, val):
00480         return val.lower() in ('true', 'yes', '1')
00481 

Here is the caller graph for this function:

def GenericSetup.utils.NodeAdapterBase._getNodeText (   self,
  node 
) [private]

Definition at line 469 of file utils.py.

00469 
00470     def _getNodeText(self, node):
00471         text = ''
00472         for child in node.childNodes:
00473             if child.nodeName != '#text':
00474                 continue
00475             lines = [ line.lstrip() for line in child.nodeValue.splitlines() ]
00476             text += '\n'.join(lines)
00477         return text

Here is the caller graph for this function:

def GenericSetup.utils.NodeAdapterBase._getObjectNode (   self,
  name,
  i18n = True 
) [private]

Definition at line 459 of file utils.py.

00459 
00460     def _getObjectNode(self, name, i18n=True):
00461         node = self._doc.createElement(name)
00462         node.setAttribute('name', self.context.getId())
00463         node.setAttribute('meta_type', self.context.meta_type)
00464         i18n_domain = getattr(self.context, 'i18n_domain', None)
00465         if i18n and i18n_domain:
00466             node.setAttributeNS(I18NURI, 'i18n:domain', i18n_domain)
00467             self._i18n_props = ('title', 'description')
00468         return node

Here is the caller graph for this function:


Member Data Documentation

Definition at line 457 of file utils.py.

Definition at line 466 of file utils.py.

Definition at line 456 of file utils.py.

string GenericSetup.utils.NodeAdapterBase._LOGGER_ID = '' [static, private]

Definition at line 451 of file utils.py.

Definition at line 454 of file utils.py.

Definition at line 455 of file utils.py.


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