Skip to content

Instantly share code, notes, and snippets.

class _DELETED(object):
def __repr__(self):
return "DELETED"
DELETED = _DELETED()
def trans(patchSet, (filename, line)):
for patchFile in patchSet:
if patchFile.source_file == filename:
break
else:
import os
from ._lib import lib, ffi
def _check_error(errno):
if errno != 0:
raise OSError(errno, os.strerror(errno))
def unshare(flags):
res = lib.unshare(flags)
from StringIO import StringIO
from urllib import urlencode
from base64 import b64encode
from twisted.python.log import msg, err
from twisted.web.http_headers import Headers
from twisted.web.client import FileBodyProducer, Agent, readBody
from twisted.internet.defer import gatherResults
from buildbot.status.base import StatusReceiverService
@tomprince
tomprince / gist:167c7f3c1d647ec2195c
Last active August 29, 2015 14:02
Silent cache regeneration.
from twisted.plugin import IPlugin, getPlugins
from twisted.python.log import discardLogs
discardLogs()
list(getPlugins(IPlugin))
diff --git a/twisted/test/test_udp.py b/twisted/test/test_udp.py
index a4c155a..32b772e 100644
--- a/twisted/test/test_udp.py
+++ b/twisted/test/test_udp.py
@@ -557,6 +557,7 @@ class MulticastTestCase(unittest.TestCase):
joined.addCallback(cbNoPacket)
return joined
+ test_loopback.skip = "This test fails due to machine configuration."
# Upstart service for buildslave.
start on (local-filesystems and net-device-up IFACE!=lo)
exec /usr/bin/twistd -ny /srv/flocker-buildslave/slave/buildbot.tac
setuid flocker-buildslave
chdir /srv/flocker-buildslave/slave
[global]
download-cache = ~/.cache/pip/downloads
wheel-dir = /home/tomprince/.cache/pip/wheelhouse
use-wheel = true
find-links = file:///home/tomprince/.cache/pip/wheelhouse
from twisted.web import twcgi, static
class PHPScript(twcgi.FilteredScript):
filter = "/usr/bin/php-cgi"
resource = static.File("/usr/share/webapps/ganglia-web/3.5.2/htdocs/")
resource.processors = {
'.php': PHPScript,
}
resource.directoryListing = lambda : resource.getChild("index.php", None)
class _DELETED(object):
def __repr__(self):
return "DELETED"
DELETED = _DELETED()
def trans(patchSet, (filename, line)):
for patchFile in patchSet:
if patchFile.source_file == filename:
break
else:
def filteringObserver(target, observerName):
def observer(e):
if e.get("observer") == observerName:
target(e)
return observer
from twisted.python import log
def irc_observer(d):