Commit a962f44f authored by Boris Kocherov's avatar Boris Kocherov

x2t: x2t dependencies in ooo handler removed

parent a7007bd4
......@@ -43,12 +43,6 @@ from cloudooo.handler.ooo.monitor import monitor_sleeping_time
from cloudooo.util import logger, parseContentType
from psutil import pid_exists
try:
from cloudooo.handler.x2t.handler import Handler as YformatHandler
from cloudooo.handler.x2t.handler import yformat_map
except ImportError:
yformat_map = None
class Handler(object):
"""OOO Handler is used to access the one Document and OpenOffice.
For each Document inputed is created on instance of this class to manipulate
......@@ -59,13 +53,6 @@ class Handler(object):
def __init__(self, base_folder_url, data, source_format, **kw):
"""Creates document in file system and loads it in OOo."""
if yformat_map:
if source_format in yformat_map:
logger.debug("OooConvert: xlsy > xlsx")
yformat = YformatHandler(base_folder_url, data, source_format, **kw)
destination_format = yformat_map[source_format]
data = yformat.convert(destination_format=destination_format)
source_format = destination_format
self.document = FileSystemDocument(base_folder_url,
data,
source_format)
......@@ -167,11 +154,6 @@ class Handler(object):
Keyword Arguments:
destination_format -- extension of document as String
"""
yformat = False
if yformat_map:
if destination_format in yformat_map:
yformat = destination_format
destination_format = yformat_map[destination_format]
logger.debug("OooConvert: %s > %s" % (self.source_format, destination_format))
kw['source_format'] = self.source_format
if destination_format:
......@@ -188,14 +170,6 @@ class Handler(object):
self.document.reload(url)
content = self.document.getContent(self.zip)
self.document.trash()
if yformat:
logger.debug("OooConvert: xlsx > xlsy")
source_format = destination_format
kw['destination_format'] = yformat
yformat = YformatHandler(self.document.base_folder_url,
content, source_format)
content = yformat.convert(**kw)
return content
def getMetadata(self, base_document=False):
......
......@@ -37,12 +37,6 @@ from cloudooo.interfaces.mimemapper import IMimemapper
from types import InstanceType
import json
try:
from cloudooo.handler.x2t.handler import yformat_service_map
except ImportError:
yformat_service_map = {}
class MimeMapper(object):
"""Load all filters from OOo. You can get the filter you want or all
filters of the specific extension.
......@@ -231,9 +225,6 @@ class MimeMapper(object):
'pdf': ['com.sun.star.drawing.DrawingDocument'],
'xls': ['com.sun.star.sheet.SpreadsheetDocument'],
})
self._doc_type_list_by_extension.update((ext, [service, ]) for ext, service in yformat_service_map.iteritems())
for ext, service in yformat_service_map.iteritems():
self._extension_list_by_type[service].append((ext, ext.capitalize()))
self.document_service_list = self._extension_list_by_type.keys()
self._loaded = True
......
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