This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1320 from gittip/remove-orm
port back to postgres.py
- Loading branch information
Showing
132 changed files
with
3,804 additions
and
3,238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,6 @@ gittip.css | |
.vagrant | ||
node_modules/ | ||
.DS_Store | ||
docs/_build | ||
docs/gittip | ||
docs/gittip.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
PYTHONDONTWRITEBYTECODE=true | ||
CANONICAL_HOST= | ||
CANONICAL_SCHEME=http | ||
MIN_THREADS=10 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
PYTHONDONTWRITEBYTECODE=true | ||
CANONICAL_HOST= | ||
CANONICAL_SCHEME=http | ||
MIN_THREADS=10 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Makefile for Sphinx documentation | ||
# Trimmed up from the | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
BUILDDIR = _build | ||
|
||
# User-friendly check for sphinx-build | ||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) | ||
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) | ||
endif | ||
|
||
# Internal variables. | ||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) . | ||
# the i18n builder cannot share the environment and doctrees with the others | ||
I18NSPHINXOPTS = $(SPHINXOPTS) . | ||
|
||
.PHONY: help clean html linkcheck doctest | ||
|
||
default: html | ||
|
||
help: | ||
@echo "Please use \`make <target>' where <target> is one of" | ||
@echo " html to make standalone HTML files" | ||
@echo " linkcheck to check all external links for integrity" | ||
@echo " doctest to run all doctests embedded in the documentation (if enabled)" | ||
|
||
clean: | ||
rm -rf gittip* $(BUILDDIR)/* | ||
|
||
rst: | ||
AUTOLIB_LIBRARY_ROOT=../gittip ./autolib.py | ||
|
||
html: | ||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html | ||
@echo | ||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html." | ||
|
||
linkcheck: | ||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | ||
@echo | ||
@echo "Link check complete; look for any errors in the above output " \ | ||
"or in $(BUILDDIR)/linkcheck/output.txt." | ||
|
||
doctest: | ||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest | ||
@echo "Testing of doctests in the sources finished, look at the " \ | ||
"results in $(BUILDDIR)/doctest/output.txt." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/usr/bin/env python | ||
"""Generate *.rst files to mirror *.py files in a Python library. | ||
This script is conceptually similar to the sphinx-apidoc script bundled with | ||
Sphinx: | ||
http://sphinx-doc.org/man/sphinx-apidoc.html | ||
We produce different *.rst output, however. | ||
""" | ||
from __future__ import print_function, unicode_literals | ||
import os | ||
|
||
|
||
w = lambda f, s, *a, **kw: print(s.format(*a, **kw), file=f) | ||
|
||
|
||
def rst_for_module(toc_path): | ||
"""Given a toc_path, write rst and return a file object. | ||
""" | ||
|
||
f = open(toc_path + '.rst', 'w+') | ||
|
||
heading = ":mod:`{}`".format(os.path.basename(toc_path)) | ||
dotted = toc_path.replace('/', '.') | ||
|
||
w(f, heading) | ||
w(f, "=" * len(heading)) | ||
w(f, ".. automodule:: {}", dotted) | ||
|
||
return f | ||
|
||
|
||
def rst_for_package(root, dirs, files): | ||
"""Given ../mylib/path/to/package and lists of dir/file names, write rst. | ||
""" | ||
|
||
doc_path = root[3:] | ||
if not os.path.isdir(doc_path): | ||
os.mkdir(doc_path) | ||
|
||
|
||
# Start a rst doc for this package. | ||
# ================================= | ||
|
||
f = rst_for_module(doc_path) | ||
|
||
|
||
# Add a table of contents. | ||
# ======================== | ||
|
||
w(f, ".. toctree::") | ||
|
||
def toc(doc_path, name): | ||
parent = os.path.dirname(doc_path) | ||
toc_path = os.path.join(doc_path[len(parent):].lstrip('/'), name) | ||
if toc_path.endswith('.py'): | ||
toc_path = toc_path[:-len('.py')] | ||
w(f, " {}", toc_path) | ||
return os.path.join(parent, toc_path) | ||
|
||
for name in sorted(dirs + files): | ||
if name in dirs: | ||
toc(doc_path, name) | ||
else: | ||
if not name.endswith('.py'): continue | ||
if name == '__init__.py': continue | ||
|
||
toc_path = toc(doc_path, name) | ||
|
||
|
||
# Write a rst file for each module. | ||
# ================================= | ||
|
||
rst_for_module(toc_path) | ||
|
||
|
||
def main(): | ||
library_root = os.environ['AUTOLIB_LIBRARY_ROOT'] | ||
for root, dirs, files in os.walk(library_root): | ||
rst_for_package(root, dirs, files) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.