pld-builder.new: PLD_Builder/bqueue.py, PLD_Builder/request_handler_server....

glen glen at pld-linux.org
Sat May 8 20:23:05 CEST 2010


Author: glen                         Date: Sat May  8 18:23:05 2010 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
- add styles to page (minified version of www.pld-linux.org styles)

---- Files affected:
pld-builder.new/PLD_Builder:
   bqueue.py (1.15 -> 1.16) , request_handler_server.py (1.13 -> 1.14) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/bqueue.py
diff -u pld-builder.new/PLD_Builder/bqueue.py:1.15 pld-builder.new/PLD_Builder/bqueue.py:1.16
--- pld-builder.new/PLD_Builder/bqueue.py:1.15	Fri May  7 08:40:56 2010
+++ pld-builder.new/PLD_Builder/bqueue.py	Sat May  8 20:23:00 2010
@@ -28,12 +28,14 @@
     
     def dump_html(self, f):
         f.write("""
-        <html>
-            <head>
-            <link rel="Shortcut Icon" href="http://www.pld-linux.org/favicon.ico"/>
-            <title>PLD builder queue</title>
-            </head>
-        <body>\n""")
+<html>
+    <head>
+    <link rel="Shortcut Icon" href="http://www.pld-linux.org/favicon.ico"/>
+        <title>PLD builder queue</title>
+        <link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="style.css">
+    </head>
+<body>\n"""
+        )
         self.requests.reverse()
         for r in self.requests:
             r.dump_html(f)

================================================================
Index: pld-builder.new/PLD_Builder/request_handler_server.py
diff -u pld-builder.new/PLD_Builder/request_handler_server.py:1.13 pld-builder.new/PLD_Builder/request_handler_server.py:1.14
--- pld-builder.new/PLD_Builder/request_handler_server.py:1.13	Mon May 25 17:58:07 2009
+++ pld-builder.new/PLD_Builder/request_handler_server.py	Sat May  8 20:23:00 2010
@@ -7,12 +7,13 @@
 import log
 import sys
 import traceback
+import os
 from config import config, init_conf
 
-from os import curdir, sep
 from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
 
 import request_handler
+import path
 
 class MyHandler(BaseHTTPRequestHandler):
 
@@ -51,7 +52,59 @@
 			raise
 			pass
 
+def write_css():
+	css_file = path.www_dir + "/style.css"
+	if os.path.exists(css_file):
+		return
+
+	# css from www.pld-linux.org wiki theme, using css usage firebug plugin to cleanup
+	css = """
+html {
+	background-color: white;
+	color: #5e5e5e;
+	font-family: Tahoma, Arial, Lucida Grande, sans-serif;
+	font-size: 0.75em;
+	line-height: 1.25em;
+}
+
+a {
+	text-decoration: underline;
+	color: #00f;
+}
+
+a:hover {
+	color: #00c;
+}
+
+ at media screen, projection {
+	html {
+		background-color: #f3efe3;
+	}
+
+	body {
+		position: relative;
+	}
+}
+ at media print {
+	a {
+		background-color: inherit;
+		color: inherit;
+	}
+}
+
+ at media projection {
+	html { line-height: 1.8em; }
+	body, b, a, p { font-size: 22pt; }
+}
+"""
+	old_umask = os.umask(0022)
+	f = open(css_file, "w")
+	f.write(css)
+	f.close()
+	os.umask(old_umask)
+
 def main():
+	write_css();
 	socket.setdefaulttimeout(30)
 	try:
 		init_conf()
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/bqueue.py?r1=1.15&r2=1.16&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/request_handler_server.py?r1=1.13&r2=1.14&f=u



More information about the pld-cvs-commit mailing list