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


Python ConfigService.getUserFilename方法代码示例

本文整理汇总了Python中mantid.kernel.ConfigService.getUserFilename方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigService.getUserFilename方法的具体用法?Python ConfigService.getUserFilename怎么用?Python ConfigService.getUserFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mantid.kernel.ConfigService的用法示例。


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

示例1: closeEvent

# 需要导入模块: from mantid.kernel import ConfigService [as 别名]
# 或者: from mantid.kernel.ConfigService import getUserFilename [as 别名]
    def closeEvent(self, event):
        # Check whether or not to save project
        if not self.project.saved:
            # Offer save
            if self.project.offer_save(self):
                # Cancel has been clicked
                event.ignore()
                return

        # Close editors
        if self.editor.app_closing():
            # write out any changes to the mantid config file
            ConfigService.saveConfig(ConfigService.getUserFilename())
            # write current window information to global settings object
            self.writeSettings(CONF)
            # Close all open plots
            # We don't want this at module scope here
            import matplotlib.pyplot as plt  # noqa
            plt.close('all')

            app = QApplication.instance()
            if app is not None:
                app.closeAllWindows()

            # Kill the project recovery thread and don't restart should a save be in progress and clear out current
            # recovery checkpoint as it is closing properly
            self.project_recovery.stop_recovery_thread()
            self.project_recovery.closing_workbench = True
            self.project_recovery.remove_current_pid_folder()

            self.interface_manager.closeHelpWindow()

            event.accept()
        else:
            # Cancel was pressed when closing an editor
            event.ignore()
开发者ID:mantidproject,项目名称:mantid,代码行数:38,代码来源:mainwindow.py


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