# HG changeset patch # User amit@thunder # Date 1267204179 -19800 # Node ID 06a02dd3966f725cf408b4d232bf784bfff51e14 # Parent f66b0a5ebf403261e8e22fcdd10eccabe1be8941 Test diff -r f66b0a5ebf40 -r 06a02dd3966f SEESenv/scripts/autoid.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(']* id="x_([0-9a-f]+)"[^>]*>', re.M) untagged = re.compile('') -names = glob.glob('ch*.docbook') +names = glob.glob('/home/hg/repos/SEES-hacks/temp/ch*.docbook') # First pass: find the highest-numbered paragraph ID. diff -r f66b0a5ebf40 -r 06a02dd3966f SEESenv/scripts/myrst2xml.py --- 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) - +