Test
authoramit@thunder
Fri, 26 Feb 2010 22:39:39 +0530
changeset 31 06a02dd3966f
parent 30 f66b0a5ebf40
child 32 de7ac08f237b
Test
SEESenv/scripts/autoid.py
SEESenv/scripts/myrst2xml.py
--- a/SEESenv/scripts/autoid.py	Thu Feb 25 18:53:51 2010 +0530
+++ b/SEESenv/scripts/autoid.py	Fri Feb 26 22:39:39 2010 +0530
@@ -9,7 +9,7 @@
 tagged = re.compile('<para[^>]* id="x_([0-9a-f]+)"[^>]*>', re.M)
 untagged = re.compile('<para>')
 
-names = glob.glob('ch*.docbook') 
+names = glob.glob('/home/hg/repos/SEES-hacks/temp/ch*.docbook') 
 # First pass: find the highest-numbered paragraph ID.
 
 
--- a/SEESenv/scripts/myrst2xml.py	Thu Feb 25 18:53:51 2010 +0530
+++ b/SEESenv/scripts/myrst2xml.py	Fri Feb 26 22:39:39 2010 +0530
@@ -27,14 +27,17 @@
 def convert2xml(file_name):
     """ convert to xml using rst2xml internally """
     global chapterno    
-    file=file.split()[0]
-    name=file.split('/')[-1]
+    file_name=file_name.split()[0]
+    name=file_name.split('/')[-1]
+   
+    xml_file_temp='/'.join(file_name.split('/')[:-2])
+     
     name='ch'+str(chapterno)+name.split('.')[0]
-  
-    print file	    
-    xml_file=name+'.xml'        
-    a=open(xml_file,'w')
-    publish_file(source_path=file, destination_path=xml_file,parser_name='restructuredtext', writer_name='xml') 
+    xml_file=xml_file_temp+'/'+name+'.xml'        
+    print xml_file   
+#    a=open(xml_file,'w')
+    publish_file(source_path=file_name, destination_path=xml_file,parser_name='restructuredtext', writer_name='xml') 
+    
 def walk(repo):
     global chapterno
 #    mainfolder='/home/hg/repos/sttp/'    
@@ -42,7 +45,7 @@
         chapterno+=1		
         filename=repo+readline
         convert2xml(filename)
-
+