pymod_main.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:pymod 作者: pymodproject 项目源码 文件源码
def start_new_project(self):
        """
        Starts up a new job.
        """
        self.initialize_project_data()
        # Cheks for PyMod configuration file.
        self.configuration_file_error = False

        # If it is not found, then treat this session as the first one and asks the user to input
        # the 'PyMod Directory' path before beginning the first PyMod job.
        if not os.path.isfile(self.cfg_file_path):
            self.show_first_time_usage_message()
            self.show_pymod_directory_selection_window()

        # The configuration file is found.
        else:
            try:
                # Check if there is 'pymod_temp_directory' left by the PyMod installer script.
                if not self.check_installer_script_temp_directory():
                    # Get values options for each PyMod tool and start a new PyMod job.
                    self.initialize_session()
                # If there is a 'pymod_temp_directory' (the installer script has been used before
                # this last PyMod session).
                else:
                    # The installer script was run before configuring PyMod for the first time (it
                    # left an empty configuratio file).
                    if self.check_empty_configuration_file():
                        self.show_first_time_usage_message()
                        self.show_pymod_directory_selection_window()
                    # The installer script was run after the first PyMod session (in order to
                    # install some missing tools).
                    else:
                        self.initialize_session()

            except Exception, e:
                self.show_configuration_file_error(e, "read")
                title = 'Configuration file repair'
                message = "Would you like to delete PyMod configuration file and build a new functional copy of it?"
                repair_choice = tkMessageBox.askyesno(title, message)
                self.configuration_file_error = True
                if repair_choice:
                    self.show_pymod_directory_selection_window()
                else:
                    self.main_window.destroy()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号