Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/env python
"""reproduce https://github.com/majek/puka/issues/34
starting 2 instances of this program reproduces the error in less than
20s on my machine
"""
import puka, os
#! /usr/bin/env py.test
import pytest
class Client(object):
def __init__(self, url):
self.usable = True
self.url = url
def __repr__(self):
return "Client %r" % self.__dict__
#!/usr/bin/python
"""WSGI server example"""
from gevent.pywsgi import WSGIServer
def application(env, start_response):
if env['PATH_INFO'] == '/':
start_response('200 OK', [('Content-Type', 'text/html')])
# demo file showing how to serve multiple collections under different
# paths and replacing the root view
# run 'gunicorn -w4 multi_pypi_custom_root:app_public'
import pypiserver
app_public = pypiserver.app("/home/ralf/packages/private")
app_private = pypiserver.app("/home/ralf/packages/public")
app_public.mount("/private", app_private)
[buildout]
eggs-directory = /home/ralf/.buildout/cache/eggs
download-cache = /home/ralf/.buildout/cache/download
extends-cache = /home/ralf/.buildout/extends
index = http://pypi/simple/
#! bin/buildout -c
[buildout]
extends = buildout.cfg
develop +=
../fscrawler
eggs +=
pympler
fscrawler
if __name__ == "__main__":
import sys, os
os.environ["PYTHONPATH"] = ":".join(sys.path)
idxcfg = config['wpde_idx']
ew = ElasticWeb(webcfg=WebConfig(), idxcfg=idxcfg)
.file "greenlet.c"
.text
.p2align 4,,15
.type green_is_gc, @function
green_is_gc:
.LFB148:
.cfi_startproc
cmpq $-1, 24(%rdi)
je .L3
xorl %eax, %eax
# allow to silence error reporting for certain 'expected exceptions'
# gevent prints a error report including a traceback for each failed
# greenlet. this is at times useful, but you're currently forced to
# either handle exceptions in those greenlets or live with the traceback
# on stderr.
# patch_gevent introduces a class variable 'expected_exceptions' to
# gevent's greenlet class. This is a tuple of exceptions for which no
# error report should be printed to stderr.
# Copyright (c) 2007-2009 PediaPress GmbH
# See README.rst for additional licensing information.
"""custom json encoder/decoder, which can handle metabook objects"""
from mwlib import metabook
try:
import simplejson as json
except ImportError: