Commit afb802af authored by Vincent Pelletier's avatar Vincent Pelletier

Remove outdated XXX.

Respect indentation width.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6900 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 36ec65be
...@@ -41,7 +41,7 @@ from zLOG import LOG ...@@ -41,7 +41,7 @@ from zLOG import LOG
class IdTool(UniqueObject, Folder): class IdTool(UniqueObject, Folder):
""" """
This tools allows to generate new ids This tools handles the generation of IDs.
""" """
id = 'portal_ids' id = 'portal_ids'
meta_type = 'ERP5 Id Tool' meta_type = 'ERP5 Id Tool'
...@@ -69,15 +69,10 @@ class IdTool(UniqueObject, Folder): ...@@ -69,15 +69,10 @@ class IdTool(UniqueObject, Folder):
def __init__(self): def __init__(self):
return Folder.__init__(self, IdTool.id) return Folder.__init__(self, IdTool.id)
# Filter content (ZMI)) # Filter content (ZMI))
def generateNewId(self, id_group=None, default=None, method=None): def generateNewId(self, id_group=None, default=None, method=None):
""" """
Generate a new Id Generate a new Id
XXX We should in the future use class instead of method to generate
new ids. It would be nice to have a management page giving the list
of id_group with each time the last_id and the class generator
""" """
if not hasattr(self,'dict_ids'): if not hasattr(self,'dict_ids'):
self.dict_ids = PersistentMapping() self.dict_ids = PersistentMapping()
...@@ -89,12 +84,7 @@ class IdTool(UniqueObject, Folder): ...@@ -89,12 +84,7 @@ class IdTool(UniqueObject, Folder):
l = threading.Lock() l = threading.Lock()
l.acquire() l.acquire()
try: try:
if self.dict_ids.has_key(id_group): last_id = self.dict_ids.get(id_group, default or 0)
last_id = self.dict_ids[id_group]
elif default is not None:
last_id = default
else:
last_id = 0
# Now generate a new id # Now generate a new id
if method is not None: if method is not None:
...@@ -109,7 +99,4 @@ class IdTool(UniqueObject, Folder): ...@@ -109,7 +99,4 @@ class IdTool(UniqueObject, Folder):
return new_id return new_id
InitializeClass(IdTool) InitializeClass(IdTool)
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