def _write_footer(self):
        """
        Displays result information about the process, blocking until the
        write is completed
        """

        formatted_result = self.proc.result.title()
        runtime = self.proc.finished - self.proc.started

        output = '> Elapsed: %0.3fs\n> Result: %s' % (runtime, formatted_result)

        event = threading.Event()
        self.panel.write(output, content_separator='\n', event=event)
        event.wait()

        package_events.notify(
            'Golang Build',
            'build_complete',
            BuildCompleteEvent(
                task='',
                args=list(self.proc.args),
                working_dir=self.proc.cwd,
                env=self.proc.env.copy(),
                runtime=runtime,
                result=self.proc.result
            )
        )
Exemplo n.º 2
0
    def _write_footer(self):
        """
        Displays result information about the process, blocking until the
        write is completed
        """

        formatted_result = self.proc.result.title()
        runtime = self.proc.finished - self.proc.started

        output = '> Elapsed: %0.3fs\n> Result: %s' % (runtime,
                                                      formatted_result)

        event = threading.Event()
        self.panel.write(output, content_separator='\n', event=event)
        event.wait()

        package_events.notify(
            'Golang Build', 'build_complete',
            BuildCompleteEvent(task='',
                               args=list(self.proc.args),
                               working_dir=self.proc.cwd,
                               env=self.proc.env.copy(),
                               runtime=runtime,
                               result=self.proc.result))
Exemplo n.º 3
0
def emit_event(event_type, payload, view=None, plugin=u'FileBrowser'):
    '''Notify our filesystem observer about changes in our views
    event_type
        Unicode object tells what happen, i.e start_refresh, finish_refresh, fold, view_closed, etc.
    payload
        some info for observer, e.g. id of view, list of paths, tuple of those things
        must be immutable object
    view
        sublime.View object or None
    plugin
        Unicode object tells who is sender, in order to address event to certain listener
        we have two different listeners for FileBrowser and FileBrowserWFS
        FileBrowser
            notifies observer about user actions to adjust scheduling paths
        FileBrowserWFS
            notifies FileSystemEventHandler about scheduled paths in order to schedule refresh when
            sth is changed on file system
    '''
    if package_events is None:
        return
    if view and not view.settings().get('dired_autorefresh', True):
        package_events.notify(plugin, u'stop_watch', view.id())
        return
    package_events.notify(plugin, event_type, payload)
Exemplo n.º 4
0
def emit_event(event_type, payload, view=None, plugin=u'FileBrowser'):
    '''Notify our filesystem observer about changes in our views
    event_type
        Unicode object tells what happen, i.e start_refresh, finish_refresh, fold, view_closed, etc.
    payload
        some info for observer, e.g. id of view, list of paths, tuple of those things
        must be immutable object
    view
        sublime.View object or None
    plugin
        Unicode object tells who is sender, in order to address event to certain listener
        we have two different listeners for FileBrowser and FileBrowserWFS
        FileBrowser
            notifies observer about user actions to adjust scheduling paths
        FileBrowserWFS
            notifies FileSystemEventHandler about scheduled paths in order to schedule refresh when
            sth is changed on file system
    '''
    if package_events is None:
        return
    if view and not view.settings().get('dired_autorefresh', True):
        package_events.notify(plugin, u'stop_watch', view.id())
        return
    package_events.notify(plugin, event_type, payload)