# HG changeset patch # User amit@thunder # Date 1268222966 -19800 # Node ID b5bff924ef693e5a065f02e19c4951fcf5dbf8ee # Parent d0e9b52bda73483970c0c6cd13fc4bc4989855e3 Some more changes to soup is made in final html also comment.html has been changed so the links don't appear diff -r d0e9b52bda73 -r b5bff924ef69 SEESenv/scripts/finalhtml.py --- a/SEESenv/scripts/finalhtml.py Wed Mar 10 00:04:25 2010 +0530 +++ b/SEESenv/scripts/finalhtml.py Wed Mar 10 17:39:26 2010 +0530 @@ -12,14 +12,21 @@ #repo='/home/amit/testdocbook2/' def sort_doubledigit(chapter_names): + extend_list=[] for item in chapter_names: reg_obj=re.compile(os.path.join(repo,'ch1[0-9].*.html')) if (reg_obj.match(item)): - item_tmp=item - chapter_names.remove(item) - chapter_names.append(item_tmp) + item=re.sub('ch1','chn1',item) + extend_list.append(item) + chapter_names=chapter_names[len(extend_list):] + chapter_names.extend(extend_list) + return chapter_names + + + + def finalchanges(file_name,html_string): """some of the final changes that need to do be done on the html before creating the final usable page in the hgbook project""" # print html_string @@ -33,22 +40,32 @@ chapter_names=chapter_names_sorted previous_string='<<<' next_string='>>>' - html_src_folder="review/html/" - current_chapter_index=chapter_names.index(file_name) + ch_name_tmp=file_name.split('.')[0] +# html_src_folder="" + - current_chapter=os.path.join(html_src_folder,chapter_names[current_chapter_index].split('/')[-1]) - if (current_chapter_index-1>0): - previous_chapter=os.path.join(html_src_folder,chapter_names[current_chapter_index-1].split('/')[-1]) + try: + #Handling the problem of chapter names in two digits + current_chapter_index=chapter_names.index(file_name) + except : + temp_file_name=re.sub('ch1','chn1',file_name) + current_chapter_index=chapter_names.index(temp_file_name) + + + + current_chapter=chapter_names[current_chapter_index].split('/')[-1] + if (current_chapter_index-1>=0): + previous_chapter=chapter_names[current_chapter_index-1].split('/')[-1] else: previous_chapter='' previous_string='' try : - next_chapter=os.path.join(html_src_folder,chapter_names[current_chapter_index+1].split('/')[-1]) + next_chapter=chapter_names[current_chapter_index+1].split('/')[-1] except: next_string='' next_chapter='' - ch_name_tmp=file_name.split('.')[0] + chapter_xml=ch_name_tmp+'.xml' @@ -70,7 +87,7 @@ except : ch_title=re.split('[0-9]*',ch_name)[1] - title_string='Chapter. '+ ch_title + title_string=ch_title current_chapter_title=title_string diff -r d0e9b52bda73 -r b5bff924ef69 SEESenv/web/hgbook/templates/comment.html --- a/SEESenv/web/hgbook/templates/comment.html Wed Mar 10 00:04:25 2010 +0530 +++ b/SEESenv/web/hgbook/templates/comment.html Wed Mar 10 17:39:26 2010 +0530 @@ -45,12 +45,10 @@ {{ form.id }} - + + Required
Comment
[ help ]
Comment
{{ form.comment }}
Your name{{ form.name }} - Required so we can give you credit
Your URL{{ form.url }} Optional link to blog, home page, etc.