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
First you want a version of `git` that comes with the bash completion script | |
installed. Of course, you could also download the `current version | |
<https://github.com/git/git/blob/master/contrib/completion/git-completion.bash>`_ | |
and store it somewhere (e.g. in `~/.bash/`), but using the `git-core` port | |
from `MacPorts <http://www.macports.org/>`_ or a the binaries available at the | |
`Git home page <http://git-scm.com/>`_ has the advantage of (very likely) | |
giving you a more recent version. In the case of MacPorts_ you would run:: | |
$ sudo port install git-core +bash_completion |
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
# 'preview' support for browser tests | |
alias preview import os, tempfile; out = tempfile.NamedTemporaryFile(mode='w', suffix='.html'); print >> out, browser.contents; out.flush(); _ = os.system("open '%s'" % out.name) |
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
<config> | |
<parm name="COL_LIMIT" value="int(79)" /> | |
<parm name="SHEBANG" value="" /> | |
<parm name="PARENTHESIZE_TUPLE_DISPLAY" value="bool(False)" /> | |
<parm name="ADD_BLANK_LINES_AROUND_COMMENTS" value="bool(False)" /> | |
<parm name="ADD_BLANK_LINE_AFTER_DOC_STRING" value="bool(False)" /> | |
<parm name="MAX_SEPS_FUNC_DEF" value="int(99)" /> | |
<parm name="MAX_SEPS_FUNC_REF" value="int(99)" /> | |
<parm name="WRAP_DOC_STRINGS" value="bool(True)" /> | |
<parm name="NORMALIZE_DOC_STRINGS" value="bool(True)" /> |
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
# set up python buildout & development tools | |
version = 2.7 | |
python = bin/python$(version) | |
defaults = bin/python bin/virtualenv | |
tools = buildout pep8 pyflakes mkrelease checkversions igor pytest tox devpi | |
namespace = | |
all: $(defaults) $(tools) |
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
from colander import MappingSchema, SchemaNode, String | |
from deform import Form | |
def magnet(schema): | |
def decorator(node): | |
for child in node().children: | |
schema.add(child) | |
return node | |
return decorator |
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
#!/usr/bin/python | |
from socket import socket, gethostbyname, AF_INET, SOCK_STREAM | |
from sys import argv, exit | |
from time import sleep | |
def waitfor(*ports, **kw): | |
timeout = kw.get('timeout', 30) | |
host = kw.get('host', 'localhost') |
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
from tribaspace.router import Router | |
path = '/foo/bar' | |
newreq = Request.blank(path=path, base_url=request.application_url) | |
newreq.registry = registry | |
markup = Router(registry).handle_request(newreq) | |
print markup.body |
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
from operator import attrgetter | |
def counter(): | |
count = 0 | |
while True: | |
yield count | |
count += 1 | |
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
from pytest import fixture, Class | |
@fixture(scope="session", autouse=True) | |
def sort_tests_by_class_name(request): | |
session = request.node | |
key = lambda item: item.getparent(Class).obj.__name__ | |
session.items[:] = sorted(session.items, key=key) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>com.devpi.devpi-server</string> | |
<key>ProgramArguments</key> | |
<array> |
OlderNewer