Beispiel #1
0
    def _enabled_set ( self, enabled ):
        """ Handles the 'enabled' facet being changed.
        """
        if enabled:
            sys.excepthook, self._excepthook = self.exception, sys.excepthook

            if not self.initialized:
                self.initialized = True

                # Modify the Facets event exception handler so we can handle
                # exceptions:
                try:
                    push_exception_handler(
                        handler            = lambda a, b, c, d: None,
                        reraise_exceptions = True,
                        main               = True,
                        locked             = True
                    )
                except:
                    print 'Could not set Facets notification exception handler'

                # Restore any persistent break points:
                file_name = self.saved_break_points.file_name
                self._bp_watch( file_name )
                self.break_points.restore()

                # Set up a file watch on the persistent break points file:
                file_watch.watch( self._bp_watch, file_name )
        else:
            sys.excepthook = self._excepthook
Beispiel #2
0
    def _file_name_set ( self, file_name, old ):
        """ Handles the 'file_name' facet being changed.
        """
        if old != '':
            file_watch.watch( self._update_file, old, remove = True )

        if self._update_file( file_name ):
            file_watch.watch( self._update_file, file_name )
    def _watched_file_name_set ( self, old, new ):
        """ Handles the 'watched_file_name' facet being changed.
        """
        if old != '':
            file_watch.watch( self.watched_file_name_updated, old,
                              remove = True )

        if new != '':
            file_watch.watch( self.watched_file_name_updated, new )

        self.watched_file_name_updated( new )