~vishvananda/nova/network-refactor

« back to all changes in this revision

Viewing changes to vendor/Twisted-10.0.0/twisted/internet/main.py

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- test-case-name: twisted.test.test_app -*-
 
2
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
 
3
# See LICENSE for details.
 
4
 
 
5
 
 
6
"""Backwards compatability, and utility functions.
 
7
 
 
8
In general, this module should not be used, other than by reactor authors
 
9
who need to use the 'installReactor' method.
 
10
 
 
11
Maintainer: Itamar Shtull-Trauring
 
12
"""
 
13
 
 
14
import error
 
15
 
 
16
CONNECTION_DONE = error.ConnectionDone('Connection done')
 
17
CONNECTION_LOST = error.ConnectionLost('Connection lost')
 
18
 
 
19
def installReactor(reactor):
 
20
    # this stuff should be common to all reactors.
 
21
    import twisted.internet
 
22
    import sys
 
23
    assert not sys.modules.has_key('twisted.internet.reactor'), \
 
24
           "reactor already installed"
 
25
    twisted.internet.reactor = reactor
 
26
    sys.modules['twisted.internet.reactor'] = reactor
 
27
 
 
28
__all__ = ["CONNECTION_LOST", "CONNECTION_DONE", "installReactor"]