Logo Search packages:      
Sourcecode: zope-attachmentfield version File versions  Download package

def AttachmentField::AttachmentService::AttachmentService::listHandlerValues (   self  ) 

listHandlerValues(self,) => List of attachment handlers

Definition at line 101 of file AttachmentService.py.

00101                                 :
        """
        listHandlerValues(self,) => List of attachment handlers
        """
        import AttachmentHandler

        handlers = AttachmentHandler.__HANDLERS__
        properties = (
            "preview_program",
            "index_program",
            )
        accessors = (
            ("converter_type", "getContentType", ),
            ("icon_file", "getIconFile", ),
            ("small_icon_file", "getSmallIconFile", ),
            ("content_types", "getContentTypes", ),
            ("index_path", "getIndexPath", ),
            ("index_arguments", "getIndexArguments", ),
            ("index_program_gui", "getGUIIndexProgramCommand", ),
            ("index_encoding", "getIndexEncoding", ),
            ("preview_path", "getPreviewPath", ),
            ("preview_arguments", "getPreviewArguments", ),
            ("preview_encoding", "getPreviewEncoding", ),
            ("preview_format", "getPreviewFormat", ),
            ("preview_program_gui", "getGUIPreviewProgramCommand", ),
            ("error", "getError", ),
            )

        ret = {}

        for name, handler in handlers:
            mimes = handler.getContentTypes(None, self)
            if None in mimes:
                mimes = ("(default)",)
            h = {
                "mime": mimes,
                "class": name,
                }
            for pty in properties:
                h[pty] = getattr(handler, pty, None)
            for pty, accessor in accessors:
                call = getattr(handler, accessor, None)
                if call:
                    h[pty] = call(None, self)
                else:
                    h[pty] = None
            ret[name] = h

        values = ret.values()
        values.sort(lambda x, y: cmp(x["class"], y["class"]))
        return values


    security.declareProtected(view_management_screens, "listAvailableEncodings")
    def listAvailableEncodings(self,):


Generated by  Doxygen 1.6.0   Back to index