Commit 4497b7d5 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

remove useless getMimetypeByFilterType() method in mimemapper.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@42589 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c8b4ea52
...@@ -197,16 +197,6 @@ class MimeMapper(object): ...@@ -197,16 +197,6 @@ class MimeMapper(object):
for type, extension_list in self._extension_list_by_type.iteritems()]) for type, extension_list in self._extension_list_by_type.iteritems()])
self._loaded = True self._loaded = True
def getMimetypeByFilterType(self, filter_type):
"""Get Mimetype according to the filter type
Keyword arguments:
filter_type -- string of OOo filter
e.g
>>> mimemapper.getMimetypeByFilterType("writer8")
'application/vnd.oasis.opendocument.text'
"""
return self._mimetype_by_filter_type.get(filter_type, u'')
def getFilterName(self, extension, document_service): def getFilterName(self, extension, document_service):
"""Get filter name according to the parameters passed. """Get filter name according to the parameters passed.
Keyword arguments: Keyword arguments:
......
...@@ -331,15 +331,5 @@ class TestMimeMapper(CloudoooTestCase): ...@@ -331,15 +331,5 @@ class TestMimeMapper(CloudoooTestCase):
'com.sun.star.presentation.PresentationDocument') 'com.sun.star.presentation.PresentationDocument')
self.assertEquals(filtername, "impress_html_Export") self.assertEquals(filtername, "impress_html_Export")
def testGetMimetype(self):
"""Test get mimetype according to the filter type"""
self.assertEquals(self.mimemapper.getMimetypeByFilterType("writer8"),
"application/vnd.oasis.opendocument.text")
self.assertEquals(self.mimemapper.getMimetypeByFilterType("math8"),
'')
self.assertEquals(self.mimemapper.getMimetypeByFilterType("writer_MS_Word_97"),
'application/msword')
def test_suite(): def test_suite():
return make_suite(TestMimeMapper) return make_suite(TestMimeMapper)
...@@ -51,6 +51,3 @@ class IMimemapper(Interface): ...@@ -51,6 +51,3 @@ class IMimemapper(Interface):
def getAllowedExtensionList(document_type, **kwargs): def getAllowedExtensionList(document_type, **kwargs):
"""Returns a list with extensions which can be used to export according to """Returns a list with extensions which can be used to export according to
document type passed.""" document type passed."""
def getMimetypeByFilterType(filter_type):
"""Returns mimetype according to the filter type passed"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment