Some more changes to soup is made in final html also comment.html has been changed so the links don't appear
--- 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
--- 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 }}
<table>
<tbody>
- <tr><td align="right" valign="top">Comment<br><a class="comment_help"
- href="web.html#web.comment">[ help ]</a></td>
+ <tr><td align="right" valign="top">Comment<br></td>
<td>{{ form.comment }}</td></tr>
<tr><td align="right">Your name</td><td>{{ form.name }}
- <span class="comment_help"><b>Required</b> so we can <a
- href="web.html#web.comment.name">give you credit</a></span></td></tr>
+ <span class="comment_help"><b>Required</b></span></td></tr>
<tr><td align="right">Your URL</td><td>{{ form.url }}
<span class="comment_help"><b>Optional</b> link to blog, home page,
<i>etc</i>.</span></td></tr>