Solving some especially with p_list.py
authoramit@thunder
Sun, 28 Feb 2010 16:22:19 +0530
changeset 33 bc535262231d
parent 32 de7ac08f237b
child 34 18b34db550ec
Solving some especially with p_list.py
SEESenv/scripts/autoid.py
SEESenv/scripts/rst2docbook.py
sees.hook
test.hook
--- a/SEESenv/scripts/autoid.py	Sat Feb 27 00:10:28 2010 +0530
+++ b/SEESenv/scripts/autoid.py	Sun Feb 28 16:22:19 2010 +0530
@@ -9,6 +9,7 @@
 tagged = re.compile('<para[^>]* id="x_([0-9a-f]+)"[^>]*>', re.M)
 untagged = re.compile('<para>')
 
+script_folder='/home/hg/repos/SEES-hacks/temp/'
 names = glob.glob('/home/hg/repos/SEES-hacks/temp/ch*.docbook') 
 # First pass: find the highest-numbered paragraph ID.
 
@@ -18,7 +19,7 @@
 errs = 0
 beginning="p_list= "
 
-id_file=open('p_list.py','w')
+id_file=open(script_folder+'p_list.py','w') 
 dictionary={}
 id_list=[]
 for name in names:
@@ -37,7 +38,7 @@
     global chapter   
     biggest_id += 1
      
-    id_name="%s_%x" % (chapter,biggest_id)   
+    id_name="%s_%x" % (chapter.split('/')[-1],biggest_id)   
     id_list.append(id_name)    
     
     return '<para id="%s">' %id_name
@@ -50,7 +51,7 @@
     id_list=[]    
     f = open(name).read()
     f1 = untagged.sub(retag, f )
-    dictionary[chapter]=id_list       
+    dictionary[chapter.split('/')[-1]]=id_list       
     if f1 != f:
         tmpname = name + '.tmp'
         fp = open(tmpname, 'w')
--- a/SEESenv/scripts/rst2docbook.py	Sat Feb 27 00:10:28 2010 +0530
+++ b/SEESenv/scripts/rst2docbook.py	Sun Feb 28 16:22:19 2010 +0530
@@ -120,7 +120,7 @@
             
     xml_string=ET.tostring(chapter)
     xml_string=xml_string.replace('\\',' ')    
-    xml_string=re.sub('<document[-A-Za-z=/_" .0-9]*>' ,'',xml_string)
+    xml_string=re.sub('<document[-A-Za-z=/_" .0-9:]*>' ,'',xml_string)
     xml_string=re.sub('</document>' ,'',xml_string)
 #    xml_string=re.sub('</section></section></section>' ,'</section></section>',xml_string)    
     return xml_string
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sees.hook	Sun Feb 28 16:22:19 2010 +0530
@@ -0,0 +1,13 @@
+repo="/home/hg/repos/SEES-hacks/SEESenv/scripts"
+temp_dir="/home/hg/repos/SEES-hacks"
+
+mkdir $temp_dir/temp
+python $repo/myrst2xml.py
+python $repo/rst2docbook.py
+python $repo/autoid.py
+python $repo/docbook2html.py
+python $repo/finalhtml.py
+
+cp $temp_dir/temp/*.html /home/amit/repos/SEES-hacks/SEESenv/web/html/
+cp $temp_dir/temp/p_list.py /home/amit/repos/SEES-hacks/SEESenv/web/html/
+rm -r $temp_dir
--- a/test.hook	Sat Feb 27 00:10:28 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-repo="/home/hg/repos/SEES-hacks/SEESenv/scripts"
-temp_dir="/home/hg/repos/SEES-hacks"
-
-mkdir $temp_dir/temp
-python $repo/myrst2xml.py
-python $repo/rst2docbook.py
-python $repo/autoid.py
-python $repo/docbook2html.py
-python $repo/finalhtml.py
-
-cp $temp_dir/temp/*.html /home/amit/repos/SEES-hacks/SEESenv/web/html/
-