Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
GenericSetup.content.SimpleINIAware Class Reference

List of all members.

Public Member Functions

def __init__
def getId
def as_ini
def put_ini

Public Attributes

 context

Detailed Description

Exporter/importer for content which doesn't know from INI.

Definition at line 315 of file content.py.


Constructor & Destructor Documentation

def GenericSetup.content.SimpleINIAware.__init__ (   self,
  context 
)

Definition at line 320 of file content.py.

00320 
00321     def __init__(self, context):
00322         self.context = context


Member Function Documentation

Definition at line 326 of file content.py.

00326 
00327     def as_ini(self):
00328         """
00329         """
00330         context = self.context
00331         parser = ConfigParser()
00332         stream = StringIO()
00333         for k, v in context.propertyItems():
00334             parser.set('DEFAULT', k, str(v))
00335         parser.write(stream)
00336         return stream.getvalue()

Definition at line 323 of file content.py.

00323 
00324     def getId(self):
00325         return self.context.getId()

def GenericSetup.content.SimpleINIAware.put_ini (   self,
  text 
)

Definition at line 337 of file content.py.

00337 
00338     def put_ini(self, text):
00339         """
00340         """
00341         context = self.context
00342         parser = ConfigParser()
00343         parser.readfp(StringIO(text))
00344         for option, value in parser.defaults().items():
00345             prop_type = context.getPropertyType(option)
00346             if prop_type is None:
00347                 context._setProperty(option, value, 'string')
00348             else:
00349                 context._updateProperty(option, value)


Member Data Documentation

Definition at line 321 of file content.py.


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