File: fbi_plugin.py

package info (click to toggle)
python-envisageplugins 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,616 kB
  • ctags: 1,970
  • sloc: python: 7,047; makefile: 11; sh: 11; lisp: 1
file content (49 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#-------------------------------------------------------------------------------
#  
#  wxPython Test Plugin. 
#  
#  Written by: David C. Morrill
#  
#  Date: 10/18/2005
#  
#  (c) Copyright 2005 by Enthought, Inc.
#  
#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------
#  Imports:  
#-------------------------------------------------------------------------------

import sys

from enthought.traits.api import push_exception_handler

from enthought.envisage.api import Plugin

from enthought.debug.fbi import enable_fbi, fbi

#-------------------------------------------------------------------------------
#  'FBIPlugin' class:  
#-------------------------------------------------------------------------------
    
class FBIPlugin ( Plugin ):
    """ FBIPython plugin. """
    
    #---------------------------------------------------------------------------
    #  'Plugin' interface:  
    #---------------------------------------------------------------------------

    def start ( self, application ):
        """ Starts the plugin. 
        """
        # Tell the FBI to wiretap all unauthorized exceptions:
        enable_fbi()
        push_exception_handler( handler = lambda obj, name, old, new: fbi(),
                                locked  = False,
                                main    = True )

    def stop ( self, application ):
        """ Stops the plugin. 
        """
        pass