python类information()的实例源码

Client.py 文件源码 项目:RFID-System 作者: DecaturMakers 项目源码 文件源码 阅读 18 收藏 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)
part2.py 文件源码 项目:Mac-Python-3.X 作者: L1nwatch 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def submitContact(self):
        name = self.nameLine.text()
        address = self.addressText.toPlainText()

        if name == "" or address == "":
            QMessageBox.information(self, "Empty Field",
                    "Please enter a name and address.")
            return

        if name not in self.contacts:
            self.contacts[name] = address
            QMessageBox.information(self, "Add Successful",
                    "\"%s\" has been added to your address book." % name)
        else:
            QMessageBox.information(self, "Add Unsuccessful",
                    "Sorry, \"%s\" is already in your address book." % name)
            return

        if not self.contacts:
            self.nameLine.clear()
            self.addressText.clear()

        self.nameLine.setReadOnly(True)
        self.addressText.setReadOnly(True)
        self.addButton.setEnabled(True)
        self.submitButton.hide()
        self.cancelButton.hide()
ovirtclient.py 文件源码 项目:ovirt-desktop-client 作者: nkovacne 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def change_status(self, rowid):
        """
            Description: If the user clicks on the column which determines VM's status, we'll allow them
                         to change VM's status. This method shows a confirmation dialog and if accepted,
                         it will be notified to oVirt.
            Arguments: The row id that has been clicked. This relationship is stored using the VmData class.
            Returns: Nothing
        """

        global conf

        self.lastclick = int(time())         # Last click timestamp update

        curvmstatus = self.vmdata[rowid].vmstatus
        if curvmstatus != 'up' and curvmstatus != 'down':
            QMessageBox.warning(None, _('apptitle') + ': ' + _('warning'), _('vm_in_unchangeable_status'))
            return

        reply = QMessageBox.question(None, _('apptitle') + ': ' + _('confirm'), '%s <b>%s</b>. %s: <b>%s</b>.' % (_('current_vm_status'), self.current_vm_status(curvmstatus), _('confirm_vm_status_change'), self.toggle_vm_action(curvmstatus)), QMessageBox.Yes | QMessageBox.No, QMessageBox.No)

        if reply == QMessageBox.Yes:
            try:
                vm = conf.OVIRTCONN.vms.get(id=self.vmdata[rowid].vmid)
            except ConnectionError:
                QMessageBox.critical(None, _('apptitle') + ': ' + _('error'), _('unexpected_connection_drop'))
                quit()

            if curvmstatus == 'up':
                try:
                    vm.shutdown()
                    QMessageBox.information(None, _('apptitle') + ': ' + _('success'), _('shutting_down_vm'))
                except RequestError:
                    QMessageBox.warning(None, _('apptitle') + ': ' + _('warning'), _('vm_in_unchangeable_status'))
            if curvmstatus == 'down':
                try:
                    vm.start()
                    QMessageBox.information(None, _('apptitle') + ': ' + _('success'), _('powering_up_vm'))
                except RequestError:
                    QMessageBox.warning(None, _('apptitle') + ': ' + _('warning'), _('vm_in_unchangeable_status'))
part2.py 文件源码 项目:examples 作者: pyqt 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def submitContact(self):
        name = self.nameLine.text()
        address = self.addressText.toPlainText()

        if name == "" or address == "":
            QMessageBox.information(self, "Empty Field",
                    "Please enter a name and address.")
            return

        if name not in self.contacts:
            self.contacts[name] = address
            QMessageBox.information(self, "Add Successful",
                    "\"%s\" has been added to your address book." % name)
        else:
            QMessageBox.information(self, "Add Unsuccessful",
                    "Sorry, \"%s\" is already in your address book." % name)
            return

        if not self.contacts:
            self.nameLine.clear()
            self.addressText.clear()

        self.nameLine.setReadOnly(True)
        self.addressText.setReadOnly(True)
        self.addButton.setEnabled(True)
        self.submitButton.hide()
        self.cancelButton.hide()
GUI.py 文件源码 项目:alignment_calculator 作者: andersas 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def help(self):
        helpmsg = "It may be helpful to hover the mouse cursor over\n";
        helpmsg += "items and text labels that you don't understand.";
        QMessageBox.information(self,'Nonadiabatic help',helpmsg);
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 18 收藏 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 项目源码 文件源码 阅读 26 收藏 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 项目源码 文件源码 阅读 17 收藏 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 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def remove_user(self):
        reply = message.information(self, 'Remove User?', remove_user_message, message.Ok, message.Cancel)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 21 收藏 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 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def subreddit_not_valid(self, sub):
        text = '%s is not a valid subreddit. Would you like to remove this sub from the subreddit list?' % sub
        reply = message.information(self, 'Invalid Subreddit', text, message.Yes, message.No)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 22 收藏 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 项目源码 文件源码 阅读 19 收藏 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 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def no_user_download_folder(self):
        text = 'The user you selected does not appear to have a download folder. This is likely because nothing has ' \
               'been downloaded for this user yet.'
        reply = message.information(self, 'Folder Does Not Exist', text, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 19 收藏 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 项目源码 文件源码 阅读 21 收藏 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 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def no_imgur_client(self):
        text = 'No Imgur client is detected. You must have an Imgur client in order to download content from ' \
               'imgur.com. Please see settings menu and click on the "Imgur Client Information" in the top right for ' \
               'instuctions on how to obtain an imgur client and enter its credentials for use with this application'
        reply = message.information(self, 'No Imgur Client', text, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def invalid_imgur_client(self):
        text = 'The Imgur client you are useing is not valid. Please see the imgur client dialog for instructions on ' \
               'how to obtain a valid client id and secret.  This dialog can be accessed through the settings menu'
        reply = message.information(self, 'Invalid Imgur Client', text, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def user_manual_not_found(self):
        text = 'The user manual cannot be found.  This is most likely because the manual has been moved from the ' \
               'expected location, or renamed to something the application is not expecting.  To correct the issue ' \
               'please move the user manual back to the source folder and ensure it is named ' \
               '"The Downloader For Reddit - User Manual.pdf"'
        reply = message.information(self, 'User Manual Not Found', text, message.Ok)
        return reply == message.Ok
Messages.py 文件源码 项目:DownloaderForReddit 作者: MalloyDelacroix 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def up_to_date_message(self):
        text = 'You are running the latest version of The Downloader for Reddit'
        reply = message.information(self, 'Up To Date', text, message.Ok)
        return reply == message.Ok
GUI.py 文件源码 项目:coliform-project 作者: uprm-research-resto 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def showImage(self, text):
        try:
            if text == 'Show Red':
                RPiCamera.showImage(self.rgb_array, 'r')
            elif text == 'Show Green':
                RPiCamera.showImage(self.rgb_array, 'g')
            elif text == 'Show Blue':
                RPiCamera.showImage(self.rgb_array, 'b')
            else:
                RPiCamera.showImage(self.rgb_array)
        except ValueError:
            mb = QMessageBox()
            mb.setIcon(QMessageBox.Information)
            mb.setWindowTitle('Error')
            mb.setText('Array not loaded, make sure you take picture or import an image first.')
            mb.setStandardButtons(QMessageBox.Ok)
            mb.show()
AfterManjaro.py 文件源码 项目:AfterFromManjaro 作者: hsmnzaydn 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def install(self):
        infoBox = QMessageBox()
        infoBox.setIcon(QMessageBox.Information)
        infoBox.setText("Your programs are being installed.Please wait")
        infoBox.setWindowTitle("Information")
        infoBox.setStandardButtons(QMessageBox.Ok)
        infoBox.exec_()
        #BashCommands.StartRun()
        self.getItems()
        infoBox = QMessageBox()
        infoBox.setIcon(QMessageBox.Information)
        infoBox.setText("Your programs installed  ")
        infoBox.setWindowTitle("Information")
        infoBox.setStandardButtons(QMessageBox.Ok)
        infoBox.exec_()


        # When clicked update button
dialogs.py 文件源码 项目:TrezorSymmetricFileEncryption 作者: 8go 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def printAbout(self):
        """
        Show window with about and version information.
        """
        msgBox = QMessageBox(QMessageBox.Information, "About",
            "About <b>" + basics.NAME + "</b>: <br><br>" + basics.NAME + " " +
            "is a file encryption and decryption tool using a Trezor hardware "
            "device for safety and security. Symmetric AES cryptography is used "
            "at its core. <br><br>" +
            "<b>" + basics.NAME + " Version: </b>" + basics.VERSION_STR +
            " from " + basics.VERSION_DATE_STR +
            "<br><br><b>Python Version: </b>" + sys.version.replace(" \n", "; ") +
            "<br><br><b>Qt Version: </b>" + QT_VERSION_STR +
            "<br><br><b>PyQt Version: </b>" + PYQT_VERSION_STR)
        msgBox.setIconPixmap(QPixmap(basics.LOGO_IMAGE))
        msgBox.exec_()
widgets.py 文件源码 项目:BigBrotherBot-For-UrT43 作者: ptitbigorneau 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def update_database(self):
        """
        Display the 'database update' dialog.
        """
        self.show()

        is_something_running = False
        for x in B3App.Instance().processes:
            if x.state() == QProcess.Running:
                is_something_running = True
                break

        if is_something_running:
            msgbox = QMessageBox()
            msgbox.setIcon(QMessageBox.Information)
            msgbox.setWindowTitle('NOTICE')
            msgbox.setText('Some B3 processes are still running: you need to terminate them to update B3 database.')
            msgbox.setStandardButtons(QMessageBox.Ok)
            msgbox.exec_()
        else:
            update = UpdateDatabaseDialog(self.centralWidget())
            update.show()
GUI.py 文件源码 项目:coliform-project 作者: uprm-research-resto 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def tempPlot(self):
        try:
            self.y_title_axis = ['Temperature Plot', 'Temperature vs Time', 't(s)', 'T(C)', 'Sensor']
            MultiPlot.Plot(self.tf, len(self.ids), self.y_title_axis)
        except KeyError:
            mb = QMessageBox()
            mb.setIcon(QMessageBox.Information)
            mb.setWindowTitle('Error')
            mb.setText('No temperature sensor connected.')
            mb.setStandardButtons(QMessageBox.Ok)
            mb.show()
GUI.py 文件源码 项目:coliform-project 作者: uprm-research-resto 项目源码 文件源码 阅读 15 收藏 0 点赞 0 评论 0
def pumppowerchange(self):
        try:
            if self.pumppwmvalue > 100:
                raise ValueError
            else:
                self.PUMPPWM.setIntensity(self.pumppwmvalue)
        except ValueError:
            mb = QMessageBox()
            mb.setIcon(QMessageBox.Information)
            mb.setWindowTitle('Error')
            mb.setText('Please type in a value between 0-100.')
            mb.setStandardButtons(QMessageBox.Ok)
            mb.show()
GUI.py 文件源码 项目:coliform-project 作者: uprm-research-resto 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def showPlots(self):
        try:
            RPiCamera.showPlot(self.rgb_array)
            self.statusbar = 'Ready'
        except ValueError:
            mb = QMessageBox()
            mb.setIcon(QMessageBox.Information)
            mb.setWindowTitle('Error')
            mb.setText('Array not loaded, make sure you take picture or import an image first.')
            mb.setStandardButtons(QMessageBox.Ok)
            mb.show()
__init__.py 文件源码 项目:gui_tool 作者: UAVCAN 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def spawn_window(parent, node, iface_name):
    driver = node.can_driver

    if not slcan_cli.CLIInterface.is_backend_supported(driver):
        mbox = QMessageBox(parent)
        mbox.setWindowTitle('Unsupported CAN Backend')
        mbox.setText('CAN Adapter Control Panel cannot be used with the current CAN backend.')
        mbox.setInformativeText('The current backend is %r.' % type(driver).__name__)
        mbox.setIcon(QMessageBox.Information)
        mbox.setStandardButtons(QMessageBox.Ok)
        mbox.show()     # Not exec() because we don't want it to block!
        return

    progress_dialog = QProgressDialog(parent)
    progress_dialog.setWindowTitle('CAN Adapter Control Panel Initialization')
    progress_dialog.setLabelText('Detecting CAN adapter capabilities...')
    progress_dialog.setMinimumDuration(800)
    progress_dialog.setCancelButton(None)
    progress_dialog.setRange(0, 0)
    progress_dialog.show()

    def supported_callback(supported):
        progress_dialog.close()

        if not supported:
            mbox = QMessageBox(parent)
            mbox.setWindowTitle('Incompatible CAN Adapter')
            mbox.setText('CAN Adapter Control Panel cannot be used with the connected adapter.')
            mbox.setInformativeText('Connected SLCAN adapter does not support CLI extensions.')
            mbox.setIcon(QMessageBox.Information)
            mbox.setStandardButtons(QMessageBox.Ok)
            mbox.show()     # Not exec() because we don't want it to block!
            return

        slcp = slcan_cli.ControlPanelWindow(parent, slcan_iface, iface_name)
        slcp.show()

    slcan_iface = slcan_cli.CLIInterface(driver)
    slcan_iface.check_is_interface_supported(supported_callback)
qt_main.py 文件源码 项目:MDT 作者: cbclab 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def _write_example_data(self):
        try:
            mdt.utils.get_example_data(self.outputFile.text())
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Information)
            msg.setText('The MDT example data has been written to {}.'.format(self.outputFile.text()))
            msg.setWindowTitle('Success')
            msg.exec_()
        except IOError as e:
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Critical)
            msg.setText(str(e))
            msg.setWindowTitle("File writing error")
            msg.exec_()
AfterManjaro.py 文件源码 项目:AfterFromManjaro 作者: hsmnzaydn 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def update(self):
        Update.Update()
        infoBox = QMessageBox()
        infoBox.setIcon(QMessageBox.Information)
        infoBox.setText("Updated")
        infoBox.setWindowTitle("Information")
        infoBox.setStandardButtons(QMessageBox.Ok)
        infoBox.exec_()

    # When clicked about button


问题


面经


文章

微信
公众号

扫码关注公众号