Commit 82251860 authored by Aurel's avatar Aurel

remove some cleaning


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4947 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fbc4f5e4
...@@ -61,10 +61,11 @@ class XMLMatrix(Folder): ...@@ -61,10 +61,11 @@ class XMLMatrix(Folder):
# Matrix Methods # Matrix Methods
security.declareProtected( Permissions.View, 'getCell' ) security.declareProtected( Permissions.View, 'getCell' )
def getCell(self, base_id="cell", *kw , **kwd): def getCell(self, *kw , **kwd):
""" """
Access a cell at row and column Access a cell at row and column
""" """
base_id= kwd.get('base_id', "cell")
if not hasattr(self, 'index'): if not hasattr(self, 'index'):
return None return None
...@@ -83,10 +84,11 @@ class XMLMatrix(Folder): ...@@ -83,10 +84,11 @@ class XMLMatrix(Folder):
return self.get(cell_id) return self.get(cell_id)
security.declareProtected( Permissions.View, 'getCellProperty' ) security.declareProtected( Permissions.View, 'getCellProperty' )
def getCellProperty(self, base_id="cell", *kw , **kwd): def getCellProperty(self, *kw , **kwd):
""" """
Get a property of a cell at row and column Get a property of a cell at row and column
""" """
base_id= kwd.get('base_id', "cell")
cell = self.getCell(*kw, **kwd) cell = self.getCell(*kw, **kwd)
if cell is None: if cell is None:
return None return None
...@@ -94,17 +96,18 @@ class XMLMatrix(Folder): ...@@ -94,17 +96,18 @@ class XMLMatrix(Folder):
return cell.getProperty(base_id) return cell.getProperty(base_id)
security.declareProtected( Permissions.View, 'hasCell' ) security.declareProtected( Permissions.View, 'hasCell' )
def hasCell(self, base_id="cell", *kw , **kwd): def hasCell(self, *kw , **kwd):
""" """
Checks if matrix corresponding to base_id contains cell specified Checks if matrix corresponding to base_id contains cell specified
by *kw coordinates. by *kw coordinates.
""" """
if not hasattr(self, 'index'): if not hasattr(self, 'index'):
return 0 return 0
if not self.index.has_key(base_id): if not self.index.has_key(base_id):
return 0 return 0
base_id= kwd.get('base_id', "cell")
cell_id = base_id cell_id = base_id
i = 0 i = 0
for my_id in kw: for my_id in kw:
...@@ -139,7 +142,7 @@ class XMLMatrix(Folder): ...@@ -139,7 +142,7 @@ class XMLMatrix(Folder):
return 0 return 0
security.declareProtected( Permissions.View, 'hasInRange' ) security.declareProtected( Permissions.View, 'hasInRange' )
def hasInRange(self, base_id="cell", *kw , **kwd): def hasInRange(self, *kw , **kwd):
""" """
Checks if cell exists TODO Checks if cell exists TODO
...@@ -151,7 +154,7 @@ class XMLMatrix(Folder): ...@@ -151,7 +154,7 @@ class XMLMatrix(Folder):
if not self.index.has_key(base_id): if not self.index.has_key(base_id):
return 0 return 0
base_id= kwd.get('base_id', "cell")
i = 0 i = 0
for my_id in kw: for my_id in kw:
if self.index[base_id].has_key(i): if self.index[base_id].has_key(i):
...@@ -165,7 +168,7 @@ class XMLMatrix(Folder): ...@@ -165,7 +168,7 @@ class XMLMatrix(Folder):
security.declareProtected( Permissions.ModifyPortalContent, security.declareProtected( Permissions.ModifyPortalContent,
'_setCellRange' ) '_setCellRange' )
def _setCellRange(self, base_id="cell", *kw, **kwd): def _setCellRange(self, *kw, **kwd):
""" """
Set a new range for a matrix, this method can Set a new range for a matrix, this method can
also handle a changement of the size of a matrix also handle a changement of the size of a matrix
...@@ -175,6 +178,7 @@ class XMLMatrix(Folder): ...@@ -175,6 +178,7 @@ class XMLMatrix(Folder):
new_index = PersistentMapping() # new_index defines the relation between keys new_index = PersistentMapping() # new_index defines the relation between keys
# and ids of cells # and ids of cells
base_id= kwd.get('base_id', "cell")
if not hasattr(aq_base(self), 'index'): if not hasattr(aq_base(self), 'index'):
self.index = PersistentMapping() self.index = PersistentMapping()
...@@ -306,13 +310,13 @@ class XMLMatrix(Folder): ...@@ -306,13 +310,13 @@ class XMLMatrix(Folder):
self.index[base_id] = new_index[base_id] self.index[base_id] = new_index[base_id]
security.declareProtected( Permissions.ModifyPortalContent, 'setCellRange' ) security.declareProtected( Permissions.ModifyPortalContent, 'setCellRange' )
def setCellRange(self, base_id="cell", *kw, **kwd): def setCellRange(self, *kw, **kwd):
""" """
Update the matrix ranges using provided lists of indexes (kw). Update the matrix ranges using provided lists of indexes (kw).
Any number of list can be provided Any number of list can be provided
""" """
self._setCellRange(base_id=base_id, *kw, **kwd) self._setCellRange(*kw, **kwd)
self.reindexObject() self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
...@@ -464,13 +468,13 @@ class XMLMatrix(Folder): ...@@ -464,13 +468,13 @@ class XMLMatrix(Folder):
return result return result
security.declareProtected( Permissions.ModifyPortalContent, 'newCell' ) security.declareProtected( Permissions.ModifyPortalContent, 'newCell' )
def newCell(self, base_id="cell", *kw, **kwd): def newCell(self, *kw, **kwd):
""" """
This method creates a new cell This method creates a new cell
""" """
if not hasattr(self, 'index'): if not hasattr(self, 'index'):
return None return None
base_id= kwd.get('base_id', "cell")
cell_id = base_id cell_id = base_id
if not self.index.has_key(cell_id): if not self.index.has_key(cell_id):
return None return None
......
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