Back to index

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

List of all members.

Public Member Functions

def __init__
def readDataFile
def getLastModified
def isDirectory
def listDirectory
def getSite
def getSetupTool
def getEncoding
def getLogger
def listNotes
def clearNotes
def shouldPurge

Static Public Attributes

tuple security = ClassSecurityInfo()

Private Attributes

 _profile_path
 _should_purge

Detailed Description

Definition at line 179 of file context.py.


Constructor & Destructor Documentation

def GenericSetup.context.DirectoryImportContext.__init__ (   self,
  tool,
  profile_path,
  should_purge = False,
  encoding = None 
)

Definition at line 190 of file context.py.

00190 
00191                 ):
00192 
00193         BaseContext.__init__( self, tool, encoding )
00194         self._profile_path = profile_path
00195         self._should_purge = bool( should_purge )


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:

See IImportContext.

Definition at line 216 of file context.py.

00216 
00217     def getLastModified( self, path ):
00218 
00219         """ See IImportContext.
00220         """
00221         full_path = os.path.join( self._profile_path, path )
00222 
00223         if not os.path.exists( full_path ):
00224             return None
00225 
00226         return DateTime( os.path.getmtime( full_path ) )

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)

See IImportContext.

Definition at line 228 of file context.py.

00228 
00229     def isDirectory( self, path ):
00230 
00231         """ See IImportContext.
00232         """
00233         full_path = os.path.join( self._profile_path, path )
00234 
00235         if not os.path.exists( full_path ):
00236             return None
00237 
00238         return os.path.isdir( full_path )

Here is the call graph for this function:

Here is the caller graph for this function:

def GenericSetup.context.DirectoryImportContext.listDirectory (   self,
  path,
  skip = SKIPPED_FILES,
  skip_suffixes = SKIPPED_SUFFIXES 
)
See IImportContext.

Definition at line 241 of file context.py.

00241 
00242                       skip_suffixes=SKIPPED_SUFFIXES):
00243 
00244         """ See IImportContext.
00245         """
00246         if path is None:
00247             path = ''
00248 
00249         full_path = os.path.join( self._profile_path, path )
00250 
00251         if not os.path.exists( full_path ) or not os.path.isdir( full_path ):
00252             return None
00253 
00254         names = []
00255         for name in os.listdir(full_path):
00256             if name in skip:
00257                 continue
00258             if [s for s in skip_suffixes if name.endswith(s)]:
00259                 continue
00260             names.append(name)
00261 
00262         return names
00263 
00264 InitializeClass( DirectoryImportContext )
00265 

Here is the caller graph for this function:

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[:]

def GenericSetup.context.DirectoryImportContext.readDataFile (   self,
  filename,
  subdir = None 
)
See IImportContext.

Definition at line 197 of file context.py.

00197 
00198     def readDataFile( self, filename, subdir=None ):
00199 
00200         """ See IImportContext.
00201         """
00202         if subdir is None:
00203             full_path = os.path.join( self._profile_path, filename )
00204         else:
00205             full_path = os.path.join( self._profile_path, subdir, filename )
00206 
00207         if not os.path.exists( full_path ):
00208             return None
00209 
00210         file = open( full_path, 'rb' )
00211         result = file.read()
00212         file.close()
00213 
00214         return result

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 


Member Data Documentation

Definition at line 193 of file context.py.

Reimplemented from GenericSetup.context.BaseContext.

Definition at line 194 of file context.py.

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

Reimplemented from GenericSetup.context.BaseContext.

Definition at line 183 of file context.py.


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