Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug 524881 - Beautify nightly.mozilla.org. r=morgamic

  • Loading branch information...
commit 62edc9972122ff94125fef983ebe0502430eceb8 1 parent 01e9dea
@sayrer sayrer authored
Showing with 101 additions and 7 deletions.
  1. BIN  firefox.png
  2. +82 −0 nightly.css
  3. +19 −7 scrape.py
View
BIN  firefox.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
82 nightly.css
@@ -0,0 +1,82 @@
+h1 {
+ font-size: 360%;
+ color: #fff;
+ margin: 20px 0 0 0;
+}
+
+li {
+ margin-bottom: 1em;
+}
+
+html {
+ background: url(http://www.mozilla.com/img/tignish/template/background-tile.png) repeat-x 50% -145px #fff;
+}
+
+body {
+ padding: 20px;
+ background: url(http://www.mozilla.com/img/tignish/template/background-feature.jpg) 50% -145px no-repeat;
+}
+
+ul,p,#main-feature {
+ width: 900px;
+ text-align: left;
+ margin-left: auto;
+ margin-right: auto;
+ left: 0;
+}
+
+p {
+ clear: left;
+ padding-top: 50px;
+}
+
+ul li {
+ float: left;
+ padding: 20px 50px 20px 10px;
+ background: none;
+ max-width: 210px;
+}
+
+ul li a {
+ font-weight: bold;
+ font-family: verdana, sans-serif;
+ background-position: 0 50%;
+ background-repeat: no-repeat;
+ display: block;
+ padding-left: 22px;
+ margin-bottom: 5px;
+}
+
+ul li small {display: block;
+ font-size: 65%;
+ font-family: verdana, sans-serif;
+ margin-top: 3px;
+}
+
+ul li.windows a {
+ background-image:url(http://www.mozilla.com/img/ico-win.png);
+}
+
+ul li.mac a {
+ background-image:url(http://www.mozilla.com/img/ico-osx.png);
+}
+
+ul li.linux a {
+ background-image:url(http://www.mozilla.com/img/ico-tux.png);
+}
+
+#main-feature {
+ padding: 0;
+ background: url(firefox.png) 0 0 no-repeat;
+}
+
+#main-feature p {
+ margin: 0 0 55px 0;
+ padding: 0;
+ font-size: 137%;
+}
+
+#main-feature p, #main-feature h1 {
+ margin-left: 120px;
+ width: auto;
+}
View
26 scrape.py
@@ -7,9 +7,12 @@
from optparse import OptionParser
import os
-import urllib2
-import simplejson as json
from sgmllib import SGMLParser
+import shutil
+import simplejson as json
+import urllib2
+
+path_to_this_script = os.path.realpath(__file__)
class BuildDisplay():
def __init__(self, suffix, extension, name, css_class):
@@ -79,18 +82,21 @@ def buildHTML(builds):
<html>
<head>
<title>Firefox Nightly Builds</title>
- <style>
- li { margin-bottom: 1em; }
- </style>
+ <link rel="stylesheet" type="text/css" href="http://www.mozilla.com/style/tignish/template.css" />
+ <link rel="stylesheet" type="text/css" href="http://www.mozilla.com/style/tignish/content.css" />
+ <link rel="stylesheet" type="text/css" href="nightly.css" />
</head>
<body>
- <h1>Firefox Nightly Builds</h1>
+ <div id="main-feature">
+ <h1>Firefox Nightly Builds</h1>
+ <p>These builds are for testing purposes only.</p>
+ </div>
<ul>\n"""
footer = """
</ul>
- There's <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk">more stuff</a> if you don't see what you're looking for.
+ <p>We have <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk">more stuff</a> if you don't see what you're looking for.</p>
</body>
</html>"""
@@ -115,6 +121,10 @@ def writeOutput(output_dir, filename, text):
f.write(text)
f.close()
+def copyFile(output_dir, fileName):
+ resource_path = os.path.split(path_to_this_script)[0]
+ shutil.copyfile(os.path.join(resource_path, fileName), os.path.join(output_dir, fileName))
+
def main():
optparser = OptionParser(usage=usage_example)
optparser.add_option("--output-dir", action="store", dest="output_path",
@@ -131,6 +141,8 @@ def main():
writeOutput(options.output_path, "index.html", buildHTML(parser.builds))
writeOutput(options.output_path, "index.json", buildJSON(parser.builds))
+ copyFile(options.output_path, "firefox.png")
+ copyFile(options.output_path, "nightly.css")
if __name__ == '__main__':
main()
Please sign in to comment.
Something went wrong with that request. Please try again.