Back to index

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

List of all members.

Public Member Functions

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

Static Public Attributes

tuple security = ClassSecurityInfo()

Private Attributes

 _archive_stream
 _archive_filename
 _archive

Detailed Description

Definition at line 394 of file context.py.


Constructor & Destructor Documentation

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

Reimplemented from GenericSetup.context.BaseContext.

Definition at line 400 of file context.py.

00400 
00401     def __init__( self, tool, encoding=None ):
00402 
00403         BaseContext.__init__( self, tool, encoding )
00404 
00405         timestamp = time.gmtime()
00406         archive_name = ( 'setup_tool-%4d%02d%02d%02d%02d%02d.tar.gz'
00407                        % timestamp[:6] )
00408 
00409         self._archive_stream = StringIO()
00410         self._archive_filename = archive_name
00411         self._archive = TarFile.open( archive_name, 'w:gz'
00412                                     , self._archive_stream )


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 

Close the archive, and return it as a big string.

Definition at line 428 of file context.py.

00428 
00429     def getArchive( self ):
00430 
00431         """ Close the archive, and return it as a big string.
00432         """
00433         self._archive.close()
00434         return self._archive_stream.getvalue()

Close the archive, and return it as a big string.

Definition at line 436 of file context.py.

00436 
00437     def getArchiveFilename( self ):
00438 
00439         """ Close the archive, and return it as a big string.
00440         """
00441         return self._archive_filename
00442 
00443 InitializeClass( TarballExportContext )
00444 

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.TarballExportContext.writeDataFile (   self,
  filename,
  text,
  content_type,
  subdir = None 
)
See IExportContext.

Definition at line 414 of file context.py.

00414 
00415     def writeDataFile( self, filename, text, content_type, subdir=None ):
00416 
00417         """ See IExportContext.
00418         """
00419         if subdir is not None:
00420             filename = '/'.join( ( subdir, filename ) )
00421 
00422         stream = StringIO( text )
00423         info = TarInfo( filename )
00424         info.size = len( text )
00425         info.mtime = time.time()
00426         self._archive.addfile( info, stream )


Member Data Documentation

Definition at line 410 of file context.py.

Definition at line 409 of file context.py.

Definition at line 408 of file context.py.

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

Reimplemented from GenericSetup.context.BaseContext.

Definition at line 398 of file context.py.


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