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
meese is a built-in package. | |
Status: Built-in. | |
Summary: protect the impressionable young minds of America | |
Adds a hook to protect the impressionable young minds of America | |
from reading certain files in the Emacs distribution using Emacs. | |
This file is named after Ed Meese, the US Attorney General |
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
""" | |
AMP over WebSockets support. | |
""" | |
import json | |
import txws | |
from twisted.internet import defer, protocol | |
from twisted.python import log | |
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
class C1(object): | |
class __metaclass__(type): | |
def __new__(meta, name, bases, attrs): | |
attrs["sentinel"] = object() | |
return type(name, bases, attrs) | |
class C2(object): | |
class __metaclass__(type): | |
def __new__(meta, name, bases, attrs): | |
attrs["sentinel"] = object() |
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
import random | |
import StringIO | |
from zope import interface | |
from twisted.internet import abstract, defer, reactor | |
from twisted.web import client, http_headers, iweb | |
class _FileProducer(object): # pragma: no cover | |
""" |
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
class ComposedLocator(object): | |
""" | |
A responder locator that consists of other locators. | |
""" | |
interface.implements(amp.IResponderLocator) | |
class __metaclass__(type): | |
def __new__(meta, name, bases, attrs): | |
""" | |
Makes sure every subclass gets its own set of locator classes. |
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 twisted.protocols import amp | |
class NestedAMPBox(amp.AmpList): | |
def fromStringProto(self, inString, proto): | |
value, = amp.AmpList.fromStringProto(self, inString, proto) | |
return value | |
def toStringProto(self, inObject, proto): | |
return amp.AmpList.toStringProto(self, [inObject], proto) |
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 axiom import attributes, item, store | |
import jinja2 | |
import sys | |
from twisted.cred import checkers, portal | |
from twisted.conch import manhole, manhole_ssh | |
from twisted.internet import reactor | |
from twisted.python import log | |
from twisted.web import resource, server |
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
def _immediateResponder(f): | |
""" | |
A decorator for responder functions that should return immediately and | |
execute asynchronously, as a defense against timing attacks. | |
The responder decorator should be applied after (above) this decorator:: | |
@SomeCommand.responder | |
@_immediateResponder | |
def responder(...): |
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
1. Check Jenkins builders. | |
2. Get the latest revision: | |
% bzr pull | |
3. Bump version number in <Package>/<package>/_version.py | |
4. Write release notes in <Package>/NEWS.txt. Add version number and date. |
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 json import dumps, loads | |
from twisted.internet.defer import inlineCallbacks | |
from twisted.protocols.basic import NetstringReceiver | |
from twisted.python import log | |
class JSONRPCReceiver(NetstringReceiver): | |
def stringReceived(self, string): | |
try: | |
request = loads(string) |
OlderNewer