python类Ok()的实例源码

case_editor.py 文件源码 项目:uitester 作者: IfengAutomation 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def run_btn_event(self):
        """
        click run button, show add_device_widget
        :return:
        """
        self.add_device_widget = AddDeviceWidget()  # add device
        self.add_device_widget.setWindowModality(Qt.ApplicationModal)
        self.device_and_data_signal.connect(self.add_device_widget.add_radio_to_widget, Qt.QueuedConnection)
        self.add_device_widget.run_editor_signal.connect(self.run_case, Qt.QueuedConnection)
        devices = []
        if self.is_running:
            self.stop_case()
        try:
            devices = self.tester.devices()
        except Exception as e:
            self.add_info_console("<font color='red'>" + str(e) + "</font>")
        if not devices:  # There is no device connected
            self.message_box.warning(self, "Message", "Please connect the device to your computer.", QMessageBox.Ok)
            return

        # get case data count
        if self.case_id is not None:
            self.case_data_count = self.case_data_manage.get_case_data_count(self.case_id)

        self.device_and_data_signal.emit(devices, self.case_data_count)
        self.add_device_widget.show()
Client.py 文件源码 项目:RFID-System 作者: DecaturMakers 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def connection():
    conn, data = SQL_Handler.connectToDatabase('fobs', form.UsernameField.text(), form.PasswordField.text(), 'localhost')
    if conn is not None:
        buildTable()
        form.close()
        form2.show()
        form2.logoutButton.clicked.connect(mainMenu)
        form2.refreshButton.clicked.connect(lambda: buildTable())
        form2.validationButton.clicked.connect(lambda: saveChanges())
    else:
        Q = QMessageBox()
        Q = QMessageBox.information(Q, 'Error', 'Connection failed.',
                                    QMessageBox.Ok)
reaper.py 文件源码 项目:reaper 作者: ScriptSmith 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def error_message(exception,
                      text="An error occurred when processing your request",
                      title="Error"):

        msg = QMessageBox()
        msg.setIcon(QMessageBox.Information)
        msg.setText(text)
        msg.setWindowTitle(title)
        msg.setDetailedText(str(exception))
        msg.setStandardButtons(QMessageBox.Ok)
        msg.exec_()
messagebox.py 文件源码 项目:Worksets 作者: DozyDolphin 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def setupUi(self, message_list):
        self.setGeometry(self.left, self.top, self.width, self.height)
        self.msg = QMessageBox()
        self.msg.setIcon(self.message_type[message_list[3]])
        self.msg.setWindowTitle('Worksets')
        self.msg.setText(message_list[0])
        self.msg.setInformativeText(message_list[1])
        self.msg.setDetailedText(message_list[2])
        self.msg.setStandardButtons(QMessageBox.Ok)
        self.msg.exec()
combobox_ports.py 文件源码 项目:Serial 作者: baronleonardo 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def showPopup(self):
        self.clear()
        self.updateList()

        if self.lst == []:
            QMessageBox.warning(self.parent, "Warning", "No device attached", QMessageBox.Ok, QMessageBox.NoButton)

        super(ComboBox_Ports, self).showPopup()
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def no_user_list(self):
        reply = message.warning(self, 'Warning', no_user_list_message, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def no_subreddit_list(self):
        reply = message.warning(self, 'No Subreddit List', no_subreddit_list_message, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def no_user_selected(self):
        reply = message.information(self, 'No User Selected', no_user_selected_message, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def no_subreddit_selected(self):
        reply = message.information(self, 'No Subreddit Selected', no_subreddit_selected_message, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def failed_to_save(self):
        reply = message.information(self, 'Save Failed', failed_to_save_message, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def remove_subreddit(self):
        reply = message.information(self, 'Remove Subreddit?', remove_subreddit_message, message.Ok, message.Cancel)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def remove_user_list(self):
        reply = message.warning(self, 'Remove User List?', remove_user_list_message, message.Ok, message.Cancel)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def remove_subreddit_list(self):
        reply = message.warning(self, 'Remove Subreddit List?', remove_subreddit_list_message, message.Ok, message.Cancel)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def not_valid_name(self):
        text = 'Sorry, that is not a valid name'
        reply = message.information(self, 'Invalid Name', text, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def name_in_list(self):
        text = 'That name is already in the list'
        reply = message.information(self, 'Existing Name', text, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def no_subreddit_download_folder(self):
        text = 'The subreddit you selected does not appear to have a download folder. This is likely because nothing ' \
               'has been downloaded for this subreddit yet.'
        reply = message.information(self, 'Folder Does Not Exist', text, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def no_users_downloaded(self):
        text = 'No users have been downloaded yet'
        reply = message.information(self, 'No Content', text, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 51 收藏 0 点赞 0 评论 0
def nothing_to_download(self):
        text = 'Nothing to download. Please add users or subreddits you would like to download from.'
        reply = message.information(self, 'Nothing to Download', text, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def downloader_running_warning(self):
        text = 'The user finder is still currently running.  Closing now may cause unexpected behaviour and corrupted ' \
               'files.  Are you sure you want to close?'
        reply = message.warning(self, 'User Finder Still Running', text, message.Ok, message.Cancel)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def restore_defaults_warning(self):
        text = 'Defaults have been restored. If you save now, any settings controlled from this window will be ' \
               'restored to their original values.\n\nAny user or subreddit who\'s custom settings have been changed ' \
               'will also be restored to their default values.\n\nDo you wish to proceed?'
        reply = message.warning(self, 'Defaults Restored', text, message.Ok, message.Cancel)
        return reply == message.Ok


问题


面经


文章

微信
公众号

扫码关注公众号