From: tomster <svn...@pl...> - 2006-12-29 22:08:54
|
Author: tomster Date: Fri Dec 29 22:08:43 2006 New Revision: 7305 Added: PortalTransforms/trunk/tests/input/input.textile - copied unchanged from r7303, PortalTransforms/branches/plip149-markup-support-2/tests/input/input.textile PortalTransforms/trunk/tests/input/markdown.txt - copied unchanged from r7303, PortalTransforms/branches/plip149-markup-support-2/tests/input/markdown.txt PortalTransforms/trunk/tests/output/markdown.html - copied unchanged from r7303, PortalTransforms/branches/plip149-markup-support-2/tests/output/markdown.html PortalTransforms/trunk/tests/output/textile.html - copied unchanged from r7303, PortalTransforms/branches/plip149-markup-support-2/tests/output/textile.html PortalTransforms/trunk/transforms/markdown_to_html.py - copied unchanged from r7303, PortalTransforms/branches/plip149-markup-support-2/transforms/markdown_to_html.py PortalTransforms/trunk/transforms/textile_to_html.py - copied unchanged from r7303, PortalTransforms/branches/plip149-markup-support-2/transforms/textile_to_html.py Modified: PortalTransforms/trunk/TransformEngine.py PortalTransforms/trunk/tests/test_transforms.py PortalTransforms/trunk/transforms/__init__.py Log: merging changes from [https://svn.plone.org/svn/archetypes/PortalTransforms/branches/plip149-markup-support-2 plip149-branch] Modified: PortalTransforms/trunk/TransformEngine.py ============================================================================== --- PortalTransforms/trunk/TransformEngine.py (original) +++ PortalTransforms/trunk/TransformEngine.py Fri Dec 29 22:08:43 2006 @@ -499,4 +499,17 @@ log('objectItems: catched MissingBinary exception') return [] + # available mimetypes #################################################### + def listAvailableTextInputs(self): + """ Returns a list of mimetypes that can be used as input for textfields + by building a list of the inputs beginning with "text/" of all transforms. + """ + available_types = [] + candidate_transforms = [object[1] for object in self.objectItems()] + for candidate in candidate_transforms: + for input in candidate.inputs: + if input.startswith("text/") and input not in available_types: + available_types.append(input) + return available_types + InitializeClass(TransformTool) Modified: PortalTransforms/trunk/tests/test_transforms.py ============================================================================== --- PortalTransforms/trunk/tests/test_transforms.py (original) +++ PortalTransforms/trunk/tests/test_transforms.py Fri Dec 29 22:08:43 2006 @@ -179,7 +179,13 @@ ('Products.PortalTransforms.transforms.image_to_pcx', "logo.png", "logo.pcx", None, 0 ), - ) + ('Products.PortalTransforms.transforms.markdown_to_html', + "markdown.txt", "markdown.html", None, 0 + ), + ('Products.PortalTransforms.transforms.textile_to_html', + "input.textile", "textile.html", None, 0 + ), + ) def initialise(transform, normalize, pattern): global TRANSFORMS_TESTINFO Modified: PortalTransforms/trunk/transforms/__init__.py ============================================================================== --- PortalTransforms/trunk/transforms/__init__.py (original) +++ PortalTransforms/trunk/transforms/__init__.py Fri Dec 29 22:08:43 2006 @@ -37,6 +37,8 @@ 'lynx_dump', # lynx -dump 'python', # python source files, no dependancies 'identity', # identity transform, no dependancies + 'markdown_to_html', # markdown, depends on http://surfnet.dl.sourceforge.net/sourceforge/python-markdown/markdown-1-5.py + 'textile_to_html',# textile, depends on PyTextile http://dom.eav.free.fr/python/textile-mirror-2.0.10.tar.gz ] g = globals() |