BUG FIX : pdf export PhA tests, TODO fix special html caracters in comments
authorreno
Fri, 11 Dec 2009 12:02:39 +0100
changeset 58 a480a91d63ca
parent 57 b32aa76ee411
child 59 8a2d933209aa
BUG FIX : pdf export PhA tests, TODO fix special html caracters in comments
src/cm/utils/comment_positioning.py
--- a/src/cm/utils/comment_positioning.py	Fri Dec 11 11:48:10 2009 +0100
+++ b/src/cm/utils/comment_positioning.py	Fri Dec 11 12:02:39 2009 +0100
@@ -148,10 +148,10 @@
     html = get_the_soup(htmlcontent) ;
     
 #    import pdb;pdb.set_trace()
-    
-    max_wrapper = max([comment.end_wrapper for comment in comments])
-    min_wrapper = min([comment.start_wrapper for comment in comments])
-    
+    if comments :
+        max_wrapper = max([comment.end_wrapper for comment in comments])
+        min_wrapper = min([comment.start_wrapper for comment in comments])
+        
     datas = {} # { wrapper_id : {'start_color':nb_of_comments_unterminated_at_wrapper_start, 'offsets':{offset: [[ids of wrappers starting at offset], [ids of wrappers ending at offset]]}}
     # datas['offsets'][someoffset][0] and idem[1] will be ordered the way comments are (should be ('start_wrapper', 'start_offset', 'end_wrapper', 'end_offset') important)
     cpt = 1 # starting numbered comment