diff --git a/doc/buildweb.py b/doc/buildweb.py index c86ce6f3..c3ea05e1 100755 --- a/doc/buildweb.py +++ b/doc/buildweb.py @@ -90,14 +90,14 @@ class Page(object): basename, oldext = os.path.splitext(filename) oldext = oldext.lower()[1:] - converter = getattr(self, "convert_%s" % oldext, lambda x: x) + converter = getattr(self, "convert_%s" % oldext, lambda x: (None, x)) if "insert_settings" in self.headers: body = body % {"settings": self.format_settings()} - self.body = converter(body) + self.toc, self.body = converter(body) newext = self.headers.get('ext', '.html') self.target = os.path.join(tgt_path, "%s%s" % (basename, newext)) - + def url(self): path = self.target.split(conf.OUTPUT_PATH)[1].lstrip('/') return "/".join([self.site.url, path]) @@ -126,6 +126,7 @@ class Page(object): kwargs = { "conf": conf, + "toc": self.toc, "body": self.body, "url": self.url() } @@ -139,7 +140,21 @@ class Page(object): writer_name="html", settings_overrides=overrides ) - return parts['html_body'] + lines = parts['html_body'].splitlines() + + toppos, botpos = None, None + for idx, line in enumerate(lines): + if line.find("_TOC_TOP_") >= 0: + toppos = idx + elif line.find("_TOC_BOT_") >= 0: + botpos = idx + + if toppos is None or botpos is None: + return None, parts['html_body'] + + toc = lines[toppos+1:botpos] + body = lines[:toppos] + lines[botpos+1:] + return '\n'.join(toc), '\n'.join(body) def format_settings(self): currdir = os.path.dirname(__file__) @@ -149,10 +164,10 @@ class Page(object): for i, s in enumerate(guncfg.KNOWN_SETTINGS): if i == 0 or s.section != guncfg.KNOWN_SETTINGS[i-1].section: ret.append("%s\n%s\n\n" % (s.section, "+" * len(s.section))) - ret.append(self.fmt_setting2(s)) + ret.append(self.fmt_setting(s)) return ''.join(ret) - def fmt_setting2(self, s): + def fmt_setting(self, s): if callable(s.default): val = inspect.getsource(s.default) val = "\n".join(" %s" % l for l in val.splitlines()) @@ -179,53 +194,6 @@ class Page(object): out.append("") return "\n".join(out) - def fmt_setting(self, s): - out = [] - lines = s.desc.splitlines() - width = max(map(lambda x: len(x), lines)) - - if not callable(s.default): - val = '%s' % s.default - else: - val = '' - - if s.cli and s.meta: - args = ["%s %s" % (arg, s.meta) for arg in s.cli] - cli = ', '.join(args) - elif s.cli: - cli = ", ".join(s.cli) - else: - cli = "N/A" - - width = 80 - namelen = 20 - deflen = 20 - clilen = width - (namelen + deflen + 4) - - args = ("-" * namelen, "-" * deflen, "-" * clilen) - out.append("+%s+%s+%s+" % args) - - names = "| %s" % s.name - names += " " * (namelen - (len(s.name) + 2)) - names += " | %s" % val - names += " " * (deflen - (len(val) + 2)) - names += " | %s" % cli - names += " " * (clilen - (len(cli) + 1)) - names += "|" - out.append(names) - - out.append(out[0].replace("-", "=")) - - for l in lines: - l = l.rstrip("\n") - if len(l) < width: - l += " " * ((width - 2) - len(l)) - out.append("|%s|" % l) - out.append("+%s+" % ("-" * (width - 2))) - out.extend(["", ""]) - - return "\n".join(out) - def main(): Site().render() diff --git a/doc/config.rb b/doc/config.rb index f59cfad7..a2615bbe 100644 --- a/doc/config.rb +++ b/doc/config.rb @@ -1,6 +1,8 @@ +require 'ninesixty' # Require any additional compass plugins here. # Set this to the root of your project when deployed: http_path = "/" css_dir = "htdocs/css" sass_dir = "css" images_dir = "images" +preferred_syntax = :sass diff --git a/doc/css/index.sass b/doc/css/index.sass new file mode 100644 index 00000000..c9bd8e2f --- /dev/null +++ b/doc/css/index.sass @@ -0,0 +1,74 @@ +@import 960/grid +@import 960/text + +@import compass/css3 +@import compass/layout.scss +@import compass/utilities/general +@import compass/utilities/lists + +@import compass/reset + +// Index Layout + +$ninesixty-columns: 24 + +#container.landing + +grid-container + #menu, #header, div.blurb, #tutorial, #actions, #footer + +grid-unit-base + #menu, #header, #footer + +grid-width(24) + #actions + div.blurb + +grid-width(8) + #tutorial + +grid-width(16) + ++text + +a, a:visited, a:hover, a:active + color: #569633 + text-decoration: none + +#header + margin: 46px 0px + +#menu + margin-bottom: 23px + +border-bottom-radius(10px) + background-color: #959595 + text-align: right + div.logo + float: left + margin-left: 10px + padding-top: 3px + ul + display: inline + margin-right: 10px + +no-bullets + li + display: inline + padding: 0px 3px + a + font-size: 17px + color: white + +#footer + border-top: 1px solid #959595 + padding: 10px 0px + text-align: center + color: #959595 + p + margin-bottom: 5px + +pre, tt + font-family: 'Andale Mono', 'Lucida Console', monospace + font-size: 12px + +pre + white-space: pre + background-color: #000000 + color: #00FF00 + margin: 5px + margin-bottom: 20px + padding: 5px \ No newline at end of file diff --git a/doc/css/style.sass b/doc/css/style.sass index 69fc573a..4b3965df 100644 --- a/doc/css/style.sass +++ b/doc/css/style.sass @@ -1,131 +1,89 @@ +@import 960/grid +@import 960/text + @import compass/css3 -@import compass/reset +@import compass/layout.scss @import compass/utilities/general @import compass/utilities/lists -$separator: #CCCCCC +@import compass/reset -$size_body_width: 60em -$size_toc_width: 250px +$ninesixty-columns: 24 -$color_a: #569633 -$color_bg: #F9F9F9 -$color_font: #2A2A2A -$color_footer_a: #444444 -$color_footer_border: #CCCCCC -$color_headings: #489848 -$color_headings_border: #CCCCCC -$color_menu_border: #BBBBBB -$color_menu_a: #489848 -$color_note_before: #489848 -$color_note_border: #489848 -$color_pre_bg: #FFFFDD -$color_th_border: #000000 +// Layout + +#container.twocolumn + +grid-container + #header, #menu, #footer, #toc, #content + +grid-unit-base + #header, #menu, #footer + +grid-width(24) + #toc + +grid-width(8) + #content + +grid-width(16) + +// Text + ++text body - background: $color_bg - color: $color_font - line-height: 18px - font-family: Arial, sans-serif - font-size: 100% + font-family: Helvetica, Arial, sans-serif -div.container - display: block - width: $size_body_width - margin: 0 auto +a, a:visited, a:hover, a:active + color: #569633 + text-decoration: none -#header - margin: 1em auto - text-align: center +// Style #menu - width: 100% - margin: 1em 0 1.4em 0 - border-bottom: 1px solid $color_menu_border - text-align: center + margin-bottom: 23px + +border-bottom-radius(10px) + background-color: #959595 + text-align: right + div.logo + float: left + margin-left: 10px + padding-top: 3px ul - +no-bullets display: inline + margin-right: 10px + +no-bullets li display: inline - margin-right: 15px - text-align: center + padding: 0px 3px a - font-size: 20px - font-weight: 700 - color: $color_menu_a - text-decoration: none + font-size: 17px + color: white -#contents.sidebar - float: right - border-left: 1px solid $color_menu_border - width: $size_toc_width - ul - margin-bottom: 0.2em +div.document + border-right: 1px solid #959595 + padding-right: 15px + +#toc + ul ul + list-style: disc + ul ul ul + list-style: circle p.topic-title display: none -div.section - margin-right: $size_toc_width + 20px - -div.section div.section - margin-right: 0 - -div.section ul - margin-left: 15px - +no-bullets - -h1, h2, h3, h4 - color: $color_headings - -h1 - margin-top: 10px - font-size: 26px - -h2 - border-bottom: 5px solid $color_headings_border - margin-bottom: 13px - padding-bottom: 3px - font-size: 20px - font-weight: 700 - -h3 - border-bottom: 1px solid $color_headings_border - margin-bottom: 13px - font-weight: 700 - -a - color: $color_a - text-decoration: none - -p - margin-bottom: 1em - font-size: 1em - -ol - list-style: decimal - margin-left: 2em - margin-bottom: 13px - -ul - list-style: disc - margin-left: 2em - margin-bottom: 13px - pre, tt - font-family: 'andale mono', 'lucida console', monospace + font-family: 'Andale Mono', 'Lucida Console', monospace font-size: 12px - background: $color_pre_bg pre white-space: pre - margin: 3px 3px 2em 3px - padding: 8px 20px + background-color: #000000 + color: #00FF00 + margin: 5px + margin-bottom: 20px + padding: 5px .note - border-top: 1px solid $color_note_border - border-bottom: 1px solid $color_note_border + border-top: 1px solid #569633 + border-bottom: 1px solid #569633 padding: .6em .6em .6em 80px margin-bottom: 2em position: relative @@ -133,9 +91,8 @@ pre content: "!" font-size: 60px font-weight: bold - color: $color_note_before + color: #FF0000 position: absolute - top: 30px left: 30px font-family: helvetica,arial p.admonition-title @@ -148,13 +105,9 @@ pre margin: 0 #footer - border-top: 1px solid $color_footer_border - clear: both - display: block - width: 100% - margin-top: 3em - padding-top: 1em + border-top: 1px solid #959595 + padding: 10px 0px text-align: center - font-size: 0.8em - a - color: $color_footer_a + color: #959595 + p + margin-bottom: 5px \ No newline at end of file diff --git a/doc/htdocs/configure.html b/doc/htdocs/configure.html index f8b72cc2..6df543cd 100644 --- a/doc/htdocs/configure.html +++ b/doc/htdocs/configure.html @@ -7,19 +7,19 @@ -
- +
- +
+
+
diff --git a/doc/htdocs/css/index.css b/doc/htdocs/css/index.css new file mode 100644 index 00000000..078e8381 --- /dev/null +++ b/doc/htdocs/css/index.css @@ -0,0 +1,254 @@ +/* line 14, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +/* line 17, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +body { + line-height: 1; + color: black; + background: white; +} + +/* line 19, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +ol, ul { + list-style: none; +} + +/* line 21, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +table { + border-collapse: separate; + border-spacing: 0; + vertical-align: middle; +} + +/* line 23, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +caption, th, td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} + +/* line 25, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +q, blockquote { + quotes: "" ""; +} +/* line 96, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +q:before, q:after, blockquote:before, blockquote:after { + content: ""; +} + +/* line 27, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +a img { + border: none; +} + +/* line 15, ../../css/index.sass */ +#container.landing { + margin-left: auto; + margin-right: auto; + width: 960px; +} +/* line 17, ../../css/index.sass */ +#container.landing #menu, #container.landing #header, #container.landing div.blurb, #container.landing #tutorial, #container.landing #actions, #container.landing #footer { + display: inline; + float: left; + margin-left: 10px; + margin-right: 10px; +} +/* line 19, ../../css/index.sass */ +#container.landing #menu, #container.landing #header, #container.landing #footer { + width: 940px; +} +/* line 22, ../../css/index.sass */ +#container.landing div.blurb { + width: 300px; +} +/* line 24, ../../css/index.sass */ +#container.landing #tutorial { + width: 620px; +} + +/* line 4, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +body { + font: 13px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif; +} + +/* line 6, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +a:focus { + outline: 1px dotted invert; +} + +/* line 8, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +hr { + border-color: #cccccc; + border-style: solid; + border-width: 1px 0 0; + clear: both; + height: 0; +} + +/* line 14, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +h1 { + font-size: 25px; +} + +/* line 16, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +h2 { + font-size: 23px; +} + +/* line 18, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +h3 { + font-size: 21px; +} + +/* line 20, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +h4 { + font-size: 19px; +} + +/* line 22, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +h5 { + font-size: 17px; +} + +/* line 24, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +h6 { + font-size: 15px; +} + +/* line 26, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +ol { + list-style: decimal; +} + +/* line 28, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +ul { + list-style: square; +} + +/* line 30, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +li { + margin-left: 30px; +} + +/* line 32, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +p, +dl, +hr, +h1, +h2, +h3, +h4, +h5, +h6, +ol, +ul, +pre, +table, +address, +fieldset { + margin-bottom: 20px; +} + +/* line 29, ../../css/index.sass */ +a, a:visited, a:hover, a:active { + color: #569633; + text-decoration: none; +} + +/* line 33, ../../css/index.sass */ +#header { + margin: 46px 0px; +} + +/* line 36, ../../css/index.sass */ +#menu { + margin-bottom: 23px; + -moz-border-radius-bottomleft: 10px; + -webkit-border-bottom-left-radius: 10px; + -o-border-bottom-left-radius: 10px; + -ms-border-bottom-left-radius: 10px; + -khtml-border-bottom-left-radius: 10px; + border-bottom-left-radius: 10px; + -moz-border-radius-bottomright: 10px; + -webkit-border-bottom-right-radius: 10px; + -o-border-bottom-right-radius: 10px; + -ms-border-bottom-right-radius: 10px; + -khtml-border-bottom-right-radius: 10px; + border-bottom-right-radius: 10px; + background-color: #959595; + text-align: right; +} +/* line 41, ../../css/index.sass */ +#menu div.logo { + float: left; + margin-left: 10px; + padding-top: 3px; +} +/* line 45, ../../css/index.sass */ +#menu ul { + display: inline; + margin-right: 10px; + list-style: none; +} +/* line 11, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss */ +#menu ul li { + list-style-image: none; + list-style-type: none; + margin-left: 0px; +} +/* line 49, ../../css/index.sass */ +#menu ul li { + display: inline; + padding: 0px 3px; +} +/* line 52, ../../css/index.sass */ +#menu ul li a { + font-size: 17px; + color: white; +} + +/* line 56, ../../css/index.sass */ +#footer { + border-top: 1px solid #959595; + padding: 10px 0px; + text-align: center; + color: #959595; +} +/* line 61, ../../css/index.sass */ +#footer p { + margin-bottom: 5px; +} + +/* line 64, ../../css/index.sass */ +pre, tt { + font-family: "Andale Mono", "Lucida Console", monospace; + font-size: 12px; +} + +/* line 68, ../../css/index.sass */ +pre { + white-space: pre; + background-color: black; + color: lime; + margin: 5px; + margin-bottom: 20px; + padding: 5px; +} diff --git a/doc/htdocs/css/style.css b/doc/htdocs/css/style.css index e90ffb2c..6ef65e94 100644 --- a/doc/htdocs/css/style.css +++ b/doc/htdocs/css/style.css @@ -1,4 +1,4 @@ -/* line 14, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +/* line 14, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, @@ -18,249 +18,288 @@ table, caption, tbody, tfoot, thead, tr, th, td { vertical-align: baseline; } -/* line 17, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +/* line 17, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ body { line-height: 1; color: black; background: white; } -/* line 19, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +/* line 19, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ ol, ul { list-style: none; } -/* line 21, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +/* line 21, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ table { border-collapse: separate; border-spacing: 0; vertical-align: middle; } -/* line 23, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +/* line 23, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ caption, th, td { text-align: left; font-weight: normal; vertical-align: middle; } -/* line 25, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +/* line 25, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ q, blockquote { quotes: "" ""; } -/* line 96, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +/* line 96, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ q:before, q:after, blockquote:before, blockquote:after { content: ""; } -/* line 27, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +/* line 27, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ a img { border: none; } -/* line 25, ../../css/style.sass */ +/* line 15, ../../css/style.sass */ +#container.twocolumn { + margin-left: auto; + margin-right: auto; + width: 960px; +} +/* line 17, ../../css/style.sass */ +#container.twocolumn #header, #container.twocolumn #menu, #container.twocolumn #footer, #container.twocolumn #toc, #container.twocolumn #content { + display: inline; + float: left; + margin-left: 10px; + margin-right: 10px; +} +/* line 19, ../../css/style.sass */ +#container.twocolumn #header, #container.twocolumn #menu, #container.twocolumn #footer { + width: 940px; +} +/* line 21, ../../css/style.sass */ +#container.twocolumn #toc { + width: 300px; +} +/* line 23, ../../css/style.sass */ +#container.twocolumn #content { + width: 620px; +} + +/* line 4, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ body { - background: #f9f9f9; - color: #2a2a2a; - line-height: 18px; - font-family: Arial, sans-serif; - font-size: 100%; + font: 13px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif; } -/* line 32, ../../css/style.sass */ -div.container { - display: block; - width: 60em; - margin: 0 auto; +/* line 6, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +a:focus { + outline: 1px dotted invert; } -/* line 37, ../../css/style.sass */ -#header { - margin: 1em auto; - text-align: center; +/* line 8, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +hr { + border-color: #cccccc; + border-style: solid; + border-width: 1px 0 0; + clear: both; + height: 0; } -/* line 41, ../../css/style.sass */ -#menu { - width: 100%; - margin: 1em 0 1.4em 0; - border-bottom: 1px solid #bbbbbb; - text-align: center; -} -/* line 46, ../../css/style.sass */ -#menu ul { - list-style: none; - display: inline; -} -/* line 11, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss */ -#menu ul li { - list-style-image: none; - list-style-type: none; - margin-left: 0px; -} -/* line 49, ../../css/style.sass */ -#menu ul li { - display: inline; - margin-right: 15px; - text-align: center; -} -/* line 53, ../../css/style.sass */ -#menu ul li a { - font-size: 20px; - font-weight: 700; - color: #489848; - text-decoration: none; -} - -/* line 59, ../../css/style.sass */ -#contents.sidebar { - float: right; - border-left: 1px solid #bbbbbb; - width: 250px; -} -/* line 63, ../../css/style.sass */ -#contents.sidebar ul { - margin-bottom: 0.2em; -} - -/* line 66, ../../css/style.sass */ -p.topic-title { - display: none; -} - -/* line 69, ../../css/style.sass */ -div.section { - margin-right: 270px; -} - -/* line 72, ../../css/style.sass */ -div.section div.section { - margin-right: 0; -} - -/* line 75, ../../css/style.sass */ -div.section ul { - margin-left: 15px; - list-style: none; -} -/* line 11, ../../../../../../../.gem/ruby/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss */ -div.section ul li { - list-style-image: none; - list-style-type: none; - margin-left: 0px; -} - -/* line 79, ../../css/style.sass */ -h1, h2, h3, h4 { - color: #489848; -} - -/* line 82, ../../css/style.sass */ +/* line 14, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ h1 { - margin-top: 10px; - font-size: 26px; + font-size: 25px; } -/* line 86, ../../css/style.sass */ +/* line 16, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ h2 { - border-bottom: 5px solid #cccccc; - margin-bottom: 13px; - padding-bottom: 3px; - font-size: 20px; - font-weight: 700; + font-size: 23px; } -/* line 93, ../../css/style.sass */ +/* line 18, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ h3 { - border-bottom: 1px solid #cccccc; - margin-bottom: 13px; - font-weight: 700; + font-size: 21px; } -/* line 98, ../../css/style.sass */ -a { +/* line 20, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +h4 { + font-size: 19px; +} + +/* line 22, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +h5 { + font-size: 17px; +} + +/* line 24, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +h6 { + font-size: 15px; +} + +/* line 26, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +ol { + list-style: decimal; +} + +/* line 28, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +ul { + list-style: square; +} + +/* line 30, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +li { + margin-left: 30px; +} + +/* line 32, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-960-plugin-0.9.13/stylesheets/960/_text.sass */ +p, +dl, +hr, +h1, +h2, +h3, +h4, +h5, +h6, +ol, +ul, +pre, +table, +address, +fieldset { + margin-bottom: 20px; +} + +/* line 30, ../../css/style.sass */ +body { + font-family: Helvetica, Arial, sans-serif; +} + +/* line 33, ../../css/style.sass */ +a, a:visited, a:hover, a:active { color: #569633; text-decoration: none; } -/* line 102, ../../css/style.sass */ -p { - margin-bottom: 1em; - font-size: 1em; +/* line 39, ../../css/style.sass */ +#menu { + margin-bottom: 23px; + -moz-border-radius-bottomleft: 10px; + -webkit-border-bottom-left-radius: 10px; + -o-border-bottom-left-radius: 10px; + -ms-border-bottom-left-radius: 10px; + -khtml-border-bottom-left-radius: 10px; + border-bottom-left-radius: 10px; + -moz-border-radius-bottomright: 10px; + -webkit-border-bottom-right-radius: 10px; + -o-border-bottom-right-radius: 10px; + -ms-border-bottom-right-radius: 10px; + -khtml-border-bottom-right-radius: 10px; + border-bottom-right-radius: 10px; + background-color: #959595; + text-align: right; +} +/* line 44, ../../css/style.sass */ +#menu div.logo { + float: left; + margin-left: 10px; + padding-top: 3px; +} +/* line 48, ../../css/style.sass */ +#menu ul { + display: inline; + margin-right: 10px; + list-style: none; +} +/* line 11, ../../../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.10.1/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss */ +#menu ul li { + list-style-image: none; + list-style-type: none; + margin-left: 0px; +} +/* line 52, ../../css/style.sass */ +#menu ul li { + display: inline; + padding: 0px 3px; +} +/* line 55, ../../css/style.sass */ +#menu ul li a { + font-size: 17px; + color: white; } -/* line 106, ../../css/style.sass */ -ol { - list-style: decimal; - margin-left: 2em; - margin-bottom: 13px; +/* line 59, ../../css/style.sass */ +div.document { + border-right: 1px solid #959595; + padding-right: 15px; } -/* line 111, ../../css/style.sass */ -ul { +/* line 64, ../../css/style.sass */ +#toc ul ul { list-style: disc; - margin-left: 2em; - margin-bottom: 13px; +} +/* line 66, ../../css/style.sass */ +#toc ul ul ul { + list-style: circle; } -/* line 116, ../../css/style.sass */ +/* line 69, ../../css/style.sass */ +p.topic-title { + display: none; +} + +/* line 72, ../../css/style.sass */ pre, tt { - font-family: "andale mono", "lucida console", monospace; + font-family: "Andale Mono", "Lucida Console", monospace; font-size: 12px; - background: #ffffdd; } -/* line 121, ../../css/style.sass */ +/* line 76, ../../css/style.sass */ pre { white-space: pre; - margin: 3px 3px 2em 3px; - padding: 8px 20px; + background-color: black; + color: lime; + margin: 5px; + margin-bottom: 20px; + padding: 5px; } -/* line 126, ../../css/style.sass */ +/* line 84, ../../css/style.sass */ .note { - border-top: 1px solid #489848; - border-bottom: 1px solid #489848; + border-top: 1px solid #569633; + border-bottom: 1px solid #569633; padding: 0.6em 0.6em 0.6em 80px; margin-bottom: 2em; position: relative; } -/* line 132, ../../css/style.sass */ +/* line 90, ../../css/style.sass */ .note p.admonition-title:before { content: "!"; font-size: 60px; font-weight: bold; - color: #489848; + color: red; position: absolute; - top: 30px; left: 30px; font-family: helvetica, arial; } -/* line 141, ../../css/style.sass */ +/* line 98, ../../css/style.sass */ .note p.admonition-title { font-weight: 700; margin: 0; margin-bottom: 4px; padding: 0; } -/* line 146, ../../css/style.sass */ +/* line 103, ../../css/style.sass */ .note p.last { padding: 0; margin: 0; } -/* line 150, ../../css/style.sass */ +/* line 107, ../../css/style.sass */ #footer { - border-top: 1px solid #cccccc; - clear: both; - display: block; - width: 100%; - margin-top: 3em; - padding-top: 1em; + border-top: 1px solid #959595; + padding: 10px 0px; text-align: center; - font-size: 0.8em; + color: #959595; } -/* line 159, ../../css/style.sass */ -#footer a { - color: #444444; +/* line 112, ../../css/style.sass */ +#footer p { + margin-bottom: 5px; } diff --git a/doc/htdocs/deploy.html b/doc/htdocs/deploy.html index 13dad92b..55e73d77 100644 --- a/doc/htdocs/deploy.html +++ b/doc/htdocs/deploy.html @@ -7,19 +7,19 @@ -
- +
-

Nginx Configuration

Although there are many HTTP proxies available, we strongly advise that you @@ -173,7 +161,7 @@ exec $GUNICORN -C $ROOT/gunicorn.conf.py --pidfile=$PID $APP simple configuration is:

 [program:gunicorn]
-command=/usr/local/bin/gunicorn main:application -c /path/to/project/gunicorn.conf.py
+command=/path/to/gunicorn main:application -c /path/to/gunicorn.conf.py
 directory=/path/to/project
 user=nobody
 autostart=true
@@ -183,10 +171,23 @@ redirect_stderr=True
 
- +
+
+
diff --git a/doc/htdocs/design.html b/doc/htdocs/design.html index 36b0e543..781ce81e 100644 --- a/doc/htdocs/design.html +++ b/doc/htdocs/design.html @@ -7,19 +7,19 @@ -
- +
-

Server Model

Gunicorn is based on the pre-fork worker model. This means that there is a @@ -120,10 +106,25 @@ worker processes will start thrashing system resources decreasing the throughput of the entire system.

- +
+
diff --git a/doc/htdocs/faq.html b/doc/htdocs/faq.html index 3903f077..5a70aa05 100644 --- a/doc/htdocs/faq.html +++ b/doc/htdocs/faq.html @@ -7,19 +7,19 @@ -
- +
-
-

Questions

+
+

WSGI Bits

+
+

How do I set SCRIPT_NAME?

+

By default SCRIPT_NAME is an empy string. The value could be set by +setting SCRIPT_NAME in the environment or as an HTTP header.

+
+
+
+

Server Stuff

+
+

How do I reload my application in Gunicorn?

+

You can gracefully reload by sending HUP signal to gunicorn:

+
+$ kill -HUP masterpid
+
+
+
+

How might I test a proxy configuration?

+

The Slowloris script is a great way to test that your proxy is correctly +buffering responses for the synchronous workers.

+
+
+

How can I name processes?

+

If you install the Python package setproctitle Gunicorn will set the process +names to something a bit more meaningful. This will affect the output you see +in tools like ps and top. This helps for distinguishing the master +process as well as between masters when running more than one app on a single +machine. See the proc_name setting for more information.

+
+
+
+

Worker Processes

+
+

How do I know which type of worker to use?

+

Read the design page for help on the various worker types.

+
+
+

What types of workers are there?

+

Check out the configuration docs for worker_class

+
+ +
+

How can I change the number of workers dynamically?

+
+

To increase the worker count by one:

+
+$ kill -TTIN $masterpid
+
+

To decrease the worker count by one:

+
+$ kill -TTOU $masterpid
+
+
+
+
+
+

Kernel Parameters

+

When dealing with large numbers of concurrent connections there are a handful of +kernel parameters that you might need to adjust. Generally these should only +affect sites with a very large concurrent load. These parameters are not +specific to Gunicorn, they would apply to any sort of network server you may be +running.

+

These commands are for Linux. Your particular OS may have slightly different +parameters.

+
+

How can I increase the maximum number of file descriptors?

+

One of the first settings that usually needs to be bumped is the maximum number +of open file descriptors for a given process. For the confused out there, +remember that Unices treat sockets as files.

+
+$ sudo ulimit -n 2048
+
+
+
+

How can I increase the maximum socket backlog?

+

Listening sockets have an associated queue of incoming connections that are +waiting to be accepted. If you happen to have a stampede of clients that fill up +this queue new connections will eventually start getting dropped.

+
+$ sudo sysctl -w net.core.somaxconn="2048"
+
+
+
+
+
+
+
+

Contents

-
-

WSGI Bits

-
-

How do I set SCRIPT_NAME?

-

By default SCRIPT_NAME is an empy string. The value could be set by -setting SCRIPT_NAME in the environment or as an HTTP header.

-
-
-
-

Server Stuff

-
-

How do I reload my application in Gunicorn?

-

You can gracefully reload by sending HUP signal to gunicorn:

-
-$ kill -HUP masterpid
-
-
-
-

How might I test a proxy configuration?

-

The Slowloris script is a great way to test that your proxy is correctly -buffering responses for the synchronous workers.

-
-
-

How can I name processes?

-

If you install the Python package setproctitle Gunicorn will set the process -names to something a bit more meaningful. This will affect the output you see -in tools like ps and top. This helps for distinguishing the master -process as well as between masters when running more than one app on a single -machine. See the proc_name setting for more information.

-
-
-
-

Worker Processes

-
-

How do I know which type of worker to use?

-

Read the design page for help on the various worker types.

-
-
-

What types of workers are there?

-

Check out the configuration docs for worker_class

-
- -
-

How can I change the number of workers dynamically?

-
-

To increase the worker count by one:

-
-$ kill -TTIN $masterpid
-
-

To decrease the worker count by one:

-
-$ kill -TTOU $masterpid
-
-
-
-
-
-

Kernel Parameters

-

When dealing with large numbers of concurrent connections there are a handful of -kernel parameters that you might need to adjust. Generally these should only -affect sites with a very large concurrent load. These parameters are not -specific to Gunicorn, they would apply to any sort of network server you may be -running.

-

These commands are for Linux. Your particular OS may have slightly different -parameters.

-
-

How can I increase the maximum number of file descriptors?

-

One of the first settings that usually needs to be bumped is the maximum number -of open file descriptors for a given process. For the confused out there, -remember that Unices treat sockets as files.

-
-$ sudo ulimit -n 2048
-
-
-
-

How can I increase the maximum socket backlog?

-

Listening sockets have an associated queue of incoming connections that are -waiting to be accepted. If you happen to have a stampede of clients that fill up -this queue new connections will eventually start getting dropped.

-
-$ sudo sysctl -w net.core.somaxconn="2048"
-
-
-
-
-
diff --git a/doc/htdocs/images/gunicorn.png b/doc/htdocs/images/gunicorn.png new file mode 100644 index 00000000..940db547 Binary files /dev/null and b/doc/htdocs/images/gunicorn.png differ diff --git a/doc/htdocs/images/large_gunicorn.png b/doc/htdocs/images/large_gunicorn.png new file mode 100644 index 00000000..b1c9c8b5 Binary files /dev/null and b/doc/htdocs/images/large_gunicorn.png differ diff --git a/doc/htdocs/index.html b/doc/htdocs/index.html index bb93598b..5b890248 100644 --- a/doc/htdocs/index.html +++ b/doc/htdocs/index.html @@ -4,74 +4,92 @@ Green Unicorn - Welcome - + -
- +
-
-
-
-

Green Unicorn

-

Gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX. It's a pre-fork -worker model ported from Ruby's Unicorn project. The Gunicorn server is -broadly compatible with various web frameworks, simply implemented, light -on server resource usage, and fairly speedy.

-

Feel free to join us in #gunicorn on freenode.

-

Gunicorn is released under the MIT License. See the LICENSE for more details.

-
-
-

Features

-
    -
  • Designed for Unix.
  • -
  • Compatible with Python 2.x (>= 2.5)
  • -
  • Easy integration with Django and Paster applications -(Pylons, TurboGears 2, ...)
  • -
  • Process management: Gunicorn reaps and restarts workers that die.
  • -
  • Load balancing via pre-fork and a shared socket
  • -
  • Graceful worker process restarts
  • -
  • Upgrade "àla nginx" without losing connections
  • -
  • Simple and easy Python configuration
  • -
  • Decode chunked transfers on-the-fly, allowing upload progress notifications -or stream-based protocols over HTTP
  • -
  • Support for Eventlet and Gevent .
  • -
  • Post- and pre-fork hooks
  • -
-
-
-

Applications

- -
-
- + +
+

Quick Start

+
+$ sudo easy_install virtualenv
+$ mkdir ~/environments/
+$ virtualenv ~/environments/tutorial/
+$ cd ~/environments/tutorial/
+$ ls
+bin  include  lib
+$ source bin/activate
+(tutorial) $ clear
+(tutorial) $ ./bin/easy_install gunicorn
+(tutorial) $ mkdir myapp
+(tutorial) $ cd myapp/
+(tutorial) $ vi myapp.py
+(tutorial) $ cat myapp.py 
+
+def app(environ, start_response):
+    data = "Hello, World!\n"
+    start_response("200 OK", [
+        ("Content-Type", "text/plain"),
+        ("Content-Length", str(len(data)))
+    ])
+    return iter([data])
+
+(tutorial) $ ../bin/gunicorn -w 4 myapp:app
+2010-06-05 23:27:07 [16800] [INFO] Arbiter booted
+2010-06-05 23:27:07 [16800] [INFO] Listening at: http://127.0.0.1:8000
+2010-06-05 23:27:07 [16801] [INFO] Worker spawned (pid: 16801)
+2010-06-05 23:27:07 [16802] [INFO] Worker spawned (pid: 16802)
+2010-06-05 23:27:07 [16803] [INFO] Worker spawned (pid: 16803)
+2010-06-05 23:27:07 [16804] [INFO] Worker spawned (pid: 16804)
+
+
+
+

About

+

+ Gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX. It's a + pre-fork worker model ported from Ruby's Unicorn project. The + Gunicorn server is broadly compatible with various web frameworks, + simply implemented, light on server resources, and fairly speedy. +

+
+
+

Features

+
    +
  • Natively supports WSGI, Django, and Paster
  • +
  • Automatic worker process management
  • +
  • Simple Python configuration
  • +
  • Multiple worker configurations
  • +
  • Various server hooks for extensibility
  • +
  • Compatible with Python 2.x >= 2.5
  • +
+
+
+

Version 0.9.1 - 2010-05-26

+
    +
  • Support https via X-Forwarded-Protocol or X-Forwarded-Ssl headers
  • +
  • Remove -d command line to avoid confusion with -D
  • +
  • Fixed a minor configuration bug
  • +
  • Fixed umask for Unix sockets
  • +
+
- \ No newline at end of file + diff --git a/doc/htdocs/install.html b/doc/htdocs/install.html index 968d331f..4c93e962 100644 --- a/doc/htdocs/install.html +++ b/doc/htdocs/install.html @@ -7,19 +7,19 @@ -
- +
-

Requirements

    @@ -138,10 +124,25 @@ deb-src http://ppa.launchpad.net/bchesneau/gunicorn/ubuntu karmic main
- +
+
diff --git a/doc/htdocs/news.html b/doc/htdocs/news.html index 45fb2338..8f57c9c4 100644 --- a/doc/htdocs/news.html +++ b/doc/htdocs/news.html @@ -7,19 +7,19 @@ -
- +
diff --git a/doc/htdocs/run.html b/doc/htdocs/run.html index f5046b8d..885df716 100644 --- a/doc/htdocs/run.html +++ b/doc/htdocs/run.html @@ -7,19 +7,19 @@ -
- +
-

Commands

After installing Gunicorn you will have access to three command line scripts @@ -154,10 +138,27 @@ $ paster serve development.ini workers=2

- +
+
diff --git a/doc/site/configure.rst b/doc/site/configure.rst index 9eccd786..adb13bb9 100644 --- a/doc/site/configure.rst +++ b/doc/site/configure.rst @@ -2,10 +2,13 @@ template: doc.html title: Configure insert_settings: true +_TOC_TOP_ + .. contents:: - :class: sidebar :backlinks: top +_TOC_BOT_ + Overview -------- diff --git a/doc/site/deploy.rst b/doc/site/deploy.rst index 888b25e7..e46338be 100644 --- a/doc/site/deploy.rst +++ b/doc/site/deploy.rst @@ -1,10 +1,13 @@ template: doc.html title: Deploy +_TOC_TOP_ + .. contents:: - :class: sidebar :backlinks: top +_TOC_BOT_ + Nginx Configuration ------------------- @@ -145,7 +148,7 @@ Another useful tool to monitor and control Gunicorn is Supervisor_. A `simple configuration`_ is:: [program:gunicorn] - command=/usr/local/bin/gunicorn main:application -c /path/to/project/gunicorn.conf.py + command=/path/to/gunicorn main:application -c /path/to/gunicorn.conf.py directory=/path/to/project user=nobody autostart=true diff --git a/doc/site/design.rst b/doc/site/design.rst index de157147..777c97a2 100644 --- a/doc/site/design.rst +++ b/doc/site/design.rst @@ -1,10 +1,13 @@ template: doc.html title: Design +_TOC_TOP_ + .. contents:: - :class: sidebar :backlinks: top +_TOC_BOT_ + Server Model ============ diff --git a/doc/site/faq.rst b/doc/site/faq.rst index b9c71576..08fd8366 100644 --- a/doc/site/faq.rst +++ b/doc/site/faq.rst @@ -1,9 +1,13 @@ template: doc.html title: FAQ -.. contents:: Questions +_TOC_TOP_ + +.. contents:: :backlinks: top +_TOC_BOT_ + WSGI Bits ========= diff --git a/doc/site/index.rst b/doc/site/index.rst deleted file mode 100644 index a551c284..00000000 --- a/doc/site/index.rst +++ /dev/null @@ -1,57 +0,0 @@ -template: index.html -title: Welcome - -Green Unicorn -------------- - -Gunicorn 'Green Unicorn' is a WSGI_ HTTP Server for UNIX. It's a pre-fork -worker model ported from Ruby's Unicorn_ project. The Gunicorn server is -broadly compatible with various web frameworks, simply implemented, light -on server resource usage, and fairly speedy. - -Feel free to join us in `#gunicorn`_ on freenode_. - -Gunicorn is released under the MIT License. See the LICENSE_ for more details. - -Features --------- - -- Designed for Unix. -- Compatible with Python 2.x (>= 2.5) -- Easy integration with Django_ and Paster_ applications - (`Pylons`_, `TurboGears 2`_, ...) -- Process management: Gunicorn_ reaps and restarts workers that die. -- Load balancing via pre-fork and a shared socket -- Graceful worker process restarts -- Upgrade "àla nginx" without losing connections -- Simple and easy Python configuration -- Decode chunked transfers on-the-fly, allowing upload progress notifications - or stream-based protocols over HTTP -- Support for `Eventlet`_ and `Gevent`_ . -- Post- and pre-fork hooks - -Applications ------------- - -* Any WSGI_, Django_ and Paster_ compatible applications - (`Pylons`_, `TurboGears 2`_, ...) -* Websockets (see the example_ or the screencast_) -* Reverse proxy implementation (with `Restkit WSGI proxy`_) -* Long Polling -* Comet - -.. _WSGI: http://www.python.org/dev/peps/pep-0333/ -.. _Unicorn: http://unicorn.bogomips.org/ -.. _`#gunicorn`: http://webchat.freenode.net/?channels=gunicorn -.. _freenode: http://freenode.net -.. _LICENSE: http://github.com/benoitc/gunicorn/blob/master/LICENSE -.. _Gunicorn: http://gunicorn.org -.. _Django: http://djangoproject.com -.. _Paster: http://pythonpaste.org/ -.. _Eventlet: http://eventlet.net -.. _Gevent: http://gevent.org -.. _Pylons: http://pylonshq.com/ -.. _Turbogears 2: http://turbogears.org/2.0/ -.. _example: http://github.com/benoitc/gunicorn/blob/master/examples/websocket.py -.. _`Restkit WSGI proxy`: http://benoitc.github.com/restkit/wsgi_proxy.html -.. _screencast: http://vimeo.com/10461162 diff --git a/doc/site/install.rst b/doc/site/install.rst index c14650a4..e71639ef 100644 --- a/doc/site/install.rst +++ b/doc/site/install.rst @@ -1,10 +1,13 @@ template: doc.html title: Install +_TOC_TOP_ + .. contents:: - :class: sidebar :backlinks: top +_TOC_BOT_ + Requirements ------------ diff --git a/doc/site/news.rst b/doc/site/news.rst index ecbdb937..dfdb2708 100644 --- a/doc/site/news.rst +++ b/doc/site/news.rst @@ -1,6 +1,13 @@ template: doc.html title: News +_TOC_TOP_ + +.. contents:: + :backlinks: top + +_TOC_BOT_ + 0.9.1 / 2010-05-26 ------------------ diff --git a/doc/site/run.rst b/doc/site/run.rst index 248f5209..cec9fb3a 100644 --- a/doc/site/run.rst +++ b/doc/site/run.rst @@ -1,10 +1,13 @@ template: doc.html title: Run +_TOC_TOP_ + .. contents:: - :class: sidebar :backlinks: top +_TOC_BOT_ + Commands -------- diff --git a/doc/sitemap_gen.py b/doc/sitemap_gen.py index cbcfd6f5..f4f28e10 100755 --- a/doc/sitemap_gen.py +++ b/doc/sitemap_gen.py @@ -62,7 +62,7 @@ if sys.hexversion < 0x02020000: import fnmatch import glob import gzip -import md5 +import hashlib import os import re import stat @@ -388,7 +388,7 @@ class Output: """ Output and count a warning. Suppress duplicate warnings. """ if text: text = encoder.NarrowText(text, None) - hash = md5.new(text).digest() + hash = hashlib.md5(text).hexdigest() if not self._warns_shown.has_key(hash): self._warns_shown[hash] = 1 print '[WARNING] ' + text @@ -401,7 +401,7 @@ class Output: """ Output and count an error. Suppress duplicate errors. """ if text: text = encoder.NarrowText(text, None) - hash = md5.new(text).digest() + hash = hashlib.md5(text).hexdigest() if not self._errors_shown.has_key(hash): self._errors_shown[hash] = 1 print '[ERROR] ' + text @@ -604,8 +604,8 @@ class URL(object): if not self.loc: return None if self.loc.endswith('/'): - return md5.new(self.loc[:-1]).digest() - return md5.new(self.loc).digest() + return hashlib.md5(self.loc[:-1]).hexdigest() + return hashlib.md5(self.loc).hexdigest() #end def MakeHash def Log(self, prefix='URL', level=3): diff --git a/doc/templates/base.html b/doc/templates/base.html index 7182a8a0..966ada46 100644 --- a/doc/templates/base.html +++ b/doc/templates/base.html @@ -7,19 +7,19 @@ -
- +
diff --git a/doc/templates/doc.html b/doc/templates/doc.html index 67752fe0..a55ef97f 100644 --- a/doc/templates/doc.html +++ b/doc/templates/doc.html @@ -1,4 +1,6 @@ {% extends "base.html" %} {% block title %}{{ title }}{% endblock %} +{% if toc %} {% block toc %}{{ toc }}{% endblock %} +{% endif %} {% block body %}{{ body }}{% endblock %} \ No newline at end of file diff --git a/doc/templates/index.html b/doc/templates/index.html index 8e9f3682..26a43ebb 100644 --- a/doc/templates/index.html +++ b/doc/templates/index.html @@ -1,2 +1,23 @@ -{% extends "base.html" %} -{% block body %}{{ body }}{% endblock %} \ No newline at end of file + + + + + Green Unicorn - {% block title %}Welcome{% endblock %} + + + + +
+ +
+ {% block body %}{% endblock %} +
+ +
+ + \ No newline at end of file