Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
CMFCore.ContentTypeRegistry.ExtensionPredicate Class Reference
Inheritance diagram for CMFCore.ContentTypeRegistry.ExtensionPredicate:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.ContentTypeRegistry.ExtensionPredicate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def getExtensions
def edit
def __call__
def getTypeLabel

Public Attributes

 id

Static Public Attributes

 extensions = None
string PREDICATE_TYPE = 'extension'
tuple security = ClassSecurityInfo()
tuple predicateWidget = DTMLFile( 'extensionWidget', _dtmldir )

Static Private Attributes

 __implements__ = z2IContentTypeRegistryPredicate

Detailed Description

    Predicate matching on filename extensions.

Definition at line 129 of file ContentTypeRegistry.py.


Constructor & Destructor Documentation

Definition at line 143 of file ContentTypeRegistry.py.

00143 
00144     def __init__( self, id ):
00145         self.id = id


Member Function Documentation

def CMFCore.ContentTypeRegistry.ExtensionPredicate.__call__ (   self,
  name,
  typ,
  body 
)
    Return true if the rule matches, else false.

Definition at line 168 of file ContentTypeRegistry.py.

00168 
00169     def __call__( self, name, typ, body ):
00170         """
00171             Return true if the rule matches, else false.
00172         """
00173         if self.extensions is None:
00174             return 0
00175 
00176         base, ext = os.path.splitext( name )
00177         if ext and ext[ 0 ] == '.':
00178             ext = ext[ 1: ]
00179 
00180         return ext in self.extensions

Here is the caller graph for this function:

def CMFCore.ContentTypeRegistry.ExtensionPredicate.edit (   self,
  extensions,
  COMMA_SPLIT = re.compile( r'[, ]' 
)

Definition at line 155 of file ContentTypeRegistry.py.

00155 
00156     def edit( self, extensions, COMMA_SPLIT=re.compile( r'[, ]' ) ):
00157 
00158         if extensions == 'None':
00159             extensions = None
00160         if type( extensions ) is type( '' ):
00161             extensions = filter( None, COMMA_SPLIT.split( extensions ) )
00162 
00163         self.extensions = extensions

Here is the caller graph for this function:

Get filename extensions.

Definition at line 147 of file ContentTypeRegistry.py.

00147 
00148     def getExtensions(self):
00149         """ Get filename extensions.
00150         """
00151         if self.extensions is None:
00152             return 'None'
00153         return ' '.join(self.extensions)

    Return a human-readable label for the predicate type.

Definition at line 182 of file ContentTypeRegistry.py.

00182 
00183     def getTypeLabel( self ):
00184         """
00185             Return a human-readable label for the predicate type.
00186         """
00187         return self.PREDICATE_TYPE


Member Data Documentation

CMFCore.ContentTypeRegistry.ExtensionPredicate.__implements__ = z2IContentTypeRegistryPredicate [static, private]

Definition at line 136 of file ContentTypeRegistry.py.

Definition at line 138 of file ContentTypeRegistry.py.

Definition at line 144 of file ContentTypeRegistry.py.

Definition at line 139 of file ContentTypeRegistry.py.

tuple CMFCore.ContentTypeRegistry.ExtensionPredicate.predicateWidget = DTMLFile( 'extensionWidget', _dtmldir ) [static]

Definition at line 189 of file ContentTypeRegistry.py.

tuple CMFCore.ContentTypeRegistry.ExtensionPredicate.security = ClassSecurityInfo() [static]

Definition at line 141 of file ContentTypeRegistry.py.


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