Changed paths dependent on repo location to be taken from the script also changed how the soup is printed
authoramit@thunder
Tue, 02 Mar 2010 17:07:14 +0530
changeset 41 e54725be4df6
parent 40 ef147a79b098
child 42 1f61ee485958
Changed paths dependent on repo location to be taken from the script also changed how the soup is printed
SEESenv/scripts/changenames.py
SEESenv/scripts/docbook2html.py
SEESenv/scripts/finalhtml.py
SEESenv/scripts/myrst2xml.py
SEESenv/scripts/rst2docbook.py
sees.hook
--- a/SEESenv/scripts/changenames.py	Mon Mar 01 15:23:42 2010 +0530
+++ b/SEESenv/scripts/changenames.py	Tue Mar 02 17:07:14 2010 +0530
@@ -2,10 +2,12 @@
 import subprocess
 import re
 import time
-
-names= glob.glob('/home/hg/repos/SEES-hacks/temp/ch1*.html')
+import os
+import sys
+repo=sys.argv[1]
+names= glob.glob(os.path.join(repo,'ch1*.html'))
 for name in names:
-    reg_obj=re.compile('/home/hg/repos/SEES-hacks/temp/ch1[0-9].*.html')
+    reg_obj=re.compile(os.path.join(repo,'ch1[0-9].*.html'))
     if (reg_obj.match(name)):
         changed_name=re.sub('ch1','chn1',name)
     else:
--- a/SEESenv/scripts/docbook2html.py	Mon Mar 01 15:23:42 2010 +0530
+++ b/SEESenv/scripts/docbook2html.py	Tue Mar 02 17:07:14 2010 +0530
@@ -1,8 +1,12 @@
 import glob, os, re, sys
 import subprocess
 import time
+import sys
+repo=sys.argv[1]
+
 xsl_loc='/home/hg/repos/SEES-hacks/SEESenv/scripts/'
-names = glob.glob('/home/hg/repos/SEES-hacks/temp/ch*.docbook')
+
+names = glob.glob(os.path.join(repo,'ch*.docbook'))
 for name in names:
 #   command="xsltproc html-single.xsl %s > %s.html" %(name ,name.split('.')[0])    
     command="xsltproc %shtml-single.xsl %s > %s.html" %(xsl_loc, name ,name.split('.')[0])
--- a/SEESenv/scripts/finalhtml.py	Mon Mar 01 15:23:42 2010 +0530
+++ b/SEESenv/scripts/finalhtml.py	Tue Mar 02 17:07:14 2010 +0530
@@ -4,7 +4,8 @@
 import os
 from BeautifulSoup import BeautifulSoup
 import time
-temp_dir='/home/hg/repos/SEES-hacks/temp/'
+import sys
+repo='/home/hg/repos/SEES-hacks/temp/'
 
 
 def finalchanges(file_name,html_string):
@@ -30,7 +31,7 @@
     return soup
 
 if __name__=='__main__':
-	file_names=glob.glob(temp_dir+'ch*.html')
+	file_names=glob.glob(os.path.join(repo,'ch*.html'))
 	for file_name in file_names:
             file_obj=open(file_name,'r')
             soup=finalchanges(file_name,file_obj.read())
--- a/SEESenv/scripts/myrst2xml.py	Mon Mar 01 15:23:42 2010 +0530
+++ b/SEESenv/scripts/myrst2xml.py	Tue Mar 02 17:07:14 2010 +0530
@@ -14,6 +14,7 @@
 import time
 from docutils.core import publish_file 
 import os
+import sys
 chapterno=0
 tmp_folder="/home/hg/repos/SEES-hacks/temp/"
 
@@ -53,7 +54,7 @@
 
 
 if __name__=='__main__':
-    repo='/home/hg/repos/sttp/'
+    repo=sys.argv[1]
     walk(repo)
 #    convert(1,2,3)
 
--- a/SEESenv/scripts/rst2docbook.py	Mon Mar 01 15:23:42 2010 +0530
+++ b/SEESenv/scripts/rst2docbook.py	Tue Mar 02 17:07:14 2010 +0530
@@ -13,7 +13,8 @@
 import os
 import pkg_resources
 import glob, os, re, sys
-names = glob.glob('/home/hg/repos/SEES-hacks/temp/ch*.xml')
+repo=sys.argv[1]
+names = glob.glob(os.path.join(repo , 'ch*.xml'))
 """
 chapterno=0
 
--- a/sees.hook	Mon Mar 01 15:23:42 2010 +0530
+++ b/sees.hook	Tue Mar 02 17:07:14 2010 +0530
@@ -1,12 +1,13 @@
-repo="/home/hg/repos/SEES-hacks/SEESenv/scripts"
+repo_scripts="/home/hg/repos/SEES-hacks/SEESenv/scripts"
 temp_dir="/home/hg/repos/SEES-hacks"
+repo="/home/hg/repos/test/sttp/"
+mkdir $temp_dir/temp 
+python $repo_scripts/myrst2xml.py $repo
+python $repo_scripts/rst2docbook.py $temp_dir/temp 
+python $repo_scripts/autoid.py $temp_dir/temp 
+python $repo_scripts/docbook2html.py $temp_dir/temp 
+python $repo_scripts/finalhtml.py $temp_dir/temp 
+python $repo_scripts/changenames.py $temp_dir/temp 
+cp $temp_dir/temp/*.html /home/hg/repos/SEES-hacks/SEESenv/web/html/
+cp $temp_dir/temp/p_list.py /home/hg/repos/SEES-hacks/SEESenv/web/hgbook/comments/
 
-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/hgbook/comments/
-