# HG changeset patch
# User amit@thunder
# Date 1268159665 -19800
# Node ID d0e9b52bda73483970c0c6cd13fc4bc4989855e3
# Parent 134b87b382f56d2a823e86cd986782cbd9c2a630
Changed the algorithm for getting the titles ... Also added the ability to navigate to the next chapters
diff -r 134b87b382f5 -r d0e9b52bda73 SEESenv/scripts/changenames.py
--- a/SEESenv/scripts/changenames.py Thu Mar 04 14:33:38 2010 +0530
+++ b/SEESenv/scripts/changenames.py Wed Mar 10 00:04:25 2010 +0530
@@ -10,11 +10,10 @@
reg_obj=re.compile(os.path.join(repo,'ch1[0-9].*.html'))
if (reg_obj.match(name)):
changed_name=re.sub('ch1','chn1',name)
- command2="rm %s" %(name,)
+
else:
changed_name=name
- command1="cp %s %s" %(name ,changed_name)
- subprocess.Popen(command1,shell=True)
+ command="mv %s %s" %(name ,changed_name)
+ subprocess.Popen(command,shell=True)
time.sleep(2)
- subprocess.Popen(command2,shell=True)
- time.sleep(1)
+
diff -r 134b87b382f5 -r d0e9b52bda73 SEESenv/scripts/finalhtml.py
--- a/SEESenv/scripts/finalhtml.py Thu Mar 04 14:33:38 2010 +0530
+++ b/SEESenv/scripts/finalhtml.py Wed Mar 10 00:04:25 2010 +0530
@@ -2,25 +2,90 @@
#import lxml
import re
import os
-from BeautifulSoup import BeautifulSoup
+from BeautifulSoup import BeautifulSoup ,NavigableString
import time
import sys
+import xml.etree.ElementTree as ET
+import xml
+
repo='/home/hg/repos/SEES-hacks/temp/'
+#repo='/home/amit/testdocbook2/'
+def sort_doubledigit(chapter_names):
+ 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)
+ 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
replace_string="""