File: exception_handler_view.py

package info (click to toggle)
python-enthoughtbase 3.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 960 kB
  • ctags: 1,034
  • sloc: python: 6,104; makefile: 9; sh: 5
file content (51 lines) | stat: -rw-r--r-- 1,575 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
50
51

from enthought.traits.ui.api import Group, Item, View

class ExceptionHandlerView( View ):
    """ Default trait view for the ExceptionHandler. """
    
    width = 400
    height = 240
    title = 'Application Error'
    kind='modal'
      
    def __init__(self):
        super(ExceptionHandlerView, self).__init__(
            self.get_general_group(),
            self.get_details_group(),
            buttons=['OK'],
            resizable = True,
            handler = self.get_handler()
            )

    def get_general_group(self):
        """ Returns the Group containing the most basic information about
        the error.
        """
        group = Group( Item( name='message', style='readonly'),
                       Item( name='exception_only_text', style='readonly'),
                       label='General',
                       show_labels=False
                     )
        return group
    
    def get_details_group(self):
        """ Returns the Group containing the all available information about
        the error including the stack trace.
        """
        group = Group( Item( name='message', style='readonly'),
                       Item( name='exception_text', style='readonly',
                             resizable = True
                             ),
                       label='Details',
                       show_labels=False,
                     )
        return group
    
    def get_handler(self):
        """ Returns the Handler for the View. 
        Default is None.
        """
        return None
        
### EOF