Back to index

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

List of all members.

Public Member Functions

def __init__
def __call__

Private Member Functions

def _getImportMapping

Private Attributes

 _path
 _encoding

Detailed Description

Extracts profile metadata from metadata.xml file.

Definition at line 24 of file metadata.py.


Constructor & Destructor Documentation

def GenericSetup.metadata.ProfileMetadata.__init__ (   self,
  path,
  encoding = None,
  product = None 
)

Definition at line 28 of file metadata.py.

00028 
00029     def __init__( self, path, encoding=None, product=None ):
00030 
00031         # don't call the base class __init__ b/c we don't have (or need)
00032         # a site
00033 
00034         self._path = path
00035         if product is not None:
00036             # Handle relative paths
00037             try:
00038                 product_path = _getProductPath(product)
00039             except ValueError:
00040                 pass
00041             else:
00042                 self._path = os.path.join(product_path, path)
00043 
00044         self._encoding = encoding


Member Function Documentation

Definition at line 45 of file metadata.py.

00045 
00046     def __call__( self ):
00047         
00048         full_path = os.path.join( self._path, METADATA_XML )
00049         if not os.path.exists( full_path ):
00050             return {}
00051 
00052         file = open( full_path, 'r' )
00053         return self.parseXML( file.read() )

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 54 of file metadata.py.

00054 
00055     def _getImportMapping( self ):
00056 
00057         return {
00058             'metadata':
00059             {'description': { CONVERTER: self._convertToUnique },
00060              'version': { CONVERTER: self._convertToUnique },
00061              'dependencies': { CONVERTER: self._convertToUnique },
00062              },
00063             'description':
00064             { '#text': { KEY: None, DEFAULT: '' },
00065               },
00066             'version':
00067             { '#text': { KEY: None },
00068               },
00069             'dependencies':
00070             {'dependency': { KEY: None },},
00071             'dependency':
00072             { '#text': { KEY: None },
00073               },
00074             }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 43 of file metadata.py.

Definition at line 33 of file metadata.py.


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