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.
# Hugo H. Maia Vieira <hugomaia@tiolive.com>
......@@ -33,9 +33,6 @@ from lxml import etree
from os import path
from cloudooo.utils.utils import logger
from cloudooo.handler.ooo.document import OdfDocument
from cloudooo.interfaces.granulate import ITableGranulator, \
IImageGranulator, \
ITextGranulator
# URI Definitions.
TEXT_URI = 'urn:oasis:names:tc:opendocument:xmlns:text:1.0'
......@@ -63,8 +60,6 @@ class OOGranulator(object):
"""Granulate an OpenOffice document into tables, images, chapters and
paragraphs."""
implements(ITableGranulator, IImageGranulator, ITextGranulator)
def __init__(self, file, source_format):
self.document = OdfDocument(file, source_format)
......@@ -126,10 +121,14 @@ class OOGranulator(object):
logger.error(e)
return None
def getTableMatrix(self, id):
"""Returns the table as a matrix"""
def getColumnItemList(self, table_id):
"""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(
'//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)
if len(row_list) == 0:
return None
......@@ -210,11 +209,11 @@ class OOGranulator(object):
p_class = paragraph.attrib[TEXT_ATTRIB_STYLENAME]
return (text, p_class)
def getChapterItemList(self, file):
def getChapterItemList(self):
"""Returns the list of chapters in the form of (id, level)."""
raise NotImplementedError
def getChapterItem(self, file, chapter_id):
def getChapterItem(self, chapter_id):
"""Return the chapter in the form of (title, level)."""
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