Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: third_party/twisted_8_1/twisted/application/reactors.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/application/reactors.py
diff --git a/third_party/twisted_8_1/twisted/application/reactors.py b/third_party/twisted_8_1/twisted/application/reactors.py
deleted file mode 100644
index c15c9482027f23a3ee56e1612813a7c85c5ae634..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/application/reactors.py
+++ /dev/null
@@ -1,83 +0,0 @@
-# -*- test-case-name: twisted.test.test_application -*-
-# Copyright (c) 2006-2007 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-"""
-Plugin-based system for enumerating available reactors and installing one of
-them.
-"""
-
-from zope.interface import Interface, Attribute, implements
-
-from twisted.plugin import IPlugin, getPlugins
-from twisted.python.reflect import namedAny
-
-
-class IReactorInstaller(Interface):
- """
- Definition of a reactor which can probably be installed.
- """
- shortName = Attribute("""
- A brief string giving the user-facing name of this reactor.
- """)
-
- description = Attribute("""
- A longer string giving a user-facing description of this reactor.
- """)
-
- def install():
- """
- Install this reactor.
- """
-
- # TODO - A method which provides a best-guess as to whether this reactor
- # can actually be used in the execution environment.
-
-
-
-class NoSuchReactor(KeyError):
- """
- Raised when an attempt is made to install a reactor which cannot be found.
- """
-
-
-class Reactor(object):
- """
- @ivar moduleName: The fully-qualified Python name of the module of which
- the install callable is an attribute.
- """
- implements(IPlugin, IReactorInstaller)
-
-
- def __init__(self, shortName, moduleName, description):
- self.shortName = shortName
- self.moduleName = moduleName
- self.description = description
-
-
- def install(self):
- namedAny(self.moduleName).install()
-
-
-
-def getReactorTypes():
- """
- Return an iterator of L{IReactorInstaller} plugins.
- """
- return getPlugins(IReactorInstaller)
-
-
-
-def installReactor(shortName):
- """
- Install the reactor with the given C{shortName} attribute.
-
- @raise NoSuchReactor: If no reactor is found with a matching C{shortName}.
-
- @raise: anything that the specified reactor can raise when installed.
- """
- for installer in getReactorTypes():
- if installer.shortName == shortName:
- return installer.install()
- raise NoSuchReactor(shortName)
-
« no previous file with comments | « third_party/twisted_8_1/twisted/application/internet.py ('k') | third_party/twisted_8_1/twisted/application/service.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698