• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python api.information函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get_mne_root

def get_mne_root():
    """Get the MNE_ROOT directory

    Returns
    -------
    mne_root : None | str
        The MNE_ROOT path or None if the user cancels.

    Notes
    -----
    If MNE_ROOT can't be found, the user is prompted with a file dialog.
    If specified successfully, the resulting path is stored with
    mne.set_config().
    """
    mne_root = get_config('MNE_ROOT')
    problem = _mne_root_problem(mne_root)
    while problem:
        info = ("Please select the MNE_ROOT directory. This is the root "
                "directory of the MNE installation.")
        msg = '\n\n'.join((problem, info))
        information(None, msg, "Select the MNE_ROOT Directory")
        msg = "Please select the MNE_ROOT Directory"
        dlg = DirectoryDialog(message=msg, new_directory=False)
        if dlg.open() == OK:
            mne_root = dlg.path
            problem = _mne_root_problem(mne_root)
            if problem is None:
                set_config('MNE_ROOT', mne_root)
        else:
            return None

    return mne_root
开发者ID:MaelGarnotel,项目名称:mne-python,代码行数:32,代码来源:_file_traits.py


示例2: display_message

    def display_message(self, msg, title=None, is_error=False):
        """
        Display the specified message to the user.

        """

        # Ensure we record any reasons this method doesn't work.  Especially
        # since it's critical in displaying errors to users!
        try:

            # Attempt to identify the current application window.
            parent_window = None
            workbench = self.application.get_service('envisage.'
                'workbench.IWorkbench')
            if workbench is not None:
                parent_window = workbench.active_window.control

            # Display the requested message
            if is_error:
                error(parent_window, msg, title=title)
            else:
                information(parent_window, msg, title=title)

        except:
            logger.exception('Unable to display pop-up message')

        return
开发者ID:LRFrank,项目名称:envisage,代码行数:27,代码来源:ui_service.py


示例3: get_fs_home

def get_fs_home():
    """Get the FREESURFER_HOME directory

    Returns
    -------
    fs_home : None | str
        The FREESURFER_HOME path or None if the user cancels.

    Notes
    -----
    If FREESURFER_HOME can't be found, the user is prompted with a file dialog.
    If specified successfully, the resulting path is stored with
    mne.set_config().
    """
    fs_home = get_config('FREESURFER_HOME')
    problem = _fs_home_problem(fs_home)
    while problem:
        info = ("Please select the FREESURFER_HOME directory. This is the "
                "root directory of the freesurfer installation.")
        msg = '\n\n'.join((problem, info))
        information(None, msg, "Select the FREESURFER_HOME Directory")
        msg = "Please select the FREESURFER_HOME Directory"
        dlg = DirectoryDialog(message=msg, new_directory=False)
        if dlg.open() == OK:
            fs_home = dlg.path
            problem = _fs_home_problem(fs_home)
            if problem is None:
                set_config('FREESURFER_HOME', fs_home)
        else:
            return None

    return fs_home
开发者ID:MaelGarnotel,项目名称:mne-python,代码行数:32,代码来源:_file_traits.py


示例4: _get_hsp_raw

    def _get_hsp_raw(self):
        fname = self.hsp_file
        if not fname:
            return

        try:
            pts = read_hsp(fname)

            n_pts = len(pts)
            if n_pts > KIT.DIG_POINTS:
                msg = ("The selected head shape contains {n_in} points, "
                       "which is more than the recommended maximum ({n_rec}). "
                       "The file will be automatically downsampled, which "
                       "might take a while. A better way to downsample is "
                       "using FastScan.")
                msg = msg.format(n_in=n_pts, n_rec=KIT.DIG_POINTS)
                information(None, msg, "Too Many Head Shape Points")
                pts = _decimate_points(pts, 5)

        except Exception as err:
            error(None, str(err), "Error Reading Head Shape")
            self.reset_traits(['hsp_file'])
            raise
        else:
            return pts
开发者ID:Anevar,项目名称:mne-python,代码行数:25,代码来源:_kit2fiff_gui.py


示例5: _subjects_dir_changed

 def _subjects_dir_changed(self, old, new):
     if new and self.subjects == ['']:
         information(None, "The directory selected as subjects-directory "
                     "(%s) does not contain any valid MRI subjects. MRI "
                     "subjects need to contain head surface models which "
                     "can be created by running:\n\n    $ mne "
                     "make_scalp_surfaces" % self.subjects_dir,
                     "No Subjects Found")
开发者ID:JuliaSprenger,项目名称:mne-python,代码行数:8,代码来源:_file_traits.py


示例6: close

 def close(self, info, is_ok):
     if info.object.kit2fiff_panel.queue.unfinished_tasks:
         msg = ("Can not close the window while saving is still in "
                "progress. Please wait until all files are processed.")
         title = "Saving Still in Progress"
         information(None, msg, title)
         return False
     else:
         return True
开发者ID:Anevar,项目名称:mne-python,代码行数:9,代码来源:_kit2fiff_gui.py


示例7: _subjects_dir_changed

 def _subjects_dir_changed(self, old, new):
     if new and self.subjects == ['']:
         information(None, "The directory selected as subjects-directory "
                     "(%s) does not contain any valid MRI subjects. If "
                     "this is not expected make sure all MRI subjects have "
                     "head surface model files which "
                     "can be created by running:\n\n    $ mne "
                     "make_scalp_surfaces" % self.subjects_dir,
                     "No Subjects Found")
开发者ID:nfoti,项目名称:mne-python,代码行数:9,代码来源:_file_traits.py


示例8: close

 def close(self, info, is_ok):
     if info.object.queue.unfinished_tasks:
         information(
             None,
             "Can not close the window while saving is still "
             "in progress. Please wait until all MRIs are "
             "processed.",
             "Saving Still in Progress",
         )
         return False
     else:
         return True
开发者ID:rajegannathan,项目名称:grasp-lift-eeg-cat-dog-solution-updated,代码行数:12,代码来源:_coreg_gui.py


示例9: cite

 def cite(self):
     from pyface.api import information
     import os
     try:
         basedir = os.path.dirname(os.path.realpath(__file__)) + '/'
     except NameError:  #__file__ not defined if this is main script
         basedir = ''
     fname = basedir + 'data/cite.txt'
     citations = open(fname, 'r').read()
     msg = u'You are encouraged to cite in your papers one (or all) of the following:\n\n\n' + \
             unicode(citations, 'utf-8').replace(u'\ufeff', '')
     information(None, msg, title = "Citing ffnet/ffnetui")
开发者ID:mrkwjc,项目名称:ffnetui,代码行数:12,代码来源:ffnetapp.py


示例10: _on_exit

    def _on_exit(self):
        """ Called when the exit action is invoked. """

        parent = self.control

        print(choose_one(parent, "Make a choice", ['one', 'two', 'three']))

        information(parent, 'Going...')
        warning(parent, 'Going......')
        error(parent, 'Gone!')

        if confirm(parent, 'Should I exit?') == YES:
            self.close()
开发者ID:bergtholdt,项目名称:pyface,代码行数:13,代码来源:dialog.py


示例11: _on_exit

    def _on_exit(self):
        """ Called when the exit action is invoked. """

        parent = self.control

        information(parent, 'Going...')
        warning(parent, 'Going......')
        error(parent, 'Gone!')

        if confirm(parent, 'Should I exit?') == YES:
            self.close()

        return
开发者ID:OspreyX,项目名称:pyface,代码行数:13,代码来源:dialog.py


示例12: _save

    def _save(self, project, parent_window, prompt_for_location=False):
        """
        Save the specified project.  If *prompt_for_location* is True,
        or the project has no known location, then the user is prompted to
        provide a location to save to.

        Returns True if the project was saved successfully, False if not.

        """

        location = project.location.strip()

        # If the project's existing location is valid, check if there are any
        # autosaved versions.
        autosave_loc = ''
        if location is not None and os.path.exists(location):
            autosave_loc = self._get_autosave_location(location)

        # Ask the user to provide a location if we were told to do so or
        # if the project has no existing location.
        if prompt_for_location or location is None or len(location) < 1:
            location = self._get_user_location(project, parent_window)
            # Rename any existing autosaved versions to the new project
            # location.
            if location is not None and len(location) > 0:
                self._clean_autosave_location(location)
                new_autosave_loc = self._get_autosave_location(location)
                if os.path.exists(autosave_loc):
                    shutil.move(autosave_loc, new_autosave_loc)

        # If we have a location to save to, try saving the project.
        if location is not None and len(location) > 0:
            try:
                project.save(location)
                saved = True
                msg = '"%s" saved to %s' % (project.name, project.location)
                information(parent_window, msg, 'Project Saved')
                logger.debug(msg)

            except Exception as e:
                saved = False
                logger.exception('Error saving project [%s]', project)
                error(parent_window, str(e), title='Save Error')
        else:
            saved = False

        # If the save operation was successful, delete any autosaved files that
        # exist.
        if saved:
            self._clean_autosave_location(location)
        return saved
开发者ID:enthought,项目名称:envisage,代码行数:51,代码来源:ui_service.py


示例13: close

 def close(self, info, is_ok):  # noqa: D102
     if info.object.kit2fiff_panel.queue.unfinished_tasks:
         msg = ("Can not close the window while saving is still in "
                "progress. Please wait until all files are processed.")
         title = "Saving Still in Progress"
         information(None, msg, title)
         return False
     else:
         # store configuration, but don't prevent from closing on error
         try:
             info.object.save_config()
         except Exception as exc:
             warn("Error saving GUI configuration:\n%s" % (exc,))
         return True
开发者ID:jhouck,项目名称:mne-python,代码行数:14,代码来源:_kit2fiff_gui.py


示例14: on_export

 def on_export(self):
     """
     Shows a dialog to export a file
     """
     
     information(None, "This will save exactly what you see on the screen "
                       "to a file. Choose the file type via the file " 
                       "extension (ie .png, .pdf, .jpg)", "Export")
     
     dialog = FileDialog(parent = self.window.control,
                         action = 'save as')
     
     if dialog.open() == OK:
         self.view.export(dialog.path)
开发者ID:adam-urbanczyk,项目名称:cytoflow,代码行数:14,代码来源:flow_task.py


示例15: scanning_step

    def scanning_step(self):

        if self.icCamera.init_active:
            information(parent=None, title="please wait",
             message="The initialization of the camera is running. " + \
             "Please wait until the initialization is finished.")
            return False

        #self.icCryo.cryo_refresh=False
        self.finished=False
        self.x_koords=[]
        self.y_koords=[]
        self.spectra=[]
        self.used_centerwvl=[]
        self.used_grating=[]
        self.apd_counts=[]

        if self.x1>self.x2:
            self.x2,self.x1 = self.x1,self.x2

        if self.y1>self.y2:
            self.y1,self.y2=self.y2,self.y1

        if self.ivSpectro.exit_mirror=='front (CCD)': #ueberprueft ob spiegel umgeklappt bzw falls nicht klappt er ihn um
             self.ivSpectro.exit_mirror='side (APDs)'#self.ivSpectro.exit_mirror_value[1

        self.icCryo.waiting() #wartet bis cryo bereit

        #TODO das hier gehört nach cryo
        # [x,y] = self.icCryo.get_numeric_position()
        #x,y=self.icCryo.convert_output(self.icCryo.position())

        x_pos,y_pos = self.calc_snake_xy_pos()

        for i in range(len(x_pos)):
            if self.finished:
                break # abort condition
            self.icCryo.move(x_pos[i],y_pos[i])
            self.icCryo.waiting()
            # get actuall position, maybe x_pos[i] != x
            x,y=self.icCryo.pos()
            if self.threshold_counts < self.icVoltage.measure()/self.VoltPerCount: # vergleicht schwellenspannung mit aktueller
                self.take_spectrum(x,y)
            self.plot_map(x,y)

        self.finished = True
        print 'searching finish'
开发者ID:ottodietz,项目名称:qdsearch,代码行数:47,代码来源:qdsearch.py


示例16: run

    def run(self, application):
        """
        Run this runnable.

        Overridden here to: (a) ensure the UI service monitors for the
        closing of the application, and (b) restore the last opened
        project.

        """

        # Ensure our UI service is listening for the application to close.
        # FIXME: This ugly hack (doing this here) is necessary only because
        # this plugin contributes to the workbench plugin and that means the
        # workbench insists on starting us first which means our UI service
        # can't directly reference the workbench service until after
        # everything has been started.
        ui_service = application.get_service(IPROJECT_UI)
        ui_service.listen_for_application_exit()

        # Load the project we were using when we last shutdown.
        model_service = application.get_service(IPROJECT_MODEL)
        location = model_service.preferences.get('project location',
            default=None)
        if location and len(location) > 0:
            logger.info("Opening last project from location [%s]", location)

            try:
                project = model_service.factory.open(location)
            except:
                logger.exception('Error during opening of last project.')
                project = None

            if project is not None:
                model_service.project = project
            else:
                information(self._get_parent_window(application),
                    'Unable to open last project from location:\t\n'
                    '\t%s\n'  % (location) + '\n\n'
                    'The project may no longer exist.',
                    'Can Not Open Last Project',
                    )

        else:
            logger.info('No previous project to open')

        return
开发者ID:enthought,项目名称:envisage,代码行数:46,代码来源:project_runnable.py


示例17: _test_stim_fired

    def _test_stim_fired(self):
        try:
            events = self.model.get_event_info()
        except Exception as err:
            error(None, "Error reading events from SQD data file: %s (Check "
                  "the terminal output for details)" % str(err),
                  "Error Reading events from SQD file")
            raise err

        if len(events) == 0:
            information(None, "No events were found with the current "
                        "settings.", "No Events Found")
        else:
            lines = ["Events found (ID: n events):"]
            for id_ in sorted(events):
                lines.append("%3i: \t%i" % (id_, events[id_]))
            information(None, '\n'.join(lines), "Events in SQD File")
开发者ID:kaichogami,项目名称:mne-python,代码行数:17,代码来源:_kit2fiff_gui.py


示例18: _get_root_home

def _get_root_home(cfg, name, check_fun):
    root = get_config(cfg)
    problem = check_fun(root)
    while problem:
        info = "Please select the %s directory. This is the root " "directory of the %s installation." % (cfg, name)
        msg = "\n\n".join((problem, info))
        information(None, msg, "Select the %s Directory" % cfg)
        msg = "Please select the %s Directory" % cfg
        dlg = DirectoryDialog(message=msg, new_directory=False)
        if dlg.open() == OK:
            root = dlg.path
            problem = check_fun(root)
            if problem is None:
                set_config(cfg, root)
        else:
            return None
    return root
开发者ID:TanayGahlot,项目名称:mne-python,代码行数:17,代码来源:_file_traits.py


示例19: close

    def close(self, info, isok):
        app = info.object  # convenience
        app.sensor.disconnect()
        file_name = os.path.join(ETSConfig.get_application_home(True),
                                 'sensor_output %s.csv' % str(datetime.datetime.now()).replace(':', '-'))
        # make sure directory exists.
        if not os.path.exists(ETSConfig.get_application_home(False)):
            os.makedirs(ETSConfig.get_application_home(False))
        arr = np.array(app.sensor.history)

        if not arr.size:
            return isok

        np.savetxt(file_name,
                   arr)
        msg = 'Output (size %s) saved to %s.' % (str(arr.shape), file_name)
        logging.info(msg)
        from pyface.api import information
        information(info.ui.control, msg, title='Array saved to disk.')
        return isok
开发者ID:derekrazo,项目名称:OpenBCI,代码行数:20,代码来源:run.py


示例20: on_problem

    def on_problem(self):
        
        information(None, "Your email client will now create a new message to the "
                    "developer.  Debugging logs are attached.  Please fill "
                    "out the template bug report and send -- thank you for "
                    "reporting a bug!")
        
#         import tempfile
        log = guiutil.parent_log.getvalue()
        log += self.model.get_child_log()
# 
#         logfile = tempfile.NamedTemporaryFile(delete = False)
#         logfile.write(parent_log)
#         logfile.write(child_log)
#         logfile.close()
        
        versions = ["{0} {1}".format(key, value) for key, value in self._get_package_versions().iteritems()]

        body = """
Thank you for your bug report!  Please fill out the following template.

PLATFORM (Mac, PC, Linux, other):

OPERATING SYSTEM (eg OSX 10.7, Windows 8.1):

SEVERITY (Critical? Major? Minor? Enhancement?):

DESCRIPTION:
  - What were you trying to do?
  - What happened?
  - What did you expect to happen?
  

PACKAGE VERSIONS: {0}

DEBUG LOG: {1}
""".format(versions, log)

        mailto.mailto("[email protected]", 
                      subject = "Cytoflow bug report",
                      body = body)
开发者ID:adam-urbanczyk,项目名称:cytoflow,代码行数:41,代码来源:flow_task.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python api.FileDialog类代码示例发布时间:2022-05-25
下一篇:
Python api.error函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap