1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

Bumped python version in doc

This commit is contained in:
sametmax 2015-05-10 19:53:55 +02:00
parent bfde901a46
commit b87a0db3a4
64 changed files with 12362 additions and 11214 deletions

View File

@ -22,7 +22,7 @@ but in short::
pip install zerobin
zerobin
For now, 0bin targets Python 2.7 only. Python 3 supports is planned.
0bin runs on Python 2.7 and Python 3.4.
How it works
=============

Binary file not shown.

View File

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: da73410994192a33f4631d2ef9f7f005
tags: fbb0d17656682115ca4d033fb2f83ba1
config: b6ae59e2f6e05e37e1e019164ebb6189
tags: 645f666f9bcd5a90fca523b33c5a78b7

View File

@ -17,7 +17,7 @@ Just type::
30 seconds setup (for anybody)
===============================
- Make sure you have Python 2.6 or 2.7 (`python --version`)
- Make sure you have Python 2.7 or 3.4+ (`python --version`)
- Download the last `zip of the source code <https://github.com/sametmax/0bin/zipball/master>`_
- Extract all of it where you wish the site to be stored.
- Go to the extracted files.
@ -59,4 +59,4 @@ Or run it in a screen.
0bin will now be accessible from http://your.local.ip.address:8000.
This can be very cool way to share code in a companie or during a code sprint.
This can be very cool way to share code in a companie or during a code sprint.

View File

@ -18,7 +18,7 @@ Entrez::
Installation en 30 secondes (pour tous)
=======================================
- Assurez-vous d'avoir Python 2.6 ou 2.7 (`python --version`)
- Assurez-vous d'avoir Python 2.7 ou 3.4+ (`python --version`)
- Télécharger le dernier `zip du code source <https://github.com/sametmax/0bin/zipball/master>`_.
- Décompressez tous les fichiers là où vous souhaitez mettre le site.
- Allez dans les dossiers extraits.

View File

@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -89,6 +89,7 @@ div.sphinxsidebar #searchbox input[type="submit"] {
img {
border: 0;
max-width: 100%;
}
/* -- search page ----------------------------------------------------------- */
@ -196,7 +197,10 @@ h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink {
dt:hover > a.headerlink,
caption:hover > a.headerlink,
p.caption:hover > a.headerlink,
div.code-block-caption:hover > a.headerlink {
visibility: visible;
}
@ -313,6 +317,13 @@ table.docutils {
border-collapse: collapse;
}
table caption span.caption-number {
font-style: italic;
}
table caption span.caption-text {
}
table.docutils td, table.docutils th {
padding: 1px 8px 1px 5px;
border-top: 0;
@ -343,6 +354,25 @@ table.citation td {
border-bottom: none;
}
/* -- figures --------------------------------------------------------------- */
div.figure {
margin: 0.5em;
padding: 0.5em;
}
div.figure p.caption {
padding: 0.3em;
}
div.figure p.caption span.caption-number {
font-style: italic;
}
div.figure p.caption span.caption-text {
}
/* -- other body styles ----------------------------------------------------- */
ol.arabic {
@ -401,14 +431,14 @@ dl.glossary dt {
margin: 0;
}
.refcount {
color: #060;
}
.optional {
font-size: 1.3em;
}
.sig-paren {
font-size: larger;
}
.versionmodified {
font-style: italic;
}
@ -474,22 +504,51 @@ table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}
tt.descname {
div.code-block-caption {
padding: 2px 5px;
font-size: small;
}
div.code-block-caption code {
background-color: transparent;
}
div.code-block-caption + div > div.highlight > pre {
margin-top: 0;
}
div.code-block-caption span.caption-number {
padding: 0.1em 0.3em;
font-style: italic;
}
div.code-block-caption span.caption-text {
}
div.literal-block-wrapper {
padding: 1em 1em 0;
}
div.literal-block-wrapper div.highlight {
margin: 0;
}
code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
tt.descclassname {
code.descclassname {
background-color: transparent;
}
tt.xref, a tt {
code.xref, a code {
background-color: transparent;
font-weight: bold;
}
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
background-color: transparent;
}

View File

@ -0,0 +1,261 @@
/*
* default.css_t
* ~~~~~~~~~~~~~
*
* Sphinx stylesheet -- default theme.
*
* :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: sans-serif;
font-size: 100%;
background-color: #11303d;
color: #000;
margin: 0;
padding: 0;
}
div.document {
background-color: #1c4e63;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 0 0 0 230px;
}
div.body {
background-color: #ffffff;
color: #000000;
padding: 0 20px 30px 20px;
}
div.footer {
color: #ffffff;
width: 100%;
padding: 9px 0 9px 0;
text-align: center;
font-size: 75%;
}
div.footer a {
color: #ffffff;
text-decoration: underline;
}
div.related {
background-color: #133f52;
line-height: 30px;
color: #ffffff;
}
div.related a {
color: #ffffff;
}
div.sphinxsidebar {
}
div.sphinxsidebar h3 {
font-family: 'Trebuchet MS', sans-serif;
color: #ffffff;
font-size: 1.4em;
font-weight: normal;
margin: 0;
padding: 0;
}
div.sphinxsidebar h3 a {
color: #ffffff;
}
div.sphinxsidebar h4 {
font-family: 'Trebuchet MS', sans-serif;
color: #ffffff;
font-size: 1.3em;
font-weight: normal;
margin: 5px 0 0 0;
padding: 0;
}
div.sphinxsidebar p {
color: #ffffff;
}
div.sphinxsidebar p.topless {
margin: 5px 10px 10px 10px;
}
div.sphinxsidebar ul {
margin: 10px;
padding: 0;
color: #ffffff;
}
div.sphinxsidebar a {
color: #98dbcc;
}
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
/* -- hyperlink styles ------------------------------------------------------ */
a {
color: #355f7c;
text-decoration: none;
}
a:visited {
color: #355f7c;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* -- body styles ----------------------------------------------------------- */
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: 'Trebuchet MS', sans-serif;
background-color: #f2f2f2;
font-weight: normal;
color: #20435c;
border-bottom: 1px solid #ccc;
margin: 20px -20px 10px -20px;
padding: 3px 0 3px 10px;
}
div.body h1 { margin-top: 0; font-size: 200%; }
div.body h2 { font-size: 160%; }
div.body h3 { font-size: 140%; }
div.body h4 { font-size: 120%; }
div.body h5 { font-size: 110%; }
div.body h6 { font-size: 100%; }
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
div.body p, div.body dd, div.body li {
text-align: justify;
line-height: 130%;
}
div.admonition p.admonition-title + p {
display: inline;
}
div.admonition p {
margin-bottom: 5px;
}
div.admonition pre {
margin-bottom: 5px;
}
div.admonition ul, div.admonition ol {
margin-bottom: 5px;
}
div.note {
background-color: #eee;
border: 1px solid #ccc;
}
div.seealso {
background-color: #ffc;
border: 1px solid #ff6;
}
div.topic {
background-color: #eee;
}
div.warning {
background-color: #ffe4e4;
border: 1px solid #f66;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
pre {
padding: 5px;
background-color: #eeffcc;
color: #333333;
line-height: 120%;
border: 1px solid #ac9;
border-left: none;
border-right: none;
}
code {
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 0.95em;
}
th {
background-color: #ede;
}
.warning code {
background: #efc2c2;
}
.note code {
background: #d6d6d6;
}
.viewcode-back {
font-family: sans-serif;
}
div.viewcode-block:target {
background-color: #f4debf;
border-top: 1px solid #ac9;
border-bottom: 1px solid #ac9;
}
div.code-block-caption {
color: #efefef;
background-color: #1c4e63;
}

View File

@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- default theme.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/

View File

@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -32,7 +32,7 @@ if (!window.console || !console.firebug) {
*/
jQuery.urldecode = function(x) {
return decodeURIComponent(x).replace(/\+/g, ' ');
}
};
/**
* small helper function to urlencode strings
@ -61,18 +61,6 @@ jQuery.getQueryParameters = function(s) {
return result;
};
/**
* small function to check if an array contains
* a given item.
*/
jQuery.contains = function(arr, item) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == item)
return true;
}
return false;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
@ -103,6 +91,30 @@ jQuery.fn.highlightText = function(text, className) {
});
};
/*
* backward compatibility for jQuery.browser
* This will be supported until firefox bug is fixed.
*/
if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}
/**
* Small JavaScript module for the documentation.
*/
@ -164,9 +176,10 @@ var Documentation = {
/**
* workaround a firefox stupidity
* see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
*/
fixFirefoxAnchorBug : function() {
if (document.location.hash && $.browser.mozilla)
if (document.location.hash)
window.setTimeout(function() {
document.location.href += '';
}, 10);
@ -180,6 +193,9 @@ var Documentation = {
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) {
var body = $('div.body');
if (!body.length) {
body = $('body');
}
window.setTimeout(function() {
$.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 358 B

10308
docs/.build/html/_static/jquery-1.11.1.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 173 B

View File

@ -40,6 +40,7 @@
.highlight .nv { color: #bb60d5 } /* Name.Variable */
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #208050 } /* Literal.Number.Bin */
.highlight .mf { color: #208050 } /* Literal.Number.Float */
.highlight .mh { color: #208050 } /* Literal.Number.Hex */
.highlight .mi { color: #208050 } /* Literal.Number.Integer */

View File

@ -4,38 +4,11 @@
*
* Sphinx JavaScript utilties for the full-text search.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/**
* helper function to return a node containing the
* search summary for a given text. keywords is a list
* of stemmed words, hlwords is the list of normal, unstemmed
* words. the first one is used to find the occurance, the
* latter for highlighting it.
*/
jQuery.makeSearchSummary = function(text, keywords, hlwords) {
var textLower = text.toLowerCase();
var start = 0;
$.each(keywords, function() {
var i = textLower.indexOf(this.toLowerCase());
if (i > -1)
start = i;
});
start = Math.max(start - 120, 0);
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
var rv = $('<div class="context"></div>').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
return rv;
}
/**
* Porter Stemmer
@ -220,6 +193,38 @@ var Stemmer = function() {
}
/**
* Simple result scoring code.
*/
var Scorer = {
// Implement the following function to further tweak the score for each result
// The function takes a result array [filename, title, anchor, descr, score]
// and returns the new score.
/*
score: function(result) {
return result[4];
},
*/
// query matches the full name of an object
objNameMatch: 11,
// or matches in the last dotted part of the object name
objPartialMatch: 6,
// Additive scores depending on the priority of the object
objPrio: {0: 15, // used to be importantResults
1: 5, // used to be objectResults
2: -5}, // used to be unimportantResults
// Used when the priority is not in the mapping.
objPrioDefault: 0,
// query found in title
title: 15,
// query found in terms
term: 5
};
/**
* Search Module
*/
@ -273,19 +278,20 @@ var Search = {
if (this._pulse_status >= 0)
return;
function pulse() {
var i;
Search._pulse_status = (Search._pulse_status + 1) % 4;
var dotString = '';
for (var i = 0; i < Search._pulse_status; i++)
for (i = 0; i < Search._pulse_status; i++)
dotString += '.';
Search.dots.text(dotString);
if (Search._pulse_status > -1)
window.setTimeout(pulse, 500);
};
}
pulse();
},
/**
* perform a search for something
* perform a search for something (or wait until index is loaded)
*/
performSearch : function(query) {
// create the required interface elements
@ -305,41 +311,46 @@ var Search = {
this.deferQuery(query);
},
/**
* execute search (requires search index to be loaded)
*/
query : function(query) {
var i;
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
// Stem the searchterms and add them to the correct list
// stem the searchterms and add them to the correct list
var stemmer = new Stemmer();
var searchterms = [];
var excluded = [];
var hlterms = [];
var tmp = query.split(/\s+/);
var objectterms = [];
for (var i = 0; i < tmp.length; i++) {
if (tmp[i] != "") {
for (i = 0; i < tmp.length; i++) {
if (tmp[i] !== "") {
objectterms.push(tmp[i].toLowerCase());
}
if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] == "") {
if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] === "") {
// skip this "word"
continue;
}
// stem the word
var word = stemmer.stemWord(tmp[i]).toLowerCase();
var word = stemmer.stemWord(tmp[i].toLowerCase());
var toAppend;
// select the correct list
if (word[0] == '-') {
var toAppend = excluded;
toAppend = excluded;
word = word.substr(1);
}
else {
var toAppend = searchterms;
toAppend = searchterms;
hlterms.push(tmp[i].toLowerCase());
}
// only add if not already in the list
if (!$.contains(toAppend, word))
if (!$u.contains(toAppend, word))
toAppend.push(word);
};
}
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
// console.debug('SEARCH: searching for:');
@ -347,89 +358,51 @@ var Search = {
// console.info('excluded: ', excluded);
// prepare search
var filenames = this._index.filenames;
var titles = this._index.titles;
var terms = this._index.terms;
var fileMap = {};
var files = null;
// different result priorities
var importantResults = [];
var objectResults = [];
var regularResults = [];
var unimportantResults = [];
var titleterms = this._index.titleterms;
// array of [filename, title, anchor, descr, score]
var results = [];
$('#search-progress').empty();
// lookup as object
for (var i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0,i),
objectterms.slice(i+1, objectterms.length))
var results = this.performObjectSearch(objectterms[i], others);
// Assume first word is most likely to be the object,
// other words more likely to be in description.
// Therefore put matches for earlier words first.
// (Results are eventually used in reverse order).
objectResults = results[0].concat(objectResults);
importantResults = results[1].concat(importantResults);
unimportantResults = results[2].concat(unimportantResults);
for (i = 0; i < objectterms.length; i++) {
var others = [].concat(objectterms.slice(0, i),
objectterms.slice(i+1, objectterms.length));
results = results.concat(this.performObjectSearch(objectterms[i], others));
}
// perform the search on the required terms
for (var i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
// no match but word was a required one
if ((files = terms[word]) == null)
break;
if (files.length == undefined) {
files = [files];
}
// create the mapping
for (var j = 0; j < files.length; j++) {
var file = files[j];
if (file in fileMap)
fileMap[file].push(word);
else
fileMap[file] = [word];
}
// lookup as search terms in fulltext
results = results.concat(this.performTermsSearch(searchterms, excluded, terms, Scorer.term))
.concat(this.performTermsSearch(searchterms, excluded, titleterms, Scorer.title));
// let the scorer override scores with a custom scoring function
if (Scorer.score) {
for (i = 0; i < results.length; i++)
results[i][4] = Scorer.score(results[i]);
}
// now check if the files don't contain excluded terms
for (var file in fileMap) {
var valid = true;
// check if all requirements are matched
if (fileMap[file].length != searchterms.length)
continue;
// ensure that none of the excluded terms is in the
// search result.
for (var i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
$.contains(terms[excluded[i]] || [], file)) {
valid = false;
break;
}
// now sort the results by score (in opposite order of appearance, since the
// display function below uses pop() to retrieve items) and then
// alphabetically
results.sort(function(a, b) {
var left = a[4];
var right = b[4];
if (left > right) {
return 1;
} else if (left < right) {
return -1;
} else {
// same score: sort alphabetically
left = a[1].toLowerCase();
right = b[1].toLowerCase();
return (left > right) ? -1 : ((left < right) ? 1 : 0);
}
// if we have still a valid result we can add it
// to the result list
if (valid)
regularResults.push([filenames[file], titles[file], '', null]);
}
// delete unused variables in order to not waste
// memory until list is retrieved completely
delete filenames, titles, terms;
// now sort the regular results descending by title
regularResults.sort(function(a, b) {
var left = a[1].toLowerCase();
var right = b[1].toLowerCase();
return (left > right) ? -1 : ((left < right) ? 1 : 0);
});
// combine all results
var results = unimportantResults.concat(regularResults)
.concat(objectResults).concat(importantResults);
// for debugging
//Search.lastresults = results.slice(); // a copy
//console.info('search results:', Search.lastresults);
// print the results
var resultCount = results.length;
@ -438,7 +411,7 @@ var Search = {
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') {
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
// dirhtml builder
var dirname = item[0] + '/';
if (dirname.match(/\/index\/$/)) {
@ -466,8 +439,8 @@ var Search = {
dataType: "text",
complete: function(jqxhr, textstatus) {
var data = jqxhr.responseText;
if (data !== '') {
listItem.append($.makeSearchSummary(data, searchterms, hlterms));
if (data !== '' && data !== undefined) {
listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
}
Search.output.append(listItem);
listItem.slideDown(5, function() {
@ -496,20 +469,32 @@ var Search = {
displayNextItem();
},
/**
* search for object names
*/
performObjectSearch : function(object, otherterms) {
var filenames = this._index.filenames;
var objects = this._index.objects;
var objnames = this._index.objnames;
var titles = this._index.titles;
var importantResults = [];
var objectResults = [];
var unimportantResults = [];
var i;
var results = [];
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
var score = 0;
var parts = fullname.split('.');
// check for different match types: exact matches of full name or
// "last name" (i.e. last dotted part)
if (fullname == object || parts[parts.length - 1] == object) {
score += Scorer.objNameMatch;
// matches in last name
} else if (parts[parts.length - 1].indexOf(object) > -1) {
score += Scorer.objPartialMatch;
}
var match = objects[prefix][name];
var objname = objnames[match[1]][2];
var title = titles[match[0]];
@ -519,7 +504,7 @@ var Search = {
var haystack = (prefix + ' ' + name + ' ' +
objname + ' ' + title).toLowerCase();
var allfound = true;
for (var i = 0; i < otherterms.length; i++) {
for (i = 0; i < otherterms.length; i++) {
if (haystack.indexOf(otherterms[i]) == -1) {
allfound = false;
break;
@ -530,37 +515,107 @@ var Search = {
}
}
var descr = objname + _(', in ') + title;
anchor = match[3];
if (anchor == '')
var anchor = match[3];
if (anchor === '')
anchor = fullname;
else if (anchor == '-')
anchor = objnames[match[1]][1] + '-' + fullname;
result = [filenames[match[0]], fullname, '#'+anchor, descr];
switch (match[2]) {
case 1: objectResults.push(result); break;
case 0: importantResults.push(result); break;
case 2: unimportantResults.push(result); break;
// add custom score for some objects according to scorer
if (Scorer.objPrio.hasOwnProperty(match[2])) {
score += Scorer.objPrio[match[2]];
} else {
score += Scorer.objPrioDefault;
}
results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]);
}
}
}
// sort results descending
objectResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
return results;
},
importantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
/**
* search for full-text terms in the index
*/
performTermsSearch : function(searchterms, excluded, terms, score) {
var filenames = this._index.filenames;
var titles = this._index.titles;
unimportantResults.sort(function(a, b) {
return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
});
var i, j, file, files;
var fileMap = {};
var results = [];
return [importantResults, objectResults, unimportantResults]
// perform the search on the required terms
for (i = 0; i < searchterms.length; i++) {
var word = searchterms[i];
// no match but word was a required one
if ((files = terms[word]) === undefined)
break;
if (files.length === undefined) {
files = [files];
}
// create the mapping
for (j = 0; j < files.length; j++) {
file = files[j];
if (file in fileMap)
fileMap[file].push(word);
else
fileMap[file] = [word];
}
}
// now check if the files don't contain excluded terms
for (file in fileMap) {
var valid = true;
// check if all requirements are matched
if (fileMap[file].length != searchterms.length)
continue;
// ensure that none of the excluded terms is in the search result
for (i = 0; i < excluded.length; i++) {
if (terms[excluded[i]] == file ||
$u.contains(terms[excluded[i]] || [], file)) {
valid = false;
break;
}
}
// if we have still a valid result we can add it to the result list
if (valid) {
results.push([filenames[file], titles[file], '', null, score]);
}
}
return results;
},
/**
* helper function to return a node containing the
* search summary for a given text. keywords is a list
* of stemmed words, hlwords is the list of normal, unstemmed
* words. the first one is used to find the occurance, the
* latter for highlighting it.
*/
makeSearchSummary : function(text, keywords, hlwords) {
var textLower = text.toLowerCase();
var start = 0;
$.each(keywords, function() {
var i = textLower.indexOf(this.toLowerCase());
if (i > -1)
start = i;
});
start = Math.max(start - 120, 0);
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
var rv = $('<div class="context"></div>').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
return rv;
}
}
};
$(document).ready(function() {
Search.init();

View File

@ -16,12 +16,20 @@
* Once the browser is closed the cookie is deleted and the position
* reset to the default (expanded).
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
$(function() {
// global elements used by the functions.
// the 'sidebarbutton' element is defined as global after its
// creation, in the add_sidebar_button function
@ -134,7 +142,7 @@ $(function() {
var items = document.cookie.split(';');
for(var k=0; k<items.length; k++) {
var key_val = items[k].split('=');
var key = key_val[0];
var key = key_val[0].replace(/ /, ""); // strip leading spaces
if (key == 'sidebar') {
var value = key_val[1];
if ((value == 'collapsed') && (!sidebar_is_collapsed()))
@ -148,4 +156,4 @@ $(function() {
add_sidebar_button();
var sidebarbutton = $('#sidebarbutton');
set_position_from_cookie();
});
});

View File

@ -0,0 +1,999 @@
// Underscore.js 1.3.1
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore
(function() {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var root = this;
// Save the previous value of the `_` variable.
var previousUnderscore = root._;
// Establish the object that gets returned to break out of a loop iteration.
var breaker = {};
// Save bytes in the minified (but not gzipped) version:
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
// Create quick reference variables for speed access to core prototypes.
var slice = ArrayProto.slice,
unshift = ArrayProto.unshift,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// All **ECMAScript 5** native function implementations that we hope to use
// are declared here.
var
nativeForEach = ArrayProto.forEach,
nativeMap = ArrayProto.map,
nativeReduce = ArrayProto.reduce,
nativeReduceRight = ArrayProto.reduceRight,
nativeFilter = ArrayProto.filter,
nativeEvery = ArrayProto.every,
nativeSome = ArrayProto.some,
nativeIndexOf = ArrayProto.indexOf,
nativeLastIndexOf = ArrayProto.lastIndexOf,
nativeIsArray = Array.isArray,
nativeKeys = Object.keys,
nativeBind = FuncProto.bind;
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) { return new wrapper(obj); };
// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object via a string identifier,
// for Closure Compiler "advanced" mode.
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
}
exports._ = _;
} else {
root['_'] = _;
}
// Current version.
_.VERSION = '1.3.1';
// Collection Functions
// --------------------
// The cornerstone, an `each` implementation, aka `forEach`.
// Handles objects with the built-in `forEach`, arrays, and raw objects.
// Delegates to **ECMAScript 5**'s native `forEach` if available.
var each = _.each = _.forEach = function(obj, iterator, context) {
if (obj == null) return;
if (nativeForEach && obj.forEach === nativeForEach) {
obj.forEach(iterator, context);
} else if (obj.length === +obj.length) {
for (var i = 0, l = obj.length; i < l; i++) {
if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
}
} else {
for (var key in obj) {
if (_.has(obj, key)) {
if (iterator.call(context, obj[key], key, obj) === breaker) return;
}
}
}
};
// Return the results of applying the iterator to each element.
// Delegates to **ECMAScript 5**'s native `map` if available.
_.map = _.collect = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
each(obj, function(value, index, list) {
results[results.length] = iterator.call(context, value, index, list);
});
if (obj.length === +obj.length) results.length = obj.length;
return results;
};
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
_.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
var initial = arguments.length > 2;
if (obj == null) obj = [];
if (nativeReduce && obj.reduce === nativeReduce) {
if (context) iterator = _.bind(iterator, context);
return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
}
each(obj, function(value, index, list) {
if (!initial) {
memo = value;
initial = true;
} else {
memo = iterator.call(context, memo, value, index, list);
}
});
if (!initial) throw new TypeError('Reduce of empty array with no initial value');
return memo;
};
// The right-associative version of reduce, also known as `foldr`.
// Delegates to **ECMAScript 5**'s native `reduceRight` if available.
_.reduceRight = _.foldr = function(obj, iterator, memo, context) {
var initial = arguments.length > 2;
if (obj == null) obj = [];
if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
if (context) iterator = _.bind(iterator, context);
return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
}
var reversed = _.toArray(obj).reverse();
if (context && !initial) iterator = _.bind(iterator, context);
return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator);
};
// Return the first value which passes a truth test. Aliased as `detect`.
_.find = _.detect = function(obj, iterator, context) {
var result;
any(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) {
result = value;
return true;
}
});
return result;
};
// Return all the elements that pass a truth test.
// Delegates to **ECMAScript 5**'s native `filter` if available.
// Aliased as `select`.
_.filter = _.select = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
each(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) results[results.length] = value;
});
return results;
};
// Return all the elements for which a truth test fails.
_.reject = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
each(obj, function(value, index, list) {
if (!iterator.call(context, value, index, list)) results[results.length] = value;
});
return results;
};
// Determine whether all of the elements match a truth test.
// Delegates to **ECMAScript 5**'s native `every` if available.
// Aliased as `all`.
_.every = _.all = function(obj, iterator, context) {
var result = true;
if (obj == null) return result;
if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
each(obj, function(value, index, list) {
if (!(result = result && iterator.call(context, value, index, list))) return breaker;
});
return result;
};
// Determine if at least one element in the object matches a truth test.
// Delegates to **ECMAScript 5**'s native `some` if available.
// Aliased as `any`.
var any = _.some = _.any = function(obj, iterator, context) {
iterator || (iterator = _.identity);
var result = false;
if (obj == null) return result;
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
each(obj, function(value, index, list) {
if (result || (result = iterator.call(context, value, index, list))) return breaker;
});
return !!result;
};
// Determine if a given value is included in the array or object using `===`.
// Aliased as `contains`.
_.include = _.contains = function(obj, target) {
var found = false;
if (obj == null) return found;
if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
found = any(obj, function(value) {
return value === target;
});
return found;
};
// Invoke a method (with arguments) on every item in a collection.
_.invoke = function(obj, method) {
var args = slice.call(arguments, 2);
return _.map(obj, function(value) {
return (_.isFunction(method) ? method || value : value[method]).apply(value, args);
});
};
// Convenience version of a common use case of `map`: fetching a property.
_.pluck = function(obj, key) {
return _.map(obj, function(value){ return value[key]; });
};
// Return the maximum element or (element-based computation).
_.max = function(obj, iterator, context) {
if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
if (!iterator && _.isEmpty(obj)) return -Infinity;
var result = {computed : -Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed >= result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Return the minimum element (or element-based computation).
_.min = function(obj, iterator, context) {
if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
if (!iterator && _.isEmpty(obj)) return Infinity;
var result = {computed : Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed < result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Shuffle an array.
_.shuffle = function(obj) {
var shuffled = [], rand;
each(obj, function(value, index, list) {
if (index == 0) {
shuffled[0] = value;
} else {
rand = Math.floor(Math.random() * (index + 1));
shuffled[index] = shuffled[rand];
shuffled[rand] = value;
}
});
return shuffled;
};
// Sort the object's values by a criterion produced by an iterator.
_.sortBy = function(obj, iterator, context) {
return _.pluck(_.map(obj, function(value, index, list) {
return {
value : value,
criteria : iterator.call(context, value, index, list)
};
}).sort(function(left, right) {
var a = left.criteria, b = right.criteria;
return a < b ? -1 : a > b ? 1 : 0;
}), 'value');
};
// Groups the object's values by a criterion. Pass either a string attribute
// to group by, or a function that returns the criterion.
_.groupBy = function(obj, val) {
var result = {};
var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };
each(obj, function(value, index) {
var key = iterator(value, index);
(result[key] || (result[key] = [])).push(value);
});
return result;
};
// Use a comparator function to figure out at what index an object should
// be inserted so as to maintain order. Uses binary search.
_.sortedIndex = function(array, obj, iterator) {
iterator || (iterator = _.identity);
var low = 0, high = array.length;
while (low < high) {
var mid = (low + high) >> 1;
iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
}
return low;
};
// Safely convert anything iterable into a real, live array.
_.toArray = function(iterable) {
if (!iterable) return [];
if (iterable.toArray) return iterable.toArray();
if (_.isArray(iterable)) return slice.call(iterable);
if (_.isArguments(iterable)) return slice.call(iterable);
return _.values(iterable);
};
// Return the number of elements in an object.
_.size = function(obj) {
return _.toArray(obj).length;
};
// Array Functions
// ---------------
// Get the first element of an array. Passing **n** will return the first N
// values in the array. Aliased as `head`. The **guard** check allows it to work
// with `_.map`.
_.first = _.head = function(array, n, guard) {
return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
};
// Returns everything but the last entry of the array. Especcialy useful on
// the arguments object. Passing **n** will return all the values in
// the array, excluding the last N. The **guard** check allows it to work with
// `_.map`.
_.initial = function(array, n, guard) {
return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
};
// Get the last element of an array. Passing **n** will return the last N
// values in the array. The **guard** check allows it to work with `_.map`.
_.last = function(array, n, guard) {
if ((n != null) && !guard) {
return slice.call(array, Math.max(array.length - n, 0));
} else {
return array[array.length - 1];
}
};
// Returns everything but the first entry of the array. Aliased as `tail`.
// Especially useful on the arguments object. Passing an **index** will return
// the rest of the values in the array from that index onward. The **guard**
// check allows it to work with `_.map`.
_.rest = _.tail = function(array, index, guard) {
return slice.call(array, (index == null) || guard ? 1 : index);
};
// Trim out all falsy values from an array.
_.compact = function(array) {
return _.filter(array, function(value){ return !!value; });
};
// Return a completely flattened version of an array.
_.flatten = function(array, shallow) {
return _.reduce(array, function(memo, value) {
if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value));
memo[memo.length] = value;
return memo;
}, []);
};
// Return a version of the array that does not contain the specified value(s).
_.without = function(array) {
return _.difference(array, slice.call(arguments, 1));
};
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// Aliased as `unique`.
_.uniq = _.unique = function(array, isSorted, iterator) {
var initial = iterator ? _.map(array, iterator) : array;
var result = [];
_.reduce(initial, function(memo, el, i) {
if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) {
memo[memo.length] = el;
result[result.length] = array[i];
}
return memo;
}, []);
return result;
};
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
_.union = function() {
return _.uniq(_.flatten(arguments, true));
};
// Produce an array that contains every item shared between all the
// passed-in arrays. (Aliased as "intersect" for back-compat.)
_.intersection = _.intersect = function(array) {
var rest = slice.call(arguments, 1);
return _.filter(_.uniq(array), function(item) {
return _.every(rest, function(other) {
return _.indexOf(other, item) >= 0;
});
});
};
// Take the difference between one array and a number of other arrays.
// Only the elements present in just the first array will remain.
_.difference = function(array) {
var rest = _.flatten(slice.call(arguments, 1));
return _.filter(array, function(value){ return !_.include(rest, value); });
};
// Zip together multiple lists into a single array -- elements that share
// an index go together.
_.zip = function() {
var args = slice.call(arguments);
var length = _.max(_.pluck(args, 'length'));
var results = new Array(length);
for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
return results;
};
// If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
// we need this function. Return the position of the first occurrence of an
// item in an array, or -1 if the item is not included in the array.
// Delegates to **ECMAScript 5**'s native `indexOf` if available.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
_.indexOf = function(array, item, isSorted) {
if (array == null) return -1;
var i, l;
if (isSorted) {
i = _.sortedIndex(array, item);
return array[i] === item ? i : -1;
}
if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i;
return -1;
};
// Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
_.lastIndexOf = function(array, item) {
if (array == null) return -1;
if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
var i = array.length;
while (i--) if (i in array && array[i] === item) return i;
return -1;
};
// Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](http://docs.python.org/library/functions.html#range).
_.range = function(start, stop, step) {
if (arguments.length <= 1) {
stop = start || 0;
start = 0;
}
step = arguments[2] || 1;
var len = Math.max(Math.ceil((stop - start) / step), 0);
var idx = 0;
var range = new Array(len);
while(idx < len) {
range[idx++] = start;
start += step;
}
return range;
};
// Function (ahem) Functions
// ------------------
// Reusable constructor function for prototype setting.
var ctor = function(){};
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Binding with arguments is also known as `curry`.
// Delegates to **ECMAScript 5**'s native `Function.bind` if available.
// We check for `func.bind` first, to fail fast when `func` is undefined.
_.bind = function bind(func, context) {
var bound, args;
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (!_.isFunction(func)) throw new TypeError;
args = slice.call(arguments, 2);
return bound = function() {
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
ctor.prototype = func.prototype;
var self = new ctor;
var result = func.apply(self, args.concat(slice.call(arguments)));
if (Object(result) === result) return result;
return self;
};
};
// Bind all of an object's methods to that object. Useful for ensuring that
// all callbacks defined on an object belong to it.
_.bindAll = function(obj) {
var funcs = slice.call(arguments, 1);
if (funcs.length == 0) funcs = _.functions(obj);
each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
return obj;
};
// Memoize an expensive function by storing its results.
_.memoize = function(func, hasher) {
var memo = {};
hasher || (hasher = _.identity);
return function() {
var key = hasher.apply(this, arguments);
return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
};
};
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
_.delay = function(func, wait) {
var args = slice.call(arguments, 2);
return setTimeout(function(){ return func.apply(func, args); }, wait);
};
// Defers a function, scheduling it to run after the current call stack has
// cleared.
_.defer = function(func) {
return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
};
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time.
_.throttle = function(func, wait) {
var context, args, timeout, throttling, more;
var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
return function() {
context = this; args = arguments;
var later = function() {
timeout = null;
if (more) func.apply(context, args);
whenDone();
};
if (!timeout) timeout = setTimeout(later, wait);
if (throttling) {
more = true;
} else {
func.apply(context, args);
}
whenDone();
throttling = true;
};
};
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds.
_.debounce = function(func, wait) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
func.apply(context, args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
};
};
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
_.once = function(func) {
var ran = false, memo;
return function() {
if (ran) return memo;
ran = true;
return memo = func.apply(this, arguments);
};
};
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
_.wrap = function(func, wrapper) {
return function() {
var args = [func].concat(slice.call(arguments, 0));
return wrapper.apply(this, args);
};
};
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
_.compose = function() {
var funcs = arguments;
return function() {
var args = arguments;
for (var i = funcs.length - 1; i >= 0; i--) {
args = [funcs[i].apply(this, args)];
}
return args[0];
};
};
// Returns a function that will only be executed after being called N times.
_.after = function(times, func) {
if (times <= 0) return func();
return function() {
if (--times < 1) { return func.apply(this, arguments); }
};
};
// Object Functions
// ----------------
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
_.keys = nativeKeys || function(obj) {
if (obj !== Object(obj)) throw new TypeError('Invalid object');
var keys = [];
for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
return keys;
};
// Retrieve the values of an object's properties.
_.values = function(obj) {
return _.map(obj, _.identity);
};
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
if (_.isFunction(obj[key])) names.push(key);
}
return names.sort();
};
// Extend a given object with all the properties in passed-in object(s).
_.extend = function(obj) {
each(slice.call(arguments, 1), function(source) {
for (var prop in source) {
obj[prop] = source[prop];
}
});
return obj;
};
// Fill in a given object with default properties.
_.defaults = function(obj) {
each(slice.call(arguments, 1), function(source) {
for (var prop in source) {
if (obj[prop] == null) obj[prop] = source[prop];
}
});
return obj;
};
// Create a (shallow-cloned) duplicate of an object.
_.clone = function(obj) {
if (!_.isObject(obj)) return obj;
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
};
// Invokes interceptor with the obj, and then returns obj.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
_.tap = function(obj, interceptor) {
interceptor(obj);
return obj;
};
// Internal recursive comparison function.
function eq(a, b, stack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
if (a === b) return a !== 0 || 1 / a == 1 / b;
// A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b;
// Unwrap any wrapped objects.
if (a._chain) a = a._wrapped;
if (b._chain) b = b._wrapped;
// Invoke a custom `isEqual` method if one is provided.
if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b);
if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a);
// Compare `[[Class]]` names.
var className = toString.call(a);
if (className != toString.call(b)) return false;
switch (className) {
// Strings, numbers, dates, and booleans are compared by value.
case '[object String]':
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
return a == String(b);
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
// other numeric values.
return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
case '[object Date]':
case '[object Boolean]':
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a == +b;
// RegExps are compared by their source patterns and flags.
case '[object RegExp]':
return a.source == b.source &&
a.global == b.global &&
a.multiline == b.multiline &&
a.ignoreCase == b.ignoreCase;
}
if (typeof a != 'object' || typeof b != 'object') return false;
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
var length = stack.length;
while (length--) {
// Linear search. Performance is inversely proportional to the number of
// unique nested structures.
if (stack[length] == a) return true;
}
// Add the first object to the stack of traversed objects.
stack.push(a);
var size = 0, result = true;
// Recursively compare objects and arrays.
if (className == '[object Array]') {
// Compare array lengths to determine if a deep comparison is necessary.
size = a.length;
result = size == b.length;
if (result) {
// Deep compare the contents, ignoring non-numeric properties.
while (size--) {
// Ensure commutative equality for sparse arrays.
if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break;
}
}
} else {
// Objects with different constructors are not equivalent.
if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;
// Deep compare objects.
for (var key in a) {
if (_.has(a, key)) {
// Count the expected number of properties.
size++;
// Deep compare each member.
if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break;
}
}
// Ensure that both objects contain the same number of properties.
if (result) {
for (key in b) {
if (_.has(b, key) && !(size--)) break;
}
result = !size;
}
}
// Remove the first object from the stack of traversed objects.
stack.pop();
return result;
}
// Perform a deep comparison to check if two objects are equal.
_.isEqual = function(a, b) {
return eq(a, b, []);
};
// Is a given array, string, or object empty?
// An "empty" object has no enumerable own-properties.
_.isEmpty = function(obj) {
if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
for (var key in obj) if (_.has(obj, key)) return false;
return true;
};
// Is a given value a DOM element?
_.isElement = function(obj) {
return !!(obj && obj.nodeType == 1);
};
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
return toString.call(obj) == '[object Array]';
};
// Is a given variable an object?
_.isObject = function(obj) {
return obj === Object(obj);
};
// Is a given variable an arguments object?
_.isArguments = function(obj) {
return toString.call(obj) == '[object Arguments]';
};
if (!_.isArguments(arguments)) {
_.isArguments = function(obj) {
return !!(obj && _.has(obj, 'callee'));
};
}
// Is a given value a function?
_.isFunction = function(obj) {
return toString.call(obj) == '[object Function]';
};
// Is a given value a string?
_.isString = function(obj) {
return toString.call(obj) == '[object String]';
};
// Is a given value a number?
_.isNumber = function(obj) {
return toString.call(obj) == '[object Number]';
};
// Is the given value `NaN`?
_.isNaN = function(obj) {
// `NaN` is the only value for which `===` is not reflexive.
return obj !== obj;
};
// Is a given value a boolean?
_.isBoolean = function(obj) {
return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
};
// Is a given value a date?
_.isDate = function(obj) {
return toString.call(obj) == '[object Date]';
};
// Is the given value a regular expression?
_.isRegExp = function(obj) {
return toString.call(obj) == '[object RegExp]';
};
// Is a given value equal to null?
_.isNull = function(obj) {
return obj === null;
};
// Is a given variable undefined?
_.isUndefined = function(obj) {
return obj === void 0;
};
// Has own property?
_.has = function(obj, key) {
return hasOwnProperty.call(obj, key);
};
// Utility Functions
// -----------------
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
// previous owner. Returns a reference to the Underscore object.
_.noConflict = function() {
root._ = previousUnderscore;
return this;
};
// Keep the identity function around for default iterators.
_.identity = function(value) {
return value;
};
// Run a function **n** times.
_.times = function (n, iterator, context) {
for (var i = 0; i < n; i++) iterator.call(context, i);
};
// Escape a string for HTML interpolation.
_.escape = function(string) {
return (''+string).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g,'&#x2F;');
};
// Add your own custom functions to the Underscore object, ensuring that
// they're correctly added to the OOP wrapper as well.
_.mixin = function(obj) {
each(_.functions(obj), function(name){
addToWrapper(name, _[name] = obj[name]);
});
};
// Generate a unique integer id (unique within the entire client session).
// Useful for temporary DOM ids.
var idCounter = 0;
_.uniqueId = function(prefix) {
var id = idCounter++;
return prefix ? prefix + id : id;
};
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g
};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /.^/;
// Within an interpolation, evaluation, or escaping, remove HTML escaping
// that had been previously added.
var unescape = function(code) {
return code.replace(/\\\\/g, '\\').replace(/\\'/g, "'");
};
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
_.template = function(str, data) {
var c = _.templateSettings;
var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
'with(obj||{}){__p.push(\'' +
str.replace(/\\/g, '\\\\')
.replace(/'/g, "\\'")
.replace(c.escape || noMatch, function(match, code) {
return "',_.escape(" + unescape(code) + "),'";
})
.replace(c.interpolate || noMatch, function(match, code) {
return "'," + unescape(code) + ",'";
})
.replace(c.evaluate || noMatch, function(match, code) {
return "');" + unescape(code).replace(/[\r\n\t]/g, ' ') + ";__p.push('";
})
.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
+ "');}return __p.join('');";
var func = new Function('obj', '_', tmpl);
if (data) return func(data, _);
return function(data) {
return func.call(this, data, _);
};
};
// Add a "chain" function, which will delegate to the wrapper.
_.chain = function(obj) {
return _(obj).chain();
};
// The OOP Wrapper
// ---------------
// If Underscore is called as a function, it returns a wrapped object that
// can be used OO-style. This wrapper holds altered versions of all the
// underscore functions. Wrapped objects may be chained.
var wrapper = function(obj) { this._wrapped = obj; };
// Expose `wrapper.prototype` as `_.prototype`
_.prototype = wrapper.prototype;
// Helper function to continue chaining intermediate results.
var result = function(obj, chain) {
return chain ? _(obj).chain() : obj;
};
// A method to easily add functions to the OOP wrapper.
var addToWrapper = function(name, func) {
wrapper.prototype[name] = function() {
var args = slice.call(arguments);
unshift.call(args, this._wrapped);
return result(func.apply(_, args), this._chain);
};
};
// Add all of the Underscore functions to the wrapper object.
_.mixin(_);
// Add all mutator Array functions to the wrapper.
each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
var method = ArrayProto[name];
wrapper.prototype[name] = function() {
var wrapped = this._wrapped;
method.apply(wrapped, arguments);
var length = wrapped.length;
if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];
return result(wrapped, this._chain);
};
});
// Add all accessor Array functions to the wrapper.
each(['concat', 'join', 'slice'], function(name) {
var method = ArrayProto[name];
wrapper.prototype[name] = function() {
return result(method.apply(this._wrapped, arguments), this._chain);
};
});
// Start chaining a wrapped Underscore object.
wrapper.prototype.chain = function() {
this._chain = true;
return this;
};
// Extracts the result from a wrapped and chained object.
wrapper.prototype.value = function() {
return this._wrapped;
};
}).call(this);

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 345 B

View File

@ -4,7 +4,7 @@
*
* sphinx.websupport utilties for all documentation.
*
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -50,51 +50,51 @@
}
function initEvents() {
$('a.comment-close').live("click", function(event) {
$(document).on("click", 'a.comment-close', function(event) {
event.preventDefault();
hide($(this).attr('id').substring(2));
});
$('a.vote').live("click", function(event) {
$(document).on("click", 'a.vote', function(event) {
event.preventDefault();
handleVote($(this));
});
$('a.reply').live("click", function(event) {
$(document).on("click", 'a.reply', function(event) {
event.preventDefault();
openReply($(this).attr('id').substring(2));
});
$('a.close-reply').live("click", function(event) {
$(document).on("click", 'a.close-reply', function(event) {
event.preventDefault();
closeReply($(this).attr('id').substring(2));
});
$('a.sort-option').live("click", function(event) {
$(document).on("click", 'a.sort-option', function(event) {
event.preventDefault();
handleReSort($(this));
});
$('a.show-proposal').live("click", function(event) {
$(document).on("click", 'a.show-proposal', function(event) {
event.preventDefault();
showProposal($(this).attr('id').substring(2));
});
$('a.hide-proposal').live("click", function(event) {
$(document).on("click", 'a.hide-proposal', function(event) {
event.preventDefault();
hideProposal($(this).attr('id').substring(2));
});
$('a.show-propose-change').live("click", function(event) {
$(document).on("click", 'a.show-propose-change', function(event) {
event.preventDefault();
showProposeChange($(this).attr('id').substring(2));
});
$('a.hide-propose-change').live("click", function(event) {
$(document).on("click", 'a.hide-propose-change', function(event) {
event.preventDefault();
hideProposeChange($(this).attr('id').substring(2));
});
$('a.accept-comment').live("click", function(event) {
$(document).on("click", 'a.accept-comment', function(event) {
event.preventDefault();
acceptComment($(this).attr('id').substring(2));
});
$('a.delete-comment').live("click", function(event) {
$(document).on("click", 'a.delete-comment', function(event) {
event.preventDefault();
deleteComment($(this).attr('id').substring(2));
});
$('a.comment-markup').live("click", function(event) {
$(document).on("click", 'a.comment-markup', function(event) {
event.preventDefault();
toggleCommentMarkupBox($(this).attr('id').substring(2));
});
@ -700,8 +700,8 @@
(<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
<div class="comment-markup-box" id="mb<%id%>">\
reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
<tt>``code``</tt>, \
code blocks: <tt>::</tt> and an indented block after blank line</div>\
<code>``code``</code>, \
code blocks: <code>::</code> and an indented block after blank line</div>\
<form method="post" id="cf<%id%>" class="comment-form" action="">\
<textarea name="comment" cols="80"></textarea>\
<p class="propose-button">\

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Apache setup &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Nginx setup" href="nginx_install.html" />
<link rel="prev" title="Easiest installation" href="easy_install.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="easy_install.html" title="Easiest installation"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="apache-setup">
<h1>Apache setup<a class="headerlink" href="#apache-setup" title="Permalink to this headline"></a></h1>
@ -72,7 +70,7 @@ installation facile. You&#8217;ll benefit from having:</p>
<li>Apache robustness in front end: it&#8217;s secure, and there is much less chance
it will crash under heavy load;</li>
<li>your web site processes won&#8217;t run with admin rights, even if
<a class="reference internal" href="options.html#user-and-group-en"><em>&#8211;user</em></a> doesn&#8217;t
<a class="reference internal" href="options.html#user-and-group-en"><span>&#8211;user</span></a> doesn&#8217;t
work on your OS.</li>
</ul>
<div class="section" id="mod-wsgi">
@ -84,13 +82,14 @@ the setup of the Apache module mod_wsgi. If you don&#8217;t know how to do this,
if you can&#8217;t do it (E.G: your hosting won&#8217;t let you), you need to go for
the CGI setup.</p>
<p>First, make sure you have mod_wsgi installed and enable by running (as admin):</p>
<div class="highlight-python"><pre>a2enmod wsgi</pre>
<div class="highlight-python"><div class="highlight"><pre>a2enmod wsgi
</pre></div>
</div>
<p>This enable mod_wsgi. It it doesn&#8217;t, install it first (on ubuntu, the package
is libapache2-mod-wsgi).</p>
<p>Then create an Apache configuration file, usually in /etc/apache/sites-available/.
Name it zerobin:</p>
<div class="highlight-python"><pre>&lt;VirtualHost *:80&gt;
<div class="highlight-python"><div class="highlight"><pre>&lt;VirtualHost *:80&gt;
ServerName www.yourwebsite.com
WSGIDaemonProcess zerobin user=www-data group=www-data processes=1 threads=5
@ -102,13 +101,16 @@ Name it zerobin:</p>
Order deny,allow
Allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt;</pre>
&lt;/VirtualHost&gt;
</pre></div>
</div>
<p>Activate the website (as admin):</p>
<div class="highlight-python"><pre>a2ensite zerobin</pre>
<div class="highlight-python"><div class="highlight"><pre>a2ensite zerobin
</pre></div>
</div>
<p>And reload the apache configuration (as admin):</p>
<div class="highlight-python"><pre>service apache2 reload</pre>
<div class="highlight-python"><div class="highlight"><pre>service apache2 reload
</pre></div>
</div>
<p>You&#8217;ll note that we refer to a file named app.wsgi. It&#8217;s a Python file
creating the application Apache is going to use to start the Python process:</p>
@ -147,7 +149,7 @@ it yet. Please contact us if you ever get the need to use it.</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -164,12 +166,14 @@ it yet. Please contact us if you ever get the need to use it.</p>
<h4>Next topic</h4>
<p class="topless"><a href="nginx_install.html"
title="next chapter">Nginx setup</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/apache_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/apache_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -186,7 +190,7 @@ it yet. Please contact us if you ever get the need to use it.</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -198,12 +202,12 @@ it yet. Please contact us if you ever get the need to use it.</p>
<li class="right" >
<a href="easy_install.html" title="Easiest installation"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Easiest installation &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Apache setup" href="apache_install.html" />
<link rel="prev" title="Introduction" href="intro.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="intro.html" title="Introduction"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="easiest-installation">
<h1>Easiest installation<a class="headerlink" href="#easiest-installation" title="Permalink to this headline"></a></h1>
@ -59,14 +57,15 @@ and <a class="reference internal" href="nginx_install.html"><em>Nginx</em></a> s
<div class="section" id="seconds-setup-if-you-know-python-already">
<h2>10 seconds setup (if you know Python already)<a class="headerlink" href="#seconds-setup-if-you-know-python-already" title="Permalink to this headline"></a></h2>
<p>Just type:</p>
<div class="highlight-python"><pre>pip install zerobin
zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin</pre>
<div class="highlight-python"><div class="highlight"><pre>pip install zerobin
zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin
</pre></div>
</div>
</div>
<div class="section" id="seconds-setup-for-anybody">
<h2>30 seconds setup (for anybody)<a class="headerlink" href="#seconds-setup-for-anybody" title="Permalink to this headline"></a></h2>
<ul>
<li><p class="first">Make sure you have Python 2.6 or 2.7 (<cite>python &#8211;version</cite>)</p>
<li><p class="first">Make sure you have Python 2.7 or 3.4+ (<cite>python &#8211;version</cite>)</p>
</li>
<li><p class="first">Download the last <a class="reference external" href="https://github.com/sametmax/0bin/zipball/master">zip of the source code</a></p>
</li>
@ -75,12 +74,14 @@ zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin</pre>
<li><p class="first">Go to the extracted files.</p>
</li>
<li><p class="first">Run with the admin rights:</p>
<div class="highlight-python"><pre>python zerobin.py --host 0.0.0.0 --port 80 --compressed-static</pre>
<div class="highlight-python"><div class="highlight"><pre>python zerobin.py --host 0.0.0.0 --port 80 --compressed-static
</pre></div>
</div>
</li>
</ul>
<p>On ubuntu, this is a one liner:</p>
<div class="highlight-python"><pre>wget stuff &amp;&amp; unzip zerobin.zip &amp;&amp; cd zerobin &amp;&amp; sudo python zerobin.py --host 0.0.0.0 --port 80 --compressed-static</pre>
<div class="highlight-python"><div class="highlight"><pre>wget stuff &amp;&amp; unzip zerobin.zip &amp;&amp; cd zerobin &amp;&amp; sudo python zerobin.py --host 0.0.0.0 --port 80 --compressed-static
</pre></div>
</div>
<p>Check out for more <a class="reference internal" href="options.html"><em>configuration options</em></a>.</p>
</div>
@ -89,7 +90,8 @@ zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin</pre>
<p>0bin doesn&#8217;t come with something built in for this. You have several solutions.</p>
<p><em>For a small website:</em></p>
<p>Just make it a shell background process. E.G in GNU/Linux:</p>
<div class="highlight-python"><pre>nohup python zerobin.py --host 0.0.0.0 --port 80 --compressed-static &amp;</pre>
<div class="highlight-python"><div class="highlight"><pre>nohup python zerobin.py --host 0.0.0.0 --port 80 --compressed-static &amp;
</pre></div>
</div>
<p>Or run it in a screen.</p>
<p><em>For a big Website:</em></p>
@ -101,7 +103,8 @@ zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin</pre>
<p class="first admonition-title">Note</p>
<p>You can even use zerobin on your private local network from your laptop.</p>
<p>Make sure you firewall won&#8217;t block the port, and run:</p>
<div class="highlight-python"><pre>python zerobin.py --host 0.0.0.0 --port 8000</pre>
<div class="highlight-python"><div class="highlight"><pre>python zerobin.py --host 0.0.0.0 --port 8000
</pre></div>
</div>
<p>0bin will now be accessible from <a class="reference external" href="http://your.local.ip.address:8000">http://your.local.ip.address:8000</a>.</p>
<p class="last">This can be very cool way to share code in a companie or during a code sprint.</p>
@ -113,7 +116,7 @@ zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin</pre>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -131,12 +134,14 @@ zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin</pre>
<h4>Next topic</h4>
<p class="topless"><a href="apache_install.html"
title="next chapter">Apache setup</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/easy_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/easy_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -153,7 +158,7 @@ zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin</pre>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -165,12 +170,12 @@ zerobin --host 0.0.0.0 --port 80 --compressed-static # as admin</pre>
<li class="right" >
<a href="intro.html" title="Introduction"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Introduction &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Easiest installation" href="easy_install.html" />
<link rel="prev" title="0bins documentation" href="../index.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="../index.html" title="0bins documentation"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="introduction">
<h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h1>
@ -134,7 +132,7 @@ install even if you know nothing about Python.</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -154,12 +152,14 @@ install even if you know nothing about Python.</p>
<h4>Next topic</h4>
<p class="topless"><a href="easy_install.html"
title="next chapter">Easiest installation</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/intro.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/intro.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -176,7 +176,7 @@ install even if you know nothing about Python.</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -188,12 +188,12 @@ install even if you know nothing about Python.</p>
<li class="right" >
<a href="../index.html" title="0bins documentation"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Nginx setup &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Using supervisor" href="using_supervisor.html" />
<link rel="prev" title="Apache setup" href="apache_install.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="apache_install.html" title="Apache setup"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="nginx-setup">
<h1>Nginx setup<a class="headerlink" href="#nginx-setup" title="Permalink to this headline"></a></h1>
@ -88,7 +86,8 @@ processes. It&#8217;s very handy for updates.</li>
<div class="section" id="the-python-process">
<h2>The Python process<a class="headerlink" href="#the-python-process" title="Permalink to this headline"></a></h2>
<p>Run 0bin as usual, but this time make it listen to a local port and host. E.G:</p>
<div class="highlight-python"><pre>zerobin --host 127.0.0.1 --port 8000</pre>
<div class="highlight-python"><div class="highlight"><pre>zerobin --host 127.0.0.1 --port 8000
</pre></div>
</div>
<p>In PHP, when you edit a file, the changes are immediately visible. In Python,
the whole code is often loaded in memory for performance reasons. This means
@ -102,19 +101,20 @@ installing it.</p>
<p>Vous must create a Nginx configuration file for 0bin. On GNU/Linux, they usually
go into /etc/nginx/conf.d/. Name it zerobin.conf.</p>
<p>The minimal configuration file to run the site is:</p>
<div class="highlight-python"><pre>server {
<div class="highlight-python"><div class="highlight"><pre>server {
listen 80;
server_name www.yourwebsite.com;
location / {
proxy_pass http://127.0.0.1:8000;
}
}</pre>
}
</pre></div>
</div>
<p><cite>proxy_pass</cite> just passes the external request to the Python process.
The port much match the one used by the 0bin process of course.</p>
<p>You can make some adjustements to get a better user experience:</p>
<div class="highlight-python"><pre>server {
<div class="highlight-python"><div class="highlight"><pre>server {
listen 80;
server_name www.yourwebsite.com;
@ -139,7 +139,8 @@ The port much match the one used by the 0bin process of course.</p>
location / {
proxy_pass http://zerobin_cherrypy;
}
}</pre>
}
</pre></div>
</div>
<p>This make Nginx serve the favicon and static files, set the expire HTTP headers
and make sure gzip compression is used with browsers that support it.</p>
@ -150,7 +151,7 @@ and make sure gzip compression is used with browsers that support it.</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -167,12 +168,14 @@ and make sure gzip compression is used with browsers that support it.</p>
<h4>Next topic</h4>
<p class="topless"><a href="using_supervisor.html"
title="next chapter">Using supervisor</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/nginx_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/nginx_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -189,7 +192,7 @@ and make sure gzip compression is used with browsers that support it.</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -201,12 +204,12 @@ and make sure gzip compression is used with browsers that support it.</p>
<li class="right" >
<a href="apache_install.html" title="Apache setup"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Options &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="zerobinpaste command-line tool" href="zerobinpaste_tool.html" />
<link rel="prev" title="Theming" href="theming.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="theming.html" title="Theming"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="options">
<h1>Options<a class="headerlink" href="#options" title="Permalink to this headline"></a></h1>
@ -106,7 +104,8 @@ web site.</p>
<div class="section" id="examples">
<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h3>
<p>Production:</p>
<div class="highlight-python"><pre>sudo zerobin --host 0.0.0.0 --port 80 --user foo --compressed-static</pre>
<div class="highlight-python"><div class="highlight"><pre>sudo zerobin --host 0.0.0.0 --port 80 --user foo --compressed-static
</pre></div>
</div>
<p>Developpement:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">zerobin</span> <span class="o">--</span><span class="n">debug</span> <span class="o">--</span><span class="n">serve</span><span class="o">-</span><span class="n">static</span>
@ -118,7 +117,8 @@ web site.</p>
<h2>Configuration file<a class="headerlink" href="#configuration-file" title="Permalink to this headline"></a></h2>
<p>The configuration file should be an ordinary Python file, usually named
settings.py. It&#8217;s used this way:</p>
<div class="highlight-python"><pre>zerobin --settings-file '/path/to/settings.py'</pre>
<div class="highlight-python"><div class="highlight"><pre>zerobin --settings-file &#39;/path/to/settings.py&#39;
</pre></div>
</div>
<p>Any options passed to the command line will have priority on the ones in
the configuration file. The zerobin/default_settings.py can be used as an
@ -212,7 +212,7 @@ port 80, but you wish that the process do not have access to protected files.</p
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -249,12 +249,14 @@ port 80, but you wish that the process do not have access to protected files.</p
<h4>Next topic</h4>
<p class="topless"><a href="zerobinpaste_tool.html"
title="next chapter">zerobinpaste command-line tool</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/options.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/options.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -271,7 +273,7 @@ port 80, but you wish that the process do not have access to protected files.</p
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -283,12 +285,12 @@ port 80, but you wish that the process do not have access to protected files.</p
<li class="right" >
<a href="theming.html" title="Theming"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Theming &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Options" href="options.html" />
<link rel="prev" title="Using supervisor" href="using_supervisor.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,24 +40,24 @@
<li class="right" >
<a href="using_supervisor.html" title="Using supervisor"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="theming">
<h1>Theming<a class="headerlink" href="#theming" title="Permalink to this headline"></a></h1>
<p>0bin comes with a complete theming support, but for now it&#8217;s not well integrated.</p>
<p>If you wish to create your own theme, you&#8217;ll need to create templates similar
to the ones in zerobin/view, and add the path to the directory containing them
to the <a class="reference internal" href="options.html#template-dirs-en"><em>configuration file</em></a>.</p>
to the <a class="reference internal" href="options.html#template-dirs-en"><span>configuration file</span></a>.</p>
<p>You&#8217;ll also need to copy static files from zerobin/static to a new directory
where you can edit them. And you need to add this directory in the
<a class="reference internal" href="options.html#static-root-en"><em>configuration file</em></a> too.</p>
<a class="reference internal" href="options.html#static-root-en"><span>configuration file</span></a> too.</p>
<p>Of course, if you look for something simple, you can just edit all files in place/</p>
<p>But be careful, the javascript code is tightly coupled with HTML ID and classes,
and they are not very well organized for now.</p>
@ -70,7 +68,7 @@ and they are not very well organized for now.</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="using_supervisor.html"
@ -78,12 +76,14 @@ and they are not very well organized for now.</p>
<h4>Next topic</h4>
<p class="topless"><a href="options.html"
title="next chapter">Options</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/theming.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/theming.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -100,7 +100,7 @@ and they are not very well organized for now.</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -112,12 +112,12 @@ and they are not very well organized for now.</p>
<li class="right" >
<a href="using_supervisor.html" title="Using supervisor"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Using supervisor &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Theming" href="theming.html" />
<link rel="prev" title="Nginx setup" href="nginx_install.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="nginx_install.html" title="Nginx setup"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="using-supervisor">
<h1>Using supervisor<a class="headerlink" href="#using-supervisor" title="Permalink to this headline"></a></h1>
@ -57,7 +55,7 @@
the setup (which is just apt-get install supervisor or pip install supervisor
most of the time), but here is a quick overview on how to use it.</p>
<p>Create a configuration file named supervisor.ini:</p>
<div class="highlight-python"><pre>[unix_http_server]
<div class="highlight-python"><div class="highlight"><pre>[unix_http_server]
file=/tmp/supervisor.sock;
[supervisorctl]
@ -80,16 +78,18 @@ user=zerobin
[program:zerobin]
command=/path/to/zerobin/zerobin.py --port 80 --compressed-static
directory=/path/to/zerobin/
environment=PYTHONPATH='/path/to/zerobin/'
environment=PYTHONPATH=&#39;/path/to/zerobin/&#39;
user=zerobin
autostart=true
autorestart=true</pre>
autorestart=true
</pre></div>
</div>
<p>The 4 first entries are just boiler plate to get you started, you can copy
them verbatim.</p>
<p>The last one define one (you can have many) process supervisor should manage.</p>
<p>It means it will run the command:</p>
<div class="highlight-python"><pre>/path/to/zerobin/zerobin.py --port 80 --compressed-static</pre>
<div class="highlight-python"><div class="highlight"><pre>/path/to/zerobin/zerobin.py --port 80 --compressed-static
</pre></div>
</div>
<p>In the directory, with the environnement and the user you defined.</p>
<p>This command will be ran as a daemon, in the background.</p>
@ -109,7 +109,8 @@ running, even it crashes temporarly or if you retart the machine.</p>
<p class="first admonition-title">Note</p>
<p>If you installed zerobin in a virtualenv, you may set the command
to run directly from it:</p>
<div class="last highlight-python"><pre>command=/path/to/virtualenv/bin/zerobin --port 80 --compressed-static</pre>
<div class="last highlight-python"><div class="highlight"><pre>command=/path/to/virtualenv/bin/zerobin --port 80 --compressed-static
</pre></div>
</div>
</div>
</div>
@ -118,7 +119,7 @@ to run directly from it:</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="nginx_install.html"
@ -126,12 +127,14 @@ to run directly from it:</p>
<h4>Next topic</h4>
<p class="topless"><a href="theming.html"
title="next chapter">Theming</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/using_supervisor.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/using_supervisor.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -148,7 +151,7 @@ to run directly from it:</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -160,12 +163,12 @@ to run directly from it:</p>
<li class="right" >
<a href="nginx_install.html" title="Nginx setup"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>zerobinpaste command-line tool &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Introduction" href="../fr/intro.html" />
<link rel="prev" title="Options" href="options.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,21 +40,21 @@
<li class="right" >
<a href="options.html" title="Options"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="zerobinpaste-command-line-tool">
<h1>zerobinpaste command-line tool<a class="headerlink" href="#zerobinpaste-command-line-tool" title="Permalink to this headline"></a></h1>
<p>zerobinpaste is a simple CLI tool (analogous to pastebinit or wgetpaste) to use
with files or shell redirection in terminal or simple scripts.</p>
<p>Example use-cases might look like:</p>
<div class="highlight-python"><pre>% zerobinpaste README.rst
<div class="highlight-python"><div class="highlight"><pre>% zerobinpaste README.rst
http://some.0bin.site/paste/0cc3d8a8...
% grep error /var/log/syslog | zerobinpaste
@ -69,7 +67,8 @@ options.rst http://some.0bin.site/paste/921b2768...
...
% ps axlf | zerobinpaste | mail -s "Process tree on $(date)" root</pre>
% ps axlf | zerobinpaste | mail -s &quot;Process tree on $(date)&quot; root
</pre></div>
</div>
<p>Produced links can then be copy-pasted to some IRC channel or used in whatever
other conceivable way.</p>
@ -80,7 +79,7 @@ never sent to server or anywhere but the tool&#8217;s stdout stream (e.g. termin
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<p>At least the pastebin site (main URL where you&#8217;d paste stuff with the browser)
has to be specified for the tool to use either via -u (&#8211;url) option (can be
simplified with shell alias - e.g. <tt class="docutils literal"><span class="pre">alias</span> <span class="pre">zp='zerobinpaste</span> <span class="pre">-u</span> <span class="pre">http://some.0bin.site</span></tt>)
simplified with shell alias - e.g. <code class="docutils literal"><span class="pre">alias</span> <span class="pre">zp='zerobinpaste</span> <span class="pre">-u</span> <span class="pre">http://some.0bin.site</span></code>)
or in the &#8220;~/.zerobinpasterc&#8221; configuration file (json format).</p>
<div class="line-block">
<div class="line">Non-option arguments are interpreted as files to upload/paste contents of.</div>
@ -106,7 +105,7 @@ dependencies, if necessary, and &#8220;node&#8221; binary is required for produc
run.</p>
<p>Use &#8220;make&#8221; in &#8220;tools&#8221; path to produce non-minified runnable &#8220;zerobinpaste&#8221;
script there.</p>
<p><tt class="docutils literal"><span class="pre">make</span> <span class="pre">ugly</span></tt> command can be used instead of <tt class="docutils literal"><span class="pre">make</span></tt> to create &#8220;minified&#8221;
<p><code class="docutils literal"><span class="pre">make</span> <span class="pre">ugly</span></code> command can be used instead of <code class="docutils literal"><span class="pre">make</span></code> to create &#8220;minified&#8221;
version (using/installing <a class="reference external" href="https://github.com/mishoo/UglifyJS">uglifyjs</a>, about 25% smaller in size).</p>
<p>Resulting &#8220;zerobinpaste&#8221; script requires only node.js (&#8220;node&#8221; binary) installed
to run and can be placed in any of the PATH dirs (e.g. &#8220;~/bin&#8221;,
@ -130,7 +129,7 @@ well.</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -148,12 +147,14 @@ well.</p>
<h4>Next topic</h4>
<p class="topless"><a href="../fr/intro.html"
title="next chapter">Introduction</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/zerobinpaste_tool.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/en/zerobinpaste_tool.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -170,7 +171,7 @@ well.</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -182,12 +183,12 @@ well.</p>
<li class="right" >
<a href="options.html" title="Options"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Installation avec Apache &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Installation avec Nginx" href="nginx_install.html" />
<link rel="prev" title="Installation la plus simple" href="easy_install.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="easy_install.html" title="Installation la plus simple"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="installation-avec-apache">
<h1>Installation avec Apache<a class="headerlink" href="#installation-avec-apache" title="Permalink to this headline"></a></h1>
@ -73,7 +71,7 @@ du nombre de requêtes);</li>
<li>de la solidité d&#8217;Apache en front end: il est sécurité, et il y a peu de chance
qu&#8217;il crash sous une forte charge;</li>
<li>les processus de votre site ne tournent pas avec les droits admin, même si
<a class="reference internal" href="options.html#user-and-group-fr"><em>&#8211;user</em></a> ne fonctionne pas sur votre OS.</li>
<a class="reference internal" href="options.html#user-and-group-fr"><span>&#8211;user</span></a> ne fonctionne pas sur votre OS.</li>
</ul>
<p>Apache s&#8217;installe avec votre gestionnaire de paquet habituel, nous ne couvrierons
pas cette partie.</p>
@ -86,13 +84,14 @@ l&#8217;installation du model Apache mod_wsgi. Si vous ne savez pas comment fair
ou si vous ne pouvez pas le faire (par example sur un hébergement mutualisé
qui ne le propose pas), il vous faudra choisir l&#8217;installation CGI.</p>
<p>Premièrement, assurez-vous d&#8217;avoir mod_wsgi installé et chargé (en tant qu&#8217;admin):</p>
<div class="highlight-python"><pre>a2enmod wsgi</pre>
<div class="highlight-python"><div class="highlight"><pre>a2enmod wsgi
</pre></div>
</div>
<p>Ceci va activer mod_wsgi. Si cela ne marche pas, il faudra l&#8217;installer d&#8217;abord (
sur ubuntu, le paquet est libapache2-mod-wsgi)</p>
<p>Ensuite, il faut créer un fichier de configuration Apache, généralement dans
/etc/apache/sites-available/. Nommez le zerobin:</p>
<div class="highlight-python"><pre>&lt;VirtualHost *:80&gt;
<div class="highlight-python"><div class="highlight"><pre>&lt;VirtualHost *:80&gt;
ServerName www.votersiteweb.com
WSGIDaemonProcess zerobin user=www-data group=www-data processes=1 threads=5
@ -104,13 +103,16 @@ sur ubuntu, le paquet est libapache2-mod-wsgi)</p>
Order deny,allow
Allow from all
&lt;/Directory&gt;
&lt;/VirtualHost&gt;</pre>
&lt;/VirtualHost&gt;
</pre></div>
</div>
<p>Activez le site web (en tant qu&#8217;admin):</p>
<div class="highlight-python"><pre>a2ensite zerobin</pre>
<div class="highlight-python"><div class="highlight"><pre>a2ensite zerobin
</pre></div>
</div>
<p>Et rechargez la configuration d&#8217;Apache (en tant qu&#8217;admin):</p>
<div class="highlight-python"><pre>service apache2 reload</pre>
<div class="highlight-python"><div class="highlight"><pre>service apache2 reload
</pre></div>
</div>
<p>Vous aurez noté que l&#8217;on fait référence à un fichier nommé app.wsgi. C&#8217;est un
fichier Python qui créé l&#8217;application qu&#8217;Apache va utiliser pour lancer le
@ -150,7 +152,7 @@ couvrir cette partie. Contactez nous si vous avez besoin de l&#8217;utiliser.</p
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -167,12 +169,14 @@ couvrir cette partie. Contactez nous si vous avez besoin de l&#8217;utiliser.</p
<h4>Next topic</h4>
<p class="topless"><a href="nginx_install.html"
title="next chapter">Installation avec Nginx</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/apache_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/apache_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -189,7 +193,7 @@ couvrir cette partie. Contactez nous si vous avez besoin de l&#8217;utiliser.</p
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -201,12 +205,12 @@ couvrir cette partie. Contactez nous si vous avez besoin de l&#8217;utiliser.</p
<li class="right" >
<a href="easy_install.html" title="Installation la plus simple"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Installation la plus simple &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Installation avec Apache" href="apache_install.html" />
<link rel="prev" title="Introduction" href="intro.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="intro.html" title="Introduction"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="installation-la-plus-simple">
<h1>Installation la plus simple<a class="headerlink" href="#installation-la-plus-simple" title="Permalink to this headline"></a></h1>
@ -59,14 +57,15 @@ Pour des solutions plus solides et sécurisées, essayez les installation
<div class="section" id="installation-en-10-secondes-si-vous-connaissez-python">
<h2>Installation en 10 secondes (si vous connaissez Python)<a class="headerlink" href="#installation-en-10-secondes-si-vous-connaissez-python" title="Permalink to this headline"></a></h2>
<p>Entrez:</p>
<div class="highlight-python"><pre>pip install zerobin
zerobin --host 0.0.0.0 --port 80 --compressed-static # en tant qu'admin</pre>
<div class="highlight-python"><div class="highlight"><pre>pip install zerobin
zerobin --host 0.0.0.0 --port 80 --compressed-static # en tant qu&#39;admin
</pre></div>
</div>
</div>
<div class="section" id="installation-en-30-secondes-pour-tous">
<h2>Installation en 30 secondes (pour tous)<a class="headerlink" href="#installation-en-30-secondes-pour-tous" title="Permalink to this headline"></a></h2>
<ul>
<li><p class="first">Assurez-vous d&#8217;avoir Python 2.6 ou 2.7 (<cite>python &#8211;version</cite>)</p>
<li><p class="first">Assurez-vous d&#8217;avoir Python 2.7 ou 3.4+ (<cite>python &#8211;version</cite>)</p>
</li>
<li><p class="first">Télécharger le dernier <a class="reference external" href="https://github.com/sametmax/0bin/zipball/master">zip du code source</a>.</p>
</li>
@ -75,12 +74,14 @@ zerobin --host 0.0.0.0 --port 80 --compressed-static # en tant qu'admin</pre>
<li><p class="first">Allez dans les dossiers extraits.</p>
</li>
<li><p class="first">Lancez avec les droits admin:</p>
<div class="highlight-python"><pre>python zerobin.py --host 0.0.0.0 --port 80 --compressed-static</pre>
<div class="highlight-python"><div class="highlight"><pre>python zerobin.py --host 0.0.0.0 --port 80 --compressed-static
</pre></div>
</div>
</li>
</ul>
<p>Sous ubuntu, une line suffit:</p>
<div class="highlight-python"><pre>wget stuff &amp;&amp; unzip zerobin.zip &amp;&amp; cd zerobin &amp;&amp; sudo python zerobin.py --host 0.0.0.0 --port 80 --compressed-static</pre>
<div class="highlight-python"><div class="highlight"><pre>wget stuff &amp;&amp; unzip zerobin.zip &amp;&amp; cd zerobin &amp;&amp; sudo python zerobin.py --host 0.0.0.0 --port 80 --compressed-static
</pre></div>
</div>
<p>Jetez un oeil aux <a class="reference internal" href="options.html"><em>options de configuration</em></a>.</p>
</div>
@ -90,7 +91,8 @@ zerobin --host 0.0.0.0 --port 80 --compressed-static # en tant qu'admin</pre>
solutions.</p>
<p><em>Pour un petit site:</em></p>
<p>Lancer simplement 0bin en processus shell d&#8217;arrière plan. Example sous GNU/Linux:</p>
<div class="highlight-python"><pre>nohup python zerobin.py --host 0.0.0.0 --port 80 --compressed-static &amp;</pre>
<div class="highlight-python"><div class="highlight"><pre>nohup python zerobin.py --host 0.0.0.0 --port 80 --compressed-static &amp;
</pre></div>
</div>
<p>Ou dans un screen.</p>
<p><em>Pour les gros sites Web:</em></p>
@ -102,7 +104,8 @@ solutions.</p>
<p class="first admonition-title">Note</p>
<p>Vous pouvez même utiliser zerobin sur votre réseau local depuis votre portable.</p>
<p>Assurez vous que votre parefeu ne bloque pas le port, et lancez:</p>
<div class="highlight-python"><pre>python zerobin.py --host 0.0.0.0 --port 8000</pre>
<div class="highlight-python"><div class="highlight"><pre>python zerobin.py --host 0.0.0.0 --port 8000
</pre></div>
</div>
<p>0bin sera maintenant accessible sur <a class="reference external" href="http://votre.addresse.ip.locale:8000">http://votre.addresse.ip.locale:8000</a>.</p>
<p class="last">Ça peut être très un moyen très cool pour partager du code dans une entreprise
@ -115,7 +118,7 @@ ou a un code sprint.</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -133,12 +136,14 @@ ou a un code sprint.</p>
<h4>Next topic</h4>
<p class="topless"><a href="apache_install.html"
title="next chapter">Installation avec Apache</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/easy_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/easy_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -155,7 +160,7 @@ ou a un code sprint.</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -167,12 +172,12 @@ ou a un code sprint.</p>
<li class="right" >
<a href="intro.html" title="Introduction"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Introduction &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Installation la plus simple" href="easy_install.html" />
<link rel="prev" title="zerobinpaste command-line tool" href="../en/zerobinpaste_tool.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="../en/zerobinpaste_tool.html" title="zerobinpaste command-line tool"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="introduction">
<h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h1>
@ -145,7 +143,7 @@ rapport qualité/prix.</li>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -165,12 +163,14 @@ rapport qualité/prix.</li>
<h4>Next topic</h4>
<p class="topless"><a href="easy_install.html"
title="next chapter">Installation la plus simple</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/intro.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/intro.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -187,7 +187,7 @@ rapport qualité/prix.</li>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -199,12 +199,12 @@ rapport qualité/prix.</li>
<li class="right" >
<a href="../en/zerobinpaste_tool.html" title="zerobinpaste command-line tool"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Installation avec Nginx &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Utiliser supervisor" href="using_supervisor.html" />
<link rel="prev" title="Installation avec Apache" href="apache_install.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="apache_install.html" title="Installation avec Apache"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="installation-avec-nginx">
<h1>Installation avec Nginx<a class="headerlink" href="#installation-avec-nginx" title="Permalink to this headline"></a></h1>
@ -89,7 +87,8 @@ processus. C&#8217;est très pratique pour les mises à jour.</li>
<h2>Processus Python<a class="headerlink" href="#processus-python" title="Permalink to this headline"></a></h2>
<p>Lancez 0bin comme d&#8217;habitude, mais cette fois pour écouter sur un host et un port
local. Ex</p>
<div class="highlight-python"><pre>zerobin --host 127.0.0.1 --port 8000</pre>
<div class="highlight-python"><div class="highlight"><pre>zerobin --host 127.0.0.1 --port 8000
</pre></div>
</div>
<p>En PHP, quand on édite un fichier, la modificiation est visible immédiatement.
En Python, l&#8217;intégralité du code est chargé en mémoire pour des raisons de
@ -104,19 +103,20 @@ nous ne couvrirons pas cette partie.</p>
<p>Vous devez créer une fichier de configuration Nginx pour 0bin. Sous GNU/Linux,
on les mets en général dans /etc/nginx/conf.d/. Nommez le zerobin.conf.</p>
<p>Le fichier de configuration minimal pour faire tourner le site est:</p>
<div class="highlight-python"><pre>server {
<div class="highlight-python"><div class="highlight"><pre>server {
listen 80;
server_name www.votresiteweb.com;
location / {
proxy_pass http://127.0.0.1:8000;
}
}</pre>
}
</pre></div>
</div>
<p><cite>proxy_pass</cite> transmet les requêtes aux processus Python. Bien entendu le
port doit correspondre à celui utilisé par 0bin.</p>
<p>On peut apporter plusieurs améliorations à l&#8217;expérience utilisateur:</p>
<div class="highlight-python"><pre>server {
<div class="highlight-python"><div class="highlight"><pre>server {
listen 80;
server_name www.votresiteweb.com;
@ -141,7 +141,8 @@ port doit correspondre à celui utilisé par 0bin.</p>
location / {
proxy_pass http://zerobin_cherrypy;
}
}</pre>
}
</pre></div>
</div>
<p>Nginx sert maintenant le favicon ainsi que les fichiers statiques,
on a ajouté une date d&#8217;expiration dans les en-têtes HTTP
@ -154,7 +155,7 @@ qui la supporte.</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -171,12 +172,14 @@ qui la supporte.</p>
<h4>Next topic</h4>
<p class="topless"><a href="using_supervisor.html"
title="next chapter">Utiliser supervisor</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/nginx_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/nginx_install.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -193,7 +196,7 @@ qui la supporte.</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -205,12 +208,12 @@ qui la supporte.</p>
<li class="right" >
<a href="apache_install.html" title="Installation avec Apache"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Options &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Outil en ligne de commande zerobinpaste" href="zerobinpaste_tool.html" />
<link rel="prev" title="Personnaliser lapparence" href="theming.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="theming.html" title="Personnaliser lapparence"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="options">
<h1>Options<a class="headerlink" href="#options" title="Permalink to this headline"></a></h1>
@ -109,7 +107,8 @@ production pour un site plus rapide.</p>
<div class="section" id="exemples">
<h3>Exemples<a class="headerlink" href="#exemples" title="Permalink to this headline"></a></h3>
<p>Production:</p>
<div class="highlight-python"><pre>sudo zerobin --host 0.0.0.0 --port 80 --user foo --compressed-static</pre>
<div class="highlight-python"><div class="highlight"><pre>sudo zerobin --host 0.0.0.0 --port 80 --user foo --compressed-static
</pre></div>
</div>
<p>Développement:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">zerobin</span> <span class="o">--</span><span class="n">debug</span> <span class="o">--</span><span class="n">serve</span><span class="o">-</span><span class="n">static</span>
@ -121,7 +120,8 @@ production pour un site plus rapide.</p>
<h2>Fichier de configuration<a class="headerlink" href="#fichier-de-configuration" title="Permalink to this headline"></a></h2>
<p>Le fichier configuration doit être un fichier Python ordinnaire, généralement
appelé settings.py. On l&#8217;utilise ainsi:</p>
<div class="highlight-python"><pre>zerobin --settings-file '/chemin/vers/settings.py'</pre>
<div class="highlight-python"><div class="highlight"><pre>zerobin --settings-file &#39;/chemin/vers/settings.py&#39;
</pre></div>
</div>
<p>Toutes les autres options passées à la commandes auront priorité sur les options
du fichier de configuration. Le fichier zerobin/default_settings.py peut servir
@ -219,7 +219,7 @@ est en haut de chaque page.</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -256,12 +256,14 @@ est en haut de chaque page.</p>
<h4>Next topic</h4>
<p class="topless"><a href="zerobinpaste_tool.html"
title="next chapter">Outil en ligne de commande zerobinpaste</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/options.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/options.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -278,7 +280,7 @@ est en haut de chaque page.</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -290,12 +292,12 @@ est en haut de chaque page.</p>
<li class="right" >
<a href="theming.html" title="Personnaliser lapparence"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Personnaliser lapparence &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Options" href="options.html" />
<link rel="prev" title="Utiliser supervisor" href="using_supervisor.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="using_supervisor.html" title="Utiliser supervisor"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="personnaliser-l-apparence">
<h1>Personnaliser l&#8217;apparence<a class="headerlink" href="#personnaliser-l-apparence" title="Permalink to this headline"></a></h1>
@ -57,10 +55,10 @@
<p>Si vous souhaitez créer votre propre theme, il vous faut créer des templates
similaires à ceux par défault présents dans zerobin/view, et
ajouter le chemin du dossier contenant ces templates au
<a class="reference internal" href="options.html#template-dirs-fr"><em>fichier de configuration</em></a>.</p>
<a class="reference internal" href="options.html#template-dirs-fr"><span>fichier de configuration</span></a>.</p>
<p>Vous aurez également besoin de copier les fichiers statiques présent
dans zerobin/static dans un nouveau dossier, puis les modifier. Et signifiez
que vous utilisez ce dossier dans le <a class="reference internal" href="options.html#static-root-fr"><em>fichier de configuration</em></a>.</p>
que vous utilisez ce dossier dans le <a class="reference internal" href="options.html#static-root-fr"><span>fichier de configuration</span></a>.</p>
<p>Vous pouvez bien entendu également éditez tous les fichier directement par
souci de simplicité.</p>
<p>Attention cependant, le code javascript est très dépendant des ID et classes
@ -73,7 +71,7 @@ améliorons le support.</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="using_supervisor.html"
@ -81,12 +79,14 @@ améliorons le support.</p>
<h4>Next topic</h4>
<p class="topless"><a href="options.html"
title="next chapter">Options</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/theming.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/theming.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -103,7 +103,7 @@ améliorons le support.</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -115,12 +115,12 @@ améliorons le support.</p>
<li class="right" >
<a href="using_supervisor.html" title="Utiliser supervisor"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Utiliser supervisor &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -29,8 +27,8 @@
<link rel="next" title="Personnaliser lapparence" href="theming.html" />
<link rel="prev" title="Installation avec Nginx" href="nginx_install.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -42,14 +40,14 @@
<li class="right" >
<a href="nginx_install.html" title="Installation avec Nginx"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="utiliser-supervisor">
<h1>Utiliser supervisor<a class="headerlink" href="#utiliser-supervisor" title="Permalink to this headline"></a></h1>
@ -58,7 +56,7 @@ pas couvrir son installation (qui la plupart du temps se résume à
apt-get install supervisor ou pip install supervisor), mais voici un rapide
résumé de comment l&#8217;utiliser:</p>
<p>Créez un fichier de configuration nommé supervisor.ini:</p>
<div class="highlight-python"><pre>[unix_http_server]
<div class="highlight-python"><div class="highlight"><pre>[unix_http_server]
file=/tmp/supervisor.sock;
[supervisorctl]
@ -81,17 +79,19 @@ user=zerobin
[program:zerobin]
command=/chemin/vers/zerobin/zerobin.py --port 80 --compressed-static
directory=/chemin/vers/zerobin/
environment=PYTHONPATH='/chemin/vers/zerobin/'
environment=PYTHONPATH=&#39;/chemin/vers/zerobin/&#39;
user=zerobin
autostart=true
autorestart=true</pre>
autorestart=true
</pre></div>
</div>
<p>Les 4 premières entrées sont juste de la configuration standard et vous pouvez
les copier telles qu&#8217;elles.</p>
<p>La dernière entrée définie un processus (il peut y en avoir plusieurs)
que supervisor doit gérer.</p>
<p>Cela veut dire qu&#8217;il va lancer la commande:</p>
<div class="highlight-python"><pre>/chemin/vers/zerobin/zerobin.py --port 80 --compressed-static</pre>
<div class="highlight-python"><div class="highlight"><pre>/chemin/vers/zerobin/zerobin.py --port 80 --compressed-static
</pre></div>
</div>
<p>Et ceci dans le dossier, avec l&#8217;environnement et l&#8217;utilisateur défini, le tout
en arrière plan en tant que daemon.</p>
@ -112,7 +112,8 @@ sur le service.</p>
<p class="first admonition-title">Note</p>
<p>Si vous avez installé zerobin dans un virtualenv, vous devriez définir la
commande pour qu&#8217;elle s&#8217;éxécute depuis le virtualenv:</p>
<div class="last highlight-python"><pre>command=/chemin/vers/le/virtualenv/bin/zerobin --port 80 --compressed-static</pre>
<div class="last highlight-python"><div class="highlight"><pre>command=/chemin/vers/le/virtualenv/bin/zerobin --port 80 --compressed-static
</pre></div>
</div>
</div>
</div>
@ -121,7 +122,7 @@ commande pour qu&#8217;elle s&#8217;éxécute depuis le virtualenv:</p>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="nginx_install.html"
@ -129,12 +130,14 @@ commande pour qu&#8217;elle s&#8217;éxécute depuis le virtualenv:</p>
<h4>Next topic</h4>
<p class="topless"><a href="theming.html"
title="next chapter">Personnaliser l&#8217;apparence</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/using_supervisor.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/using_supervisor.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -151,7 +154,7 @@ commande pour qu&#8217;elle s&#8217;éxécute depuis le virtualenv:</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -163,12 +166,12 @@ commande pour qu&#8217;elle s&#8217;éxécute depuis le virtualenv:</p>
<li class="right" >
<a href="nginx_install.html" title="Installation avec Nginx"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,7 +8,7 @@
<title>Outil en ligne de commande zerobinpaste &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
@ -28,8 +26,8 @@
<link rel="top" title="0bin 0.1 documentation" href="../index.html" />
<link rel="prev" title="Options" href="options.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -38,21 +36,21 @@
<li class="right" >
<a href="options.html" title="Options"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="outil-en-ligne-de-commande-zerobinpaste">
<h1>Outil en ligne de commande zerobinpaste<a class="headerlink" href="#outil-en-ligne-de-commande-zerobinpaste" title="Permalink to this headline"></a></h1>
<p>zerobinpaste est un simple outil CLI (similaire à pastebinit ou wgetpaste) à utiliser
avec des fichiers ou des redirection shell dans le terminal ou des scripts simples.</p>
<p>Exemple de cas d&#8217;utilisation:</p>
<div class="highlight-python"><pre>% zerobinpaste README.rst
<div class="highlight-python"><div class="highlight"><pre>% zerobinpaste README.rst
http://some.0bin.site/paste/0cc3d8a8...
% grep error /var/log/syslog | zerobinpaste
@ -64,7 +62,8 @@ apache_install.rst http://some.0bin.site/paste/01408cbd...
options.rst http://some.0bin.site/paste/921b2768...
...
% ps axlf | zerobinpaste | mail -s "Process tree on $(date)" root</pre>
% ps axlf | zerobinpaste | mail -s &quot;Process tree on $(date)&quot; root
</pre></div>
</div>
<p>Les liens produits peuvent être ensuite copier-coller sur un channel IRC
ou autre.</p>
@ -76,7 +75,7 @@ de l&#8217;outil (ex: le terminal).</p>
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
<p>Au minimum il faut préciser le site pastebin (l&#8217;url principal d&#8217;où on posterait
dans le navigateur) doit être spécifié à l&#8217;outil via l&#8217;option -u (&#8211;url) (on peut
le simplifier avec un alias shell - ex: <tt class="docutils literal"><span class="pre">alias</span> <span class="pre">zp='zerobinpaste</span> <span class="pre">-u</span> <span class="pre">http://some.0bin.site</span></tt>)
le simplifier avec un alias shell - ex: <code class="docutils literal"><span class="pre">alias</span> <span class="pre">zp='zerobinpaste</span> <span class="pre">-u</span> <span class="pre">http://some.0bin.site</span></code>)
ou dans le fichier de configuration &#8220;~/.zerobinpasterc&#8221; (format json).</p>
<div class="line-block">
<div class="line">Les arguments positionels sont interprétés comme des fichiers à uploader et chiffrer.</div>
@ -100,7 +99,7 @@ peut être spécifié ici.</p>
<p>La commande &#8220;npm&#8221; (packagé and installé avec node.js) est requise pour télécharger
les dépendances indispensables à la production de l&#8217;éxécutable.</p>
<p>Utilisez &#8220;make&#8221; dans le dossier &#8220;tools&#8221; pour produire une version non-minifié&#8221; de &#8220;zerobinpaste&#8221;.</p>
<p>La commande <tt class="docutils literal"><span class="pre">make</span> <span class="pre">ugly</span></tt> peut être utilisé à la place de <tt class="docutils literal"><span class="pre">make</span></tt> pour créer une version &#8220;minified&#8221;
<p>La commande <code class="docutils literal"><span class="pre">make</span> <span class="pre">ugly</span></code> peut être utilisé à la place de <code class="docutils literal"><span class="pre">make</span></code> pour créer une version &#8220;minified&#8221;
(requière l&#8217;installation de <a class="reference external" href="https://github.com/mishoo/UglifyJS">uglifyjs</a>, script produit environ 25% plus petit en taille).</p>
<p>Le script &#8220;zerobinpaste&#8221; ainsi produit seulement besoin de node.js (et la commande &#8220;node&#8221;) pour
s&#8217;éxcuter et peut être placé n&#8217;importe où dans le PATH système (ex : &#8220;~/bin&#8221;, &#8220;/usr/local/bin&#8221;)
@ -123,7 +122,7 @@ complexe et plus courant, permettant à des clients non-javascript de fonctioner
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
@ -138,12 +137,14 @@ complexe et plus courant, permettant à des clients non-javascript de fonctioner
<h4>Previous topic</h4>
<p class="topless"><a href="options.html"
title="previous chapter">Options</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/zerobinpaste_tool.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/fr/zerobinpaste_tool.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
@ -160,7 +161,7 @@ complexe et plus courant, permettant à des clients non-javascript de fonctioner
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -169,12 +170,12 @@ complexe et plus courant, permettant à des clients non-javascript de fonctioner
<li class="right" >
<a href="options.html" title="Options"
>previous</a> |</li>
<li><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="../index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,7 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -12,12 +9,12 @@
<title>Index &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
URL_ROOT: './',
VERSION: '0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
@ -29,21 +26,21 @@
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="0bin 0.1 documentation" href="index.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
accesskey="I">index</a></li>
<li><a href="index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<h1 id="index">Index</h1>
@ -56,12 +53,12 @@
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none">
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
@ -78,18 +75,18 @@
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
>index</a></li>
<li><a href="index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,12 +8,12 @@
<title>0bins documentation &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
URL_ROOT: './',
VERSION: '0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
@ -28,8 +26,8 @@
<link rel="top" title="0bin 0.1 documentation" href="#" />
<link rel="next" title="Introduction" href="en/intro.html" />
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -38,14 +36,14 @@
<li class="right" >
<a href="en/intro.html" title="Introduction"
accesskey="N">next</a> |</li>
<li><a href="#">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="#">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<div class="section" id="bin-s-documentation">
<h1>0bin&#8217;s documentation<a class="headerlink" href="#bin-s-documentation" title="Permalink to this headline"></a></h1>
@ -100,17 +98,19 @@
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Next topic</h4>
<p class="topless"><a href="en/intro.html"
title="next chapter">Introduction</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
@ -127,7 +127,7 @@
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
@ -136,12 +136,12 @@
<li class="right" >
<a href="en/intro.html" title="Introduction"
>next</a> |</li>
<li><a href="#">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="#">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

Binary file not shown.

View File

@ -1,5 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -10,12 +8,12 @@
<title>Search &mdash; 0bin 0.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
URL_ROOT: './',
VERSION: '0.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
@ -35,21 +33,21 @@
</head>
<body>
<div class="related">
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li><a href="index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="body" role="main">
<h1 id="search-documentation">Search</h1>
<div id="fallback" class="admonition warning">
@ -78,24 +76,24 @@
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li><a href="index.html">0bin 0.1 documentation</a> &raquo;</li>
<li class="nav-item nav-item-0"><a href="index.html">0bin 0.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
<div class="footer" role="contentinfo">
&copy; Copyright 2012, Sam et Max.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@ Just type::
30 seconds setup (for anybody)
===============================
- Make sure you have Python 2.7 (`python --version`)
- Make sure you have Python 2.7 or 3.4+ (`python --version`)
- Download the last `zip of the source code <https://github.com/sametmax/0bin/zipball/master>`_
- Extract all of it where you wish the site to be stored.
- Go to the extracted files.

View File

@ -18,7 +18,7 @@ Entrez::
Installation en 30 secondes (pour tous)
=======================================
- Assurez-vous d'avoir Python 2.7 (`python --version`)
- Assurez-vous d'avoir Python 2.7 ou 3.4+ (`python --version`)
- Télécharger le dernier `zip du code source <https://github.com/sametmax/0bin/zipball/master>`_.
- Décompressez tous les fichiers là où vous souhaitez mettre le site.
- Allez dans les dossiers extraits.