Commit 59765d3a authored by Mario Jorge Amaral's avatar Mario Jorge Amaral

Remove the implementations of interfaces.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@43588 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f7ba22ad
############################################################################## #############################################################################
# #
# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. # Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved.
# Hugo H. Maia Vieira <hugomaia@tiolive.com> # Hugo H. Maia Vieira <hugomaia@tiolive.com>
...@@ -33,9 +33,6 @@ from lxml import etree ...@@ -33,9 +33,6 @@ from lxml import etree
from os import path from os import path
from cloudooo.utils.utils import logger from cloudooo.utils.utils import logger
from cloudooo.handler.ooo.document import OdfDocument from cloudooo.handler.ooo.document import OdfDocument
from cloudooo.interfaces.granulate import ITableGranulator, \
IImageGranulator, \
ITextGranulator
# URI Definitions. # URI Definitions.
TEXT_URI = 'urn:oasis:names:tc:opendocument:xmlns:text:1.0' TEXT_URI = 'urn:oasis:names:tc:opendocument:xmlns:text:1.0'
...@@ -63,8 +60,6 @@ class OOGranulator(object): ...@@ -63,8 +60,6 @@ class OOGranulator(object):
"""Granulate an OpenOffice document into tables, images, chapters and """Granulate an OpenOffice document into tables, images, chapters and
paragraphs.""" paragraphs."""
implements(ITableGranulator, IImageGranulator, ITextGranulator)
def __init__(self, file, source_format): def __init__(self, file, source_format):
self.document = OdfDocument(file, source_format) self.document = OdfDocument(file, source_format)
...@@ -126,10 +121,14 @@ class OOGranulator(object): ...@@ -126,10 +121,14 @@ class OOGranulator(object):
logger.error(e) logger.error(e)
return None return None
def getTableMatrix(self, id): def getColumnItemList(self, table_id):
"""Returns the table as a matrix""" """Return the list of columns in the form of (id, title)."""
raise NotImplementedError
def getLineItemList(self, table_id):
"""Returns the lines of a given table as (key, value) pairs."""
row_list = self.document.parsed_content.xpath( row_list = self.document.parsed_content.xpath(
'//table:table[@table:name="%s"]/table:table-row' % id, '//table:table[@table:name="%s"]/table:table-row' % table_id,
namespaces=self.document.parsed_content.nsmap) namespaces=self.document.parsed_content.nsmap)
if len(row_list) == 0: if len(row_list) == 0:
return None return None
...@@ -210,11 +209,11 @@ class OOGranulator(object): ...@@ -210,11 +209,11 @@ class OOGranulator(object):
p_class = paragraph.attrib[TEXT_ATTRIB_STYLENAME] p_class = paragraph.attrib[TEXT_ATTRIB_STYLENAME]
return (text, p_class) return (text, p_class)
def getChapterItemList(self, file): def getChapterItemList(self):
"""Returns the list of chapters in the form of (id, level).""" """Returns the list of chapters in the form of (id, level)."""
raise NotImplementedError raise NotImplementedError
def getChapterItem(self, file, chapter_id): def getChapterItem(self, chapter_id):
"""Return the chapter in the form of (title, level).""" """Return the chapter in the form of (title, level)."""
raise NotImplementedError raise NotImplementedError
......
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