[Saegewerk-commits] r3 - in trunk: . template

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jun 24 14:46:08 CEST 2008


Author: khruskowski
Date: 2008-06-24 14:46:07 +0200 (Tue, 24 Jun 2008)
New Revision: 3

Added:
   trunk/Makefile
Modified:
   trunk/generate_site.py
   trunk/template/buildlog_block.ctpl
Log:
Makefile implementet wich made some functions of generate_site become redundant;
changed linktext in buildlog_block template



Added: trunk/Makefile
===================================================================
--- trunk/Makefile	2008-06-23 13:08:07 UTC (rev 2)
+++ trunk/Makefile	2008-06-24 12:46:07 UTC (rev 3)
@@ -0,0 +1,41 @@
+# Makefile
+
+HTDOCS_DIR=/vol1/tmp/kalle/htdocs/
+TEMPLATE_DIR=template/
+REPORTS_DIR=/vol1/tmp/kalle/reports
+ONLINE_REPOS=khruskowski at saegewerk.wald.intevation.de
+ONLINE_REPORTS=saegewerk/htdocs/reports/
+ONLINE_HTDOCS=/saegewerk/htdocs/
+
+all: get_reports build_website
+	@echo "done."
+
+get_reports: clean_htdocs
+# get listing
+# from saegewerk server
+	cd $(REPORTS_DIR); \
+  rsync -rloDhzv --progress $(ONLINE_REPOS):$(ONLINE_REPORTS) .; \
+  tar -xjvf *.tar.bz2 -C $(HTDOCS_DIR); \
+  rm *.tar.bz2
+	@echo "got reports."
+
+build_website:
+	@echo "building website..."
+	python generate_site.py $(PWD) $(TEMPLATE_DIR) $(REPORTS_DIR) $(HTDOCS_DIR)
+# remove .svn from htdocs/img/
+	rm -Rf $(HTDOCS_DIR)img/.svn
+
+online: 
+# upload website data
+	rsync -rloDhzv --del --progress $(HTDOCS_DIR) $(ONLINE_REPOS):$(ONLINE_HTDOCS) --exclude="reports/"
+	@echo "Site online."
+
+clean_htdocs: 
+	cd $(HTDOCS_DIR); rm -Rf * 
+
+clean_reports: 
+	cd $(REPORTS_DIR); rm -Rf *
+
+clean: clean_reports clean_htdocs 
+	@echo "clean."
+

Modified: trunk/generate_site.py
===================================================================
--- trunk/generate_site.py	2008-06-23 13:08:07 UTC (rev 2)
+++ trunk/generate_site.py	2008-06-24 12:46:07 UTC (rev 3)
@@ -15,21 +15,14 @@
 
 from report_parser import ReportParser
 
-HOME_DIR = os.path.abspath('')
-REPORT_DIR = 'reports/' 
-TEMPLATE_DIR = 'template/'
-HTDOCS_DIR = 'htdocs/'
+HOME_DIR = sys.argv[1] 
+REPORT_DIR = sys.argv[3]
+TEMPLATE_DIR = sys.argv[2]
+HTDOCS_DIR =  sys.argv[4]
 ADDITIONAL_FILES = ['*.css', 'img/']
  
 # Htmlparser for buildreportfiles 
 def main():
-	# clean htdocs dir
-	if len(sys.argv) > 1 and sys.argv[1] == 'clean':
-				print 'Cleaning %s' % HTDOCS_DIR
-				shutil.rmtree(HTDOCS_DIR, 1)
-				os.mkdir(HTDOCS_DIR, 0755)
-				sys.exit(0)
-
 	# Site Frame Template & bound template variables
 	site_frame_template_namespace = { 'TITLE': '',
                                     'STYLE_TAG': '', 
@@ -39,10 +32,8 @@
 	site_frame_template = Template(open('%ssite_frame.ctpl.html' % TEMPLATE_DIR).read(), \
 																			searchList = [site_frame_template_namespace])
 
-  # TODO: Copy whole reportsdir, scan for htmlfiles, convert them, done.
-	
-	print 'Copying reports to %s' % HTDOCS_DIR
-	dir_util.copy_tree(REPORT_DIR, HTDOCS_DIR, verbose=1)
+	#print 'Copying reports to %s' % HTDOCS_DIR
+	#dir_util.copy_tree(REPORT_DIR, HTDOCS_DIR, verbose=1)
 
 	# Collect full report-dir-tree 
 	build_reports = []
@@ -86,7 +77,7 @@
 		if report.find('index.html') > -1: 
 			projects.append({'title': report_parser.get_title(), 'src': report.replace(HTDOCS_DIR, '')})
 
-	print projects
+	print 'Projects: %s' % projects
 
 	# Create saegewerks index site
 	print 'Creating Saegewerk index.html'
@@ -108,7 +99,7 @@
 		for file in glob.glob('%s%s' % (TEMPLATE_DIR, additional_file)):
 			print 'copy %s -> %s' % (file, HTDOCS_DIR)
 
-			if file[-1] == '/':
+			if file[-1] == '/' and file[0] != '.':
 				# Copy a directory
 				dest_dir = file.replace(TEMPLATE_DIR, '')
 				dir_util.copy_tree(file, '%s%s' % (HTDOCS_DIR, dest_dir), verbose=1)

Modified: trunk/template/buildlog_block.ctpl
===================================================================
--- trunk/template/buildlog_block.ctpl	2008-06-23 13:08:07 UTC (rev 2)
+++ trunk/template/buildlog_block.ctpl	2008-06-24 12:46:07 UTC (rev 3)
@@ -2,7 +2,7 @@
 #* 
 Show build reports we have
 *#
-<div style="text-align: right"><a href="http://wald.intevation.de/">...zur WALD Projektverwaltung</a></div>
+<div style="text-align: right"><a href="http://wald.intevation.de/">...to WALD source code repository</a></div>
 #if self.varExists('BUILDLOGS')
  #for $buildlog in $BUILDLOGS
 	<div style="magin:5px;border-bottom:1px solid #DDDDDD;padding:5px;font-weight:bold; font-size: 16pt">



More information about the Saegewerk-commits mailing list