Back to index

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

List of all members.

Public Member Functions

def __init__
def writeDataFile
def getSite
def getSetupTool
def getEncoding
def getLogger
def listNotes
def clearNotes
def shouldPurge

Static Public Attributes

tuple security = ClassSecurityInfo()

Private Attributes

 _profile_path

Detailed Description

Definition at line 266 of file context.py.


Constructor & Destructor Documentation

def GenericSetup.context.DirectoryExportContext.__init__ (   self,
  tool,
  profile_path,
  encoding = None 
)

Definition at line 272 of file context.py.

00272 
00273     def __init__( self, tool, profile_path, encoding=None ):
00274 
00275         BaseContext.__init__( self, tool, encoding )
00276         self._profile_path = profile_path


Member Function Documentation

def GenericSetup.context.BaseContext.clearNotes (   self) [inherited]
See ISetupContext.

Definition at line 172 of file context.py.

00172 
00173     def clearNotes(self):
00174 
00175         """ See ISetupContext.
00176         """
00177         self._messages[:] = []
00178 

See ISetupContext.

Definition at line 152 of file context.py.

00152 
00153     def getEncoding( self ):
00154 
00155         """ See ISetupContext.
00156         """
00157         return self._encoding

Here is the caller graph for this function:

def GenericSetup.context.BaseContext.getLogger (   self,
  name 
) [inherited]
See ISetupContext.

Reimplemented from GenericSetup.context.SetupEnviron.

Definition at line 159 of file context.py.

00159 
00160     def getLogger( self, name ):
00161         """ See ISetupContext.
00162         """
00163         return self._loggers.setdefault(name, Logger(name, self._messages))

See ISetupContext.

Definition at line 145 of file context.py.

00145 
00146     def getSetupTool( self ):
00147 
00148         """ See ISetupContext.
00149         """
00150         return self._tool

def GenericSetup.context.BaseContext.getSite (   self) [inherited]
See ISetupContext.

Definition at line 138 of file context.py.

00138 
00139     def getSite( self ):
00140 
00141         """ See ISetupContext.
00142         """
00143         return aq_self(self._site)

def GenericSetup.context.BaseContext.listNotes (   self) [inherited]
See ISetupContext.

Definition at line 165 of file context.py.

00165 
00166     def listNotes(self):
00167 
00168         """ See ISetupContext.
00169         """
00170         return self._messages[:]

When installing, should the existing setup be purged?

Reimplemented in GenericSetup.context.SnapshotImportContext, and GenericSetup.context.TarballImportContext.

Definition at line 118 of file context.py.

00118 
00119     def shouldPurge(self):
00120         """When installing, should the existing setup be purged?
00121         """
00122         return self._should_purge
00123 

def GenericSetup.context.DirectoryExportContext.writeDataFile (   self,
  filename,
  text,
  content_type,
  subdir = None 
)
See IExportContext.

Definition at line 278 of file context.py.

00278 
00279     def writeDataFile( self, filename, text, content_type, subdir=None ):
00280 
00281         """ See IExportContext.
00282         """
00283         if subdir is None:
00284             prefix = self._profile_path
00285         else:
00286             prefix = os.path.join( self._profile_path, subdir )
00287 
00288         full_path = os.path.join( prefix, filename )
00289 
00290         if not os.path.exists( prefix ):
00291             os.makedirs( prefix )
00292 
00293         mode = content_type.startswith( 'text/' ) and 'w' or 'wb'
00294 
00295         file = open( full_path, mode )
00296         file.write( text )
00297         file.close()
00298 
00299 InitializeClass( DirectoryExportContext )
00300 


Member Data Documentation

Definition at line 275 of file context.py.

tuple GenericSetup.context.DirectoryExportContext.security = ClassSecurityInfo() [static]

Reimplemented from GenericSetup.context.BaseContext.

Definition at line 270 of file context.py.


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