Permalink
Browse files

Reverted changes from Wouter that broke tests.

git-svn-id: http://svn.plone.org/svn/collective/Products.OpenXml/trunk@115055 db7f04ef-aaf3-0310-a811-c281ed44c4ad
  • Loading branch information...
1 parent 1d2b04f commit 5279982d9a275b85f662f3c379f83a46e4debbb1 @glenfant glenfant committed Apr 11, 2010
View
68 Products/OpenXml/config.py
@@ -16,72 +16,72 @@
# * http://technet2.microsoft.com/Office/en-us/library/e077da98-0216-45eb-b6a7-957f9c510a851033.mspx
office_mimetypes = (
{'name': 'Office Word 2007 XML macro enabled document',
- 'mimetypes': (ct.CT_WORDPROC_DOCM_PUBLIC, ),
- 'extensions': ('docm', )
+ 'mimetypes': (ct.CT_WORDPROC_DOCM_PUBLIC,),
+ 'extensions': ('docm',)
},
{'name': 'Office Word 2007 XML document',
- 'mimetypes': (ct.CT_WORDPROC_DOCX_PUBLIC, ),
- 'extensions': ('docx', )
+ 'mimetypes': (ct.CT_WORDPROC_DOCX_PUBLIC,),
+ 'extensions': ('docx',)
},
{'name': 'Office Word 2007 XML macro-enabled template',
- 'mimetypes': (ct.CT_WORDPROC_DOTM_PUBLIC, ),
- 'extensions': ('dotm', )
+ 'mimetypes': (ct.CT_WORDPROC_DOTM_PUBLIC,),
+ 'extensions': ('dotm',)
},
{'name': 'Office Word 2007 XML template',
- 'mimetypes': (ct.CT_WORDPROC_DOTX_PUBLIC, ),
- 'extensions': ('dotx', )
+ 'mimetypes': (ct.CT_WORDPROC_DOTX_PUBLIC,),
+ 'extensions': ('dotx',)
},
{'name': 'Office Powerpoint 2007 macro-enabled XML template',
- 'mimetypes': (ct.CT_PRESENTATION_POTM_PUBLIC, ),
- 'extensions': ('potm', )
+ 'mimetypes': (ct.CT_PRESENTATION_POTM_PUBLIC,),
+ 'extensions': ('potm',)
},
{'name': 'Office Powerpoint 2007 XML template',
- 'mimetypes': (ct.CT_PRESENTATION_POTX_PUBLIC, ),
- 'extensions': ('potx', )
+ 'mimetypes': (ct.CT_PRESENTATION_POTX_PUBLIC,),
+ 'extensions': ('potx',)
},
{'name': 'Office Powerpoint 2007 macro-enabled XML add-in',
- 'mimetypes': (ct.CT_PRESENTATION_PPAM_PUBLIC, ),
- 'extensions': ('ppam', )
+ 'mimetypes': (ct.CT_PRESENTATION_PPAM_PUBLIC,),
+ 'extensions': ('ppam',)
},
{'name': 'Office Powerpoint 2007 macro-enabled XML show',
- 'mimetypes': (ct.CT_PRESENTATION_PPSM_PUBLIC, ),
- 'extensions': ('ppsm', )
+ 'mimetypes': (ct.CT_PRESENTATION_PPSM_PUBLIC,),
+ 'extensions': ('ppsm',)
},
{'name': 'Office Powerpoint 2007 XML show',
- 'mimetypes': (ct.CT_PRESENTATION_PPSX_PUBLIC, ),
- 'extensions': ('ppsx', )
+ 'mimetypes': (ct.CT_PRESENTATION_PPSX_PUBLIC,),
+ 'extensions': ('ppsx',)
},
{'name': 'Office Powerpoint 2007 macro-enabled XML presentation',
- 'mimetypes': (ct.CT_PRESENTATION_PPTM_PUBLIC, ),
- 'extensions': ('pptm', )
+ 'mimetypes': (ct.CT_PRESENTATION_PPTM_PUBLIC,),
+ 'extensions': ('pptm',)
},
{'name': 'Office Powerpoint 2007 XML presentation',
- 'mimetypes': (ct.CT_PRESENTATION_PPTX_PUBLIC, ),
- 'extensions': ('pptx', )
+ 'mimetypes': (ct.CT_PRESENTATION_PPTX_PUBLIC,),
+ 'extensions': ('pptx',)
},
{'name': 'Office Excel 2007 XML macro-enabled add-in',
- 'mimetypes': (ct.CT_SPREADSHEET_XLAM_PUBLIC, ),
- 'extensions': ('xlam', )
+ 'mimetypes': (ct.CT_SPREADSHEET_XLAM_PUBLIC,),
+ 'extensions': ('xlam',)
},
{'name': 'Office Excel 2007 binary workbook (BIFF12)',
- 'mimetypes': (ct.CT_SPREADSHEET_XLSB_PUBLIC, ),
- 'extensions': ('xlsb', )
+ 'mimetypes': (ct.CT_SPREADSHEET_XLSB_PUBLIC,),
+ 'extensions': ('xlsb',)
},
{'name': 'Office Excel 2007 XML macro-enabled workbook',
- 'mimetypes': (ct.CT_SPREADSHEET_XLSM_PUBLIC, ),
- 'extensions': ('xlsm', )
+ 'mimetypes': (ct.CT_SPREADSHEET_XLSM_PUBLIC,),
+ 'extensions': ('xlsm',)
},
{'name': 'Office Excel 2007 XML workbook',
- 'mimetypes': (ct.CT_SPREADSHEET_XLSX_PUBLIC, ),
- 'extensions': ('xlsx', )
+ 'mimetypes': (ct.CT_SPREADSHEET_XLSX_PUBLIC,),
+ 'extensions': ('xlsx',)
},
{'name': 'Office Excel 2007 XML macro-enabled template',
- 'mimetypes': (ct.CT_SPREADSHEET_XLTM_PUBLIC, ),
- 'extensions': ('xltm', )
+ 'mimetypes': (ct.CT_SPREADSHEET_XLTM_PUBLIC,),
+ 'extensions': ('xltm',)
},
{'name': 'Office Excel 2007 XML template',
- 'mimetypes': (ct.CT_SPREADSHEET_XLTX_PUBLIC, ),
- 'extensions': ('xltx', )
+ 'mimetypes': (ct.CT_SPREADSHEET_XLTX_PUBLIC,),
+ 'extensions': ('xltx',)
},
)
View
3 Products/OpenXml/setuphandlers.py
@@ -6,7 +6,6 @@
import config
from Products.OpenXml import logger
-
def setupOpenXml(context):
"""Add MS Office 2007 content types to MimetypesRegistry"""
@@ -54,3 +53,5 @@ def removeOpenXml(context):
transforms_tool = getToolByName(site, 'portal_transforms')
transforms_tool.unregisterTransform(config.TRANSFORM_NAME)
return
+
+
View
6 Products/OpenXml/tests/test_mtr.py
@@ -5,8 +5,7 @@
from Products.MimetypesRegistry.interfaces import IMimetype
from Products.PloneTestCase import PloneTestCase
from Products.OpenXml.config import office_mimetypes
-#import common
-
+import common
class MTRTestCase(PloneTestCase.PloneTestCase):
@@ -15,6 +14,7 @@ def afterSetUp(self):
portal = self.getPortal()
self.mtr = getToolByName(portal, 'mimetypes_registry')
+
def testInstallation(self):
"""Checking installation of our Mime types"""
@@ -31,6 +31,7 @@ def testInstallation(self):
"Didn't find MimeType obj for %s" % mt_string)
return
+
def testExtensions(self):
"""Finding mimetypes by extension"""
@@ -48,3 +49,4 @@ def test_suite():
suite = TestSuite()
suite.addTest(makeSuite(MTRTestCase))
return suite
+
View
8 Products/OpenXml/tests/test_pt.py
@@ -6,8 +6,7 @@
from Products.CMFCore.utils import getToolByName
from Products.PloneTestCase import PloneTestCase
from Products.OpenXml.config import TRANSFORM_NAME
-#import common
-
+import common
class PTTestCase(PloneTestCase.PloneTestCase):
@@ -16,21 +15,21 @@ def afterSetUp(self):
portal = self.getPortal()
self.pt = getToolByName(portal, 'portal_transforms')
+
def testInstallation(self):
"""Checking installation of our transform"""
self.failUnless(TRANSFORM_NAME in self.pt.objectIds(spec='Transform'),
"%s transform expected" % TRANSFORM_NAME)
return
+
def testATfileSearchableText(self):
"""Do we index the text of an openxml office file"""
self.loginAsPortalOwner()
-
class fakefile(StringIO.StringIO):
pass
-
this_dir = os.path.dirname(os.path.abspath(__file__))
test_filename = os.path.join(this_dir, 'wordprocessing1.docx')
fakefile = fakefile(file(test_filename, 'rb').read())
@@ -51,3 +50,4 @@ def test_suite():
suite = TestSuite()
suite.addTest(makeSuite(PTTestCase))
return suite
+
View
4 Products/OpenXml/transform.py
@@ -10,7 +10,6 @@
from config import SITE_CHARSET, TRANSFORM_NAME
from Products.OpenXml import logger
-
class openxml_to_text:
__implements__ = itransform
__name__ = TRANSFORM_NAME
@@ -46,7 +45,7 @@ class openxml_to_text:
output_encoding = SITE_CHARSET
- def __init__(self, name=None):
+ def __init__(self,name=None):
if name:
self.__name__=name
return
@@ -70,6 +69,5 @@ def convert(self, orig, data, **kwargs):
data.setData('')
return data
-
def register():
return openxml_to_text()

0 comments on commit 5279982

Please sign in to comment.