当前位置: 首页>>代码示例>>Python>>正文


Python do_later.do_later函数代码示例

本文整理汇总了Python中pyface.timer.do_later.do_later函数的典型用法代码示例。如果您正苦于以下问题:Python do_later函数的具体用法?Python do_later怎么用?Python do_later使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了do_later函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: app_factory

def app_factory():
    '''
        assemble the plugins 
        return a Pychron WorkbenchApplication
    '''
    plugins = [
               CorePlugin(),
               WorkbenchPlugin(),
               PychronWorkbenchPlugin(),
               PychronWorkbenchUIPlugin(),
               ]

    plugins += get_hardware_plugins()
    plugins += get_user_plugins()

    app = Pychron(plugins=plugins)

    gLoggerDisplay.application = app
    gMessageDisplay.application = app
    gWarningDisplay.application = app
    gTraceDisplay.application = app

    if globalv.open_logger_on_launch:
        do_later(gLoggerDisplay.open_view, gLoggerDisplay)

    return app
开发者ID:softtrainee,项目名称:arlab,代码行数:26,代码来源:pychron_run.py

示例2: _open_individual

    def _open_individual(self, si):
        si = self._record_factory(si)

        if isinstance(si, str):
            si = self._record_factory(si)
        else:
            si.selector = self

        if not si.initialize():
            return

        sid = si.record_id
        try:
            si.load_graph()
            si.window_x = self.wx
            si.window_y = self.wy
            def do(si, sid):
                self.debug('{}'.format(si))
                info = si.edit_traits()
                self._open_window(sid, info)

            self.debug('do later open')
            do_later(do, si, sid)

        except Exception, e:
            import traceback
            traceback.print_exc()
            self.warning(e)
开发者ID:softtrainee,项目名称:arlab,代码行数:28,代码来源:database_selector.py

示例3: _update_editor

    def _update_editor(self, editor, editor_factory,
                       identifier, aliquot, layout=True,
                       use_date_range=False, calculate_age=False):
        if editor is None:
            editor = editor_factory()
        #     if layout:
        #         self.task.split_editors(-2, -1)
        # else:
        #     if not self._polling:
        #         self.task.activate_editor(editor)

        #gather analyses
        tool=None
        if hasattr(editor, 'search_tool'):
            tool = editor.search_tool

        ans = self._get_analyses(tool, identifier,
                                 aliquot, use_date_range)
        ans = self._sort_analyses(ans)

        if calculate_age:
            for ai in ans:
                ai.calculate_age()

        editor.set_items(ans, update_graph=False)
        group_analyses_by_key(editor.analyses, 'labnumber')

        editor.clear_aux_plot_limits()
        do_later(editor.rebuild)
        # editor.rebuild()
        return editor
开发者ID:UManPychron,项目名称:pychron,代码行数:31,代码来源:system_monitor_editor.py

示例4: check

    def check(self):
        '''
        '''
        local_info = None
        major = None
        minor = None

        # get the local version info

        if os.path.isfile(self.local_path):
            with open(self.local_path, 'rb') as f:
                local_info = pickle.load(f)

        if os.path.isfile(self.src_path):

        # get the version_info associated with the src code

            with open(self.src_path, 'rb') as f:
                f.readline()
                line = f.readline()
                major = line.split('=')[1].strip()

                line = f.readline()
                minor = line.split('=')[1].strip()

                self.version_info = VersionInfo(major=major,
                        minor=minor)
                f.readline()
                p = []
                ps = []
                new_para = False
                for line in f:
                    line = line.strip()
                    if new_para:
                        ps.append(p)
                        p = []
                        new_para = False

                    if len(line) > 0:
                        if len(p) == 0 and line[0] == '#':
                            line = '<h5><u>{}</u></h5>'.format(line[1:])
                        p.append(line)
                    else:
                        new_para = True

                self.version_info.text = \
                    ''.join(['<p>{}</p>'.format(pj) for pj in
                            [' '.join(pi) for pi in ps if len(pi) > 0]])

        if minor is not None and major is not None:
            mismatch = True
            if local_info is not None:
                mismatch = local_info.version != '.'.join((major,
                        minor))

            if mismatch:
                if local_info is not None:
                    self.local_version = local_info.version
            elif local_info is None:
                do_later(self.edit_traits, kind='modal')
开发者ID:softtrainee,项目名称:arlab,代码行数:60,代码来源:version_info.py

示例5: open_power_graph

    def open_power_graph(self, rid, path=None):
        if self.power_graph is not None:
            self.power_graph.close()
            del(self.power_graph)

        g = StreamGraph(
                    window_x=0.01,
                    window_y=0.4,
                    container_dict=dict(padding=5),
#                        view_identifier='pychron.fusions.power_graph'
                    )
        self.power_graph = g

        g.window_title = 'Power Readback - {}'.format(rid)
        g.new_plot(data_limit=60,
                   scan_delay=1,
                   xtitle='time (s)',
                   ytitle='power (%)',

                   )
        g.new_series()

        if self.record_brightness:
            g.new_series()

        do_later(self._open_power_graph, g)
开发者ID:softtrainee,项目名称:arlab,代码行数:26,代码来源:fusions_laser_manager.py

示例6: _current_task_name_changed

    def _current_task_name_changed(self, new):
        print 'task change {} {}, no_update {}'.format(id(self), new, self._no_update)
        if self._no_update:
            return

        func = getattr(self, 'activate_{}_task'.format(new.lower()))
        do_later(func)
开发者ID:OSUPychron,项目名称:pychron,代码行数:7,代码来源:analysis_edit_task.py

示例7: _print_results

    def _print_results(self):
        def wrapper(display, *args):
            display.freeze()
            display.clear(gui=False)
            for ai in args:
                ai(display)
            display.thaw()

        def func():
            wrapper(self.signal_display,
                    self._print_signals,
                    self._print_baselines
                    )
            wrapper(self.ratio_display,
                    self._print_ratios,
                    self._print_blanks
                    )
            wrapper(self.summary_display,
                    self._print_summary
                    )
            wrapper(self.fit_display,
                    self._print_fits
                    )

        do_later(func)
开发者ID:softtrainee,项目名称:arlab,代码行数:25,代码来源:plot_panel.py

示例8: close_valve

    def close_valve(self, name, **kw):
        if not self._close_logic(name):
            self.debug('logic failed')
            do_later(self.warning_dialog, 'Close Valve Failed. Prevented by safety logic')
            return False, False

        if self.switch_manager:
            return self.switch_manager.close_switch(name, **kw)
开发者ID:NMGRL,项目名称:pychron,代码行数:8,代码来源:furnace_manager.py

示例9: _listen

    def _listen(self):
        self._otime = self.otime
        while self._alive:
            time.sleep(1 / self._freq)
            if self._check():
                do_later(self._callback)
#                self._callback()
                self._otime = self.otime
开发者ID:softtrainee,项目名称:arlab,代码行数:8,代码来源:file_listener.py

示例10: _set_message

    def _set_message(self, v):
        if v:
            self.console = '{}\n{}'.format(self.console, self.format_message(v))

            do_later(self.trait_set, message='')
            cmd = self.process_command(v)
            if isinstance(cmd, str):
                self._update_console(cmd)
开发者ID:UManPychron,项目名称:pychron,代码行数:8,代码来源:foobot.py

示例11: show

    def show(self, **kw):
        args = tuple()
        if not self.initialized:
            func = self.edit_traits
        else:
            func = self.trait_set
            kw['raised'] = True

        do_later(func, *args, **kw)
开发者ID:softtrainee,项目名称:arlab,代码行数:9,代码来源:viewable.py

示例12: do_grapher

def do_grapher(args):
    op = args.o[0]
    g = Grapher()

    g.load(args.datafile[0], args.kind[0])
    if op:
        do_later(g.graph.save_pdf, op)

    g.configure_traits()
开发者ID:softtrainee,项目名称:arlab,代码行数:9,代码来源:grapher.py

示例13: _add_marker_button_fired

    def _add_marker_button_fired(self):
#        self.add_recording_marker()
#        xs = self.graph.get_data('x0')
        def do():
            xs = self.graph.plots[0].data.get_data('x0')

            self.record_data_manager.write_to_frame(tuple(' '))
            self.graph.add_vertical_rule(xs[-1])
        do_later(do)
开发者ID:softtrainee,项目名称:arlab,代码行数:9,代码来源:scan_manager.py

示例14: _open_graph

    def _open_graph(self, graph=None):
        def _open(graph):
            if graph is None:
                graph = self.graph

            ui = graph.edit_traits()
            if self.parent:
                self.parent.add_window(ui)
        do_later(_open, graph=graph)
开发者ID:softtrainee,项目名称:arlab,代码行数:9,代码来源:power_calibration_manager.py

示例15: _reset_connection_label

    def _reset_connection_label(self, d):
        def func():
            self._connected_label = 'Not Tested'
            self._connected_color = 'orange'

        if d:
            do_later(func)
        else:
            func()
开发者ID:NMGRL,项目名称:pychron,代码行数:9,代码来源:connection_preferences.py


注:本文中的pyface.timer.do_later.do_later函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。