# HG changeset patch # User cavaliet # Date 1326475218 -3600 # Node ID 4b67ef97438f98692998fbfa486cc0937852e045 # Parent a32ce353344789425f7415f915cd99a665d69b3b# Parent 398c70610f99681f36f651930c64c384f188716a Merge with 398c70610f99681f36f651930c64c384f188716a diff -r 398c70610f99 -r 4b67ef97438f .project --- a/.project Fri Jan 13 17:39:33 2012 +0100 +++ b/.project Fri Jan 13 18:20:18 2012 +0100 @@ -1,17 +1,23 @@ - - - platform_group - - - - - - com.aptana.ide.core.unifiedBuilder - - - - - - com.aptana.projects.webnature - - + + + platform_group + + + + + + org.python.pydev.PyDevBuilder + + + + + com.aptana.ide.core.unifiedBuilder + + + + + + com.aptana.projects.webnature + org.python.pydev.pythonNature + + diff -r 398c70610f99 -r 4b67ef97438f src/ldt/ldt/api/ldt/handlers.py --- a/src/ldt/ldt/api/ldt/handlers.py Fri Jan 13 17:39:33 2012 +0100 +++ b/src/ldt/ldt/api/ldt/handlers.py Fri Jan 13 18:20:18 2012 +0100 @@ -165,7 +165,7 @@ for a in new_annotations: dur = str(a['end'] - a['begin']) begin = str(a['begin']) - new_id = adder.add(a['media'], a['type'], a['type_title'], a['content']['data'], '', a['tags'], begin, dur, author, date) + type_id, new_id = adder.add(a['media'], a['type'], a['type_title'], a['content']['data'], '', a['tags'], begin, dur, author, date) if not new_id: protect_instance(project) return rc.BAD_REQUEST @@ -175,7 +175,9 @@ unprotect_instance(content) add_annotation_to_stat(content, project, a['begin'], a['end']) protect_instance(content) - + + # We update the ids + a['type'] = type_id a['id'] = new_id # We save if there were added annotation diff -r 398c70610f99 -r 4b67ef97438f src/ldt/ldt/ldt_utils/utils.py --- a/src/ldt/ldt/ldt_utils/utils.py Fri Jan 13 17:39:33 2012 +0100 +++ b/src/ldt/ldt/ldt_utils/utils.py Fri Jan 13 18:20:18 2012 +0100 @@ -171,7 +171,7 @@ self.to_add = True # add( a['media'], a['type'], a['type_title, a[data], '', a['tags'], begin, dur, author, date) - def add(self, media, cutting_id, cutting_title, title, text, tags_list, begin, dur, author, date, view_id=None, color="16776960"): + def add(self, media, cutting_id, cutting_title, title, text, tags_list, begin, dur, author, date, view_id="0", color="2194379"): """ Add an annotation to a project. begin and dur must be strings. Default color is yellow. """ @@ -202,7 +202,8 @@ path_ensemble = lxml.etree.SubElement(path_content[0], 'ensemble') path_ensemble.set('id', 'g_' + generate_uuid()) path_ensemble.set('title', _('Personal cutting')) - path_ensemble.set('author', 'undefined') + path_ensemble.set('author', 'IRI') + path_ensemble.set('abstract', 'IRI') path_ensemble = [path_ensemble] #else: # path_ensemble = path_content[0].xpath('ensemble') @@ -264,7 +265,7 @@ tag_node = lxml.etree.SubElement(tags, 'tag') tag_node.text = tag - return id_annotation + return cutting_id, id_annotation def save(self): if self.to_add: