Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.contentrules.conditions.fileextension.FileExtensionConditionExecutor Class Reference

List of all members.

Public Member Functions

def __init__
def __call__

Public Attributes

 context
 element
 event

Detailed Description

The executor for this condition.

This is registered as an adapter in configure.zcml

Definition at line 39 of file fileextension.py.


Constructor & Destructor Documentation

Definition at line 47 of file fileextension.py.

00047 
00048     def __init__(self, context, element, event):
00049         self.context = context
00050         self.element = element
00051         self.event = event

Here is the caller graph for this function:


Member Function Documentation

Definition at line 52 of file fileextension.py.

00052 
00053     def __call__(self):
00054         obj = self.event.object
00055         if not IFileContent.providedBy(obj):
00056             return False
00057         
00058         base_unit = obj.getFile()
00059         get_filename = getattr(base_unit, 'getFilename', None)
00060         if not get_filename:
00061             return False
00062         
00063         name = get_filename()
00064         extension = name[name.rfind('.')+1:]
00065         return extension == self.element.file_extension
        

Here is the caller graph for this function:


Member Data Documentation

Definition at line 48 of file fileextension.py.

Definition at line 49 of file fileextension.py.

Definition at line 50 of file fileextension.py.


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