equal
deleted
inserted
replaced
25 |
25 |
26 |
26 |
27 def convert2xml(file_name): |
27 def convert2xml(file_name): |
28 """ convert to xml using rst2xml internally """ |
28 """ convert to xml using rst2xml internally """ |
29 global chapterno |
29 global chapterno |
30 file=file.split()[0] |
30 file_name=file_name.split()[0] |
31 name=file.split('/')[-1] |
31 name=file_name.split('/')[-1] |
|
32 |
|
33 xml_file_temp='/'.join(file_name.split('/')[:-2]) |
|
34 |
32 name='ch'+str(chapterno)+name.split('.')[0] |
35 name='ch'+str(chapterno)+name.split('.')[0] |
33 |
36 xml_file=xml_file_temp+'/'+name+'.xml' |
34 print file |
37 print xml_file |
35 xml_file=name+'.xml' |
38 # a=open(xml_file,'w') |
36 a=open(xml_file,'w') |
39 publish_file(source_path=file_name, destination_path=xml_file,parser_name='restructuredtext', writer_name='xml') |
37 publish_file(source_path=file, destination_path=xml_file,parser_name='restructuredtext', writer_name='xml') |
40 |
38 def walk(repo): |
41 def walk(repo): |
39 global chapterno |
42 global chapterno |
40 # mainfolder='/home/hg/repos/sttp/' |
43 # mainfolder='/home/hg/repos/sttp/' |
41 for readline in open('index.config','r').readlines(): |
44 for readline in open('index.config','r').readlines(): |
42 chapterno+=1 |
45 chapterno+=1 |
43 filename=repo+readline |
46 filename=repo+readline |
44 convert2xml(filename) |
47 convert2xml(filename) |
45 |
48 |
46 |
49 |
47 |
50 |
48 |
51 |
49 |
52 |
50 if __name__=='__main__': |
53 if __name__=='__main__': |