コード例 #1
0
ファイル: core_plugin.py プロジェクト: certik/hermes-gui
    def start(self):
        def open_file_later():
            window = self.application.workbench.windows[0]
            open_file(window, self.initial_filename)

        if self.initial_filename:
            do_after(1000, open_file_later)
コード例 #2
0
ファイル: traits_context.py プロジェクト: eraldop/blockcanvas
    def _context_is_modified ( self, event ):
        """ Handles the context modified event.
        """
        if self.context_notification_delay <= 0:
            self._process_context_modified_event( event )
        else:
            if event.reset:
                self._context_reset    = True
                self._context_modified = {}
            elif not self._context_reset:
                self._context_modified.update( dict.fromkeys( event.modified ) )

            self._context_added_removed( self._context_removed,
                                         self._context_added, event.removed )

            self._context_added_removed( self._context_added,
                                         self._context_removed, event.added )

            do_after( self.context_notification_delay,
                      self._propagate_context_modified )

        super( TraitsContext, self )._context_is_modified( event )
コード例 #3
0
    def _context_is_modified ( self, event ):
        """ Handles the context modified event.
        """
        if self.context_propagation_delay <= 0:
            super( DeferredContext, self )._context_is_modified( event )
        else:
            if event.reset:
                self._context_reset    = True
                self._context_modified = {}
            elif not self._context_reset:
                self._context_modified.update( dict.fromkeys( event.modified ) )

            self._context_changed.update( dict.fromkeys( event.changed ) )

            self._move_dict_items( self._context_removed,
                                   self._context_added, event.removed )

            self._move_dict_items( self._context_added,
                                   self._context_removed, event.added )

            # (Is this correct? cf. 'event.merge_context_modified_events'...)

            do_after( self.context_propagation_delay,
                      self._propagate_context_modified )