Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Commit

Permalink
Bug 524881 - Beautify nightly.mozilla.org. r=morgamic
Browse files Browse the repository at this point in the history
  • Loading branch information
sayrer committed Jan 28, 2010
1 parent 01e9dea commit 62edc99
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 7 deletions.
Binary file added firefox.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions 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;
}
26 changes: 19 additions & 7 deletions scrape.py
Expand Up @@ -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):
Expand Down Expand Up @@ -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>"""
Expand All @@ -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",
Expand All @@ -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()

0 comments on commit 62edc99

Please sign in to comment.