[Erp5-report] r41810 hugo.maia - in /erp5/trunk/utils/cloudooo/cloudooo: granulate/ interfa...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Dec 27 20:06:22 CET 2010


Author: hugo.maia
Date: Mon Dec 27 20:06:21 2010
New Revision: 41810

URL: http://svn.erp5.org?rev=41810&view=rev
Log:
Re-add getColumnItemList and getLineItemList to granulate api

Modified:
    erp5/trunk/utils/cloudooo/cloudooo/granulate/oogranulate.py
    erp5/trunk/utils/cloudooo/cloudooo/interfaces/granulate.py
    erp5/trunk/utils/cloudooo/cloudooo/tests/testInterface.py
    erp5/trunk/utils/cloudooo/cloudooo/tests/testOOGranulate.py

Modified: erp5/trunk/utils/cloudooo/cloudooo/granulate/oogranulate.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/granulate/oogranulate.py?rev=41810&r1=41809&r2=41810&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/granulate/oogranulate.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/granulate/oogranulate.py [utf8] Mon Dec 27 20:06:21 2010
@@ -123,6 +123,14 @@ class OOGranulate(object):
       logger.error(e)
       return None
 
+  def getColumnItemList(self, file, table_id):
+    """Return the list of columns in the form of (id, title)."""
+    raise NotImplementedError
+
+  def getLineItemList(self, file, table_id):
+    """Returns the lines of a given table as (key, value) pairs."""
+    raise NotImplementedError
+
   def getImageItemList(self):
     """Return a list of tuples with the id and title of image files"""
     xml_image_list = self.document.parsed_content.xpath(DRAW_XPATH_QUERY,

Modified: erp5/trunk/utils/cloudooo/cloudooo/interfaces/granulate.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/interfaces/granulate.py?rev=41810&r1=41809&r2=41810&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/interfaces/granulate.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/interfaces/granulate.py [utf8] Mon Dec 27 20:06:21 2010
@@ -38,6 +38,12 @@ class ITableGranulator(Interface):
   def getTableItem(id, format):
     """Returns the table into a new 'format' file."""
 
+  def getColumnItemList(file, table_id):
+    """Return the list of columns in the form of (id, title)."""
+
+  def getLineItemList(file, table_id):
+    """Returns the lines of a given table as (key, value) pairs."""
+
 
 class IImageGranulator(Interface):
   """Provides methods to granulate a document into images."""

Modified: erp5/trunk/utils/cloudooo/cloudooo/tests/testInterface.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/tests/testInterface.py?rev=41810&r1=41809&r2=41810&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/tests/testInterface.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/tests/testInterface.py [utf8] Mon Dec 27 20:06:21 2010
@@ -57,6 +57,8 @@ class TestInterface(unittest.TestCase):
     """Test if OOGranulate implements ITableGranulator"""
     self.assertEquals(ITableGranulator.implementedBy(OOGranulate), True)
     method_list = ['getTableItem',
+                   'getLineItemList',
+                   'getColumnItemList',
                    'getTableItemList']
     self.assertEquals(ITableGranulator.names(), method_list)
 

Modified: erp5/trunk/utils/cloudooo/cloudooo/tests/testOOGranulate.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/tests/testOOGranulate.py?rev=41810&r1=41809&r2=41810&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/tests/testOOGranulate.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/tests/testOOGranulate.py [utf8] Mon Dec 27 20:06:21 2010
@@ -83,6 +83,18 @@ class TestOOGranulate(cloudoooTestCase):
     table_data = oogranulate.getTableItem('NonExistentTable')
     self.assertEquals(table_data, None)
 
+  def testGetColumnItemList(self):
+    """Test if getColumnItemList() returns the right table columns list"""
+    self.assertRaises(NotImplementedError, self.oogranulate.getColumnItemList,
+                                     'file',
+                                     'table_id')
+
+  def testGetLineItemList(self):
+    """Test if getLineItemList() returns the right table lines list"""
+    self.assertRaises(NotImplementedError, self.oogranulate.getLineItemList,
+                                     'file',
+                                     'table_id')
+
   def testGetImageItemList(self):
     """Test if getImageItemList() returns the right images list"""
     image_list = self.oogranulate.getImageItemList()



More information about the Erp5-report mailing list