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


Python Settings.show方法代码示例

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


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

示例1: MainWindow

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import show [as 别名]
class MainWindow(QtGui.QMainWindow, mainui):

    def __init__(self, parent = None):
        super(MainWindow, self).__init__(parent)
        self.mainui = mainui()
        self.mainui.setupUi(self)
        self.settings = Settings()
        self.com = 'COM1'
        self.channelID = '15'
        self.timeout = 30
        self.settings.comsettings.connect(self.change_settings)
        self.mainui.BasicTest.clicked.connect(self.basic_show)
        self.mainui.Settings.clicked.connect(self.settings_show)
        self.mainui.OldTest.clicked.connect(self.oldtest_show)
        self.mainui.DisconnectTest.clicked.connect(self.disconnect_show)

    def change_settings(self,setting):
        self.com = setting['com']
        self.channelID = setting['channelID']
        self.timeout = setting['timeout']
        print self.com,self.channelID,self.timeout


    def basic_show(self):
        self.basictest = BasicTest()
        self.basictest.com = self.com
        self.basictest.channelID = self.channelID
        self.basictest.timeout = self.timeout
        self.basictest.show()

    def settings_show(self):
        self.settings.show()

    def oldtest_show(self):
        self.oldtest = OldTest()
        self.oldtest.com = self.com
        self.oldtest.channelID = self.channelID
        self.oldtest.timeout = self.timeout
        self.oldtest.show()

    def disconnect_show(self):
        self.Distest = DisTest()
        self.Distest.com = self.com
        self.Distest.channelID = self.channelID
        self.Distest.timeout = self.timeout
        self.Distest.show()
开发者ID:ban666,项目名称:FacTools,代码行数:48,代码来源:main.py

示例2: settings

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import show [as 别名]
 def settings(self, params):
     settings = Settings(self._config, self._connection)
     settings.show()
开发者ID:Centurix,项目名称:Frontside,代码行数:5,代码来源:all_games.py

示例3: TestApp

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import show [as 别名]

#.........这里部分代码省略.........
        """""""""""""""""""""""""""
        Deletes the existing Downloads
        directory to check up to date
        files.
        """""""""""""""""""""""""""
        if os.path.exists("Downloads"):
            shutil.rmtree("Downloads")

        self.initialize_data()

        self.progressBar.setMaximum(len(data["data"]))
        self.progressBar.setValue(0)
        self.linePrint = LineExec(data["data"])
        self.connect(self.linePrint, SIGNAL("line_exec(PyQt_PyObject)"), self.line_exec)
        self.linePrint.start()
        self.stopBtn.setEnabled(True)
        self.stopBtn.clicked.connect(self.linePrint.terminate)

    def initialize_data(self):
        entry = {}
        with open('./data/words_prices.json') as codeLines_data:
            mainJson = json.load(codeLines_data)

        with open('./data/words_prices.json', 'w') as outfile:

            for txtUUID in self.txtFileUUID:
                uploaded_file = Resource(self.txtFilePath[self.txtFileUUID.index(txtUUID)], self.priceList)
                entry[txtUUID] = {'wordcount': uploaded_file.get_wordcount(),
                                  'reg_proj_price': uploaded_file.get_reg_project_price(),
                                  'expert_proj_price': uploaded_file.get_expert_project_price(),
                                  'proof_proj_price': uploaded_file.get_proof_proj_price(),
                                  'trranscrip_proj_price': uploaded_file.get_transcript_proj_price(),
                                  'combo_proj_price': uploaded_file.get_combo_price()}

                mainJson.append(entry)

            for fileUUID in self.uploadFileUUID:
                uploaded_file = Resource(self.testFilePath[self.uploadFileUUID.index(fileUUID)], self.priceList)
                entry[fileUUID] = {'wordcount': uploaded_file.get_wordcount(),
                                   'reg_proj_price': uploaded_file.get_reg_project_price(),
                                   'expert_proj_price': uploaded_file.get_expert_project_price(),
                                   'proof_proj_price': uploaded_file.get_proof_proj_price(),
                                   'trranscrip_proj_price': uploaded_file.get_transcript_proj_price(),
                                   'combo_proj_price': uploaded_file.get_combo_price()}
                mainJson.append(entry)

            json.dump(mainJson, outfile)

    def line_exec(self, line):
        if str.lower(line["method"]) == 'get':
            # payload initialization
            checkLine = GetMethod(line)
            checkLine.get_method(self.secretKey, self.publicKey, self.httpAddress, self.prevResponse,
                                 self.prevPayload, self.tableWidget, self.testFilePath, self.uploadFileUUID,
                                 self.txtFileUUID, self.errorNumber)

        # Post line code
        elif str.lower(line["method"]) == 'post':
            checkLine = PostMethod(line)
            checkLine.post_method(self.secretKey, self.publicKey, self.httpAddress, self.txtFilePath, self.txtFileUUID,
                                  self.testFilePath, self.uploadFileUUID, self.prevResponse, self.prevPayload,
                                  self.tableWidget, self.firstResourcesUpload, self.errorNumber)

        elif str.lower(line["method"]) == 'delete':
            checkLine = DeleteMethod(line)
            checkLine.delete_method(self.secretKey, self.publicKey, self.httpAddress, self.txtFilePath, self.txtFileUUID,
                                  self.testFilePath, self.uploadFileUUID, self.prevResponse, self.prevPayload,
                                  self.tableWidget, self.firstResourcesUpload, self.errorNumber)

        self.progressBar.setValue(self.progressBar.value() + 1)

    def file_open(self):
        self.new_line_window = NewLine(self.newLineTest)
        self.new_line_window.show()

    def check_the_code(self):
        self.check_code.show()

    def new_report(self):
        self.viewReport = ViewReport(self.tableWidget)
        self.viewReport.show()

    def close_application(self):
        # popup messegae before exiting
        choice = QtGui.QMessageBox.question(self, 'Quit', "Quit application?", QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)

        if choice == QtGui.QMessageBox.Yes:
            sys.exit()
        else:
            pass

    def settings_window(self):
        self.settings.show()

    def additional_window(self):
        self.additional_tests = AdditionalTesting()
        self.additional_tests.show()

    def callbacks_test(self):
        CallbacksTest(self.tableWidget, self.errorNumber)
开发者ID:yvgenyk,项目名称:API-Test2,代码行数:104,代码来源:main.py

示例4: MainWindow

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import show [as 别名]
class MainWindow(QtGui.QMainWindow):
    def __init__(self, app, testmode):
        self.app = app
        self.testmode = testmode
        self.paused = False
        self._tournament = None

        QtGui.QMainWindow.__init__(self)
        self.ui = MWClass()
        self.ui.setupUi(self)
        self.ui.nbattles_frame.hide()

        self.scene = Scene()
        view = self.ui.arenaview
        view.setScene(self.scene)
        self.scene.view = view
        view.show()

        self.start_game()

        self.debug_robot = None

        self.run_tournament(1)
        self.singleStep()

        self.ticktimer = self.startTimer(17)

        self.editors = []
        self._fdir = None

        self.setup_settings()

        # Call resize a bit later or else view will not resize properly
        self._initialresize = True
        QtCore.QTimer.singleShot(1, self.resizeEvent)

    def start_game(self):
        import game

        self.game = game.Game(self.testmode, self._tournament)
        self.game.w.v.scene = self.scene
        self.game.w.v.app = self.app
        self.game.w.v.rinfo = self.ui.rinfo
        self.game.w.v.setrend()
        self.game.load_robots()

        self.ui.countdown.display(conf.maxtime)

    def closeEvent(self, ev=None):
        self.killTimer(self.ticktimer)

        if len(self.game.procs) > 0:
            self.game.finish(False)
            stats.dbclose()

        doquit = True
        # Try to close any open editor windows
        for te in self.editors:
            if te.isVisible():
                te.close()

        # If any are still open, don't quit
        for te in self.editors:
            if te.isVisible():
                doquit = False

        if doquit:
            QtGui.qApp.quit()

    def startBattle(self):
        if self.paused:
            self.pauseBattle(False)

    def pauseBattle(self, ev):
        self.paused = ev
        if self.paused:
            self.ui.actionPause.setChecked(True)
            self.ui.actionStart_battle.setDisabled(False)
        else:
            self.ui.actionPause.setChecked(False)
            self.ui.actionStart_battle.setDisabled(True)

    def singleStep(self):
        self.pauseBattle(True)
        self.game.tick()
        if self.debug_robot is not None:
            self.update_debug_robot()

    def timerEvent(self, ev):
        if not self.paused:
            self.game.tick()
            if self.debug_robot is not None:
                self.update_debug_robot()

            if not self.game.rnd % 60:
                remaining = conf.maxtime - (self.game.rnd / 60)
                self.ui.countdown.display(remaining)

            if (self.game.rnd > 60 * conf.maxtime or
                    len(self.game.procs) <= 1):
#.........这里部分代码省略.........
开发者ID:YMIndustries,项目名称:pybotwar,代码行数:103,代码来源:qt4view.py

示例5: __init__

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import show [as 别名]
class GUIHandler:
    """
    Main class, loads the gui and handles all events.
    """

    def __init__(self):
        """
        Creates the main window.
        """

        # Gtk builder
        self.builder = gtk.Builder()
        self.builder.add_from_file(MAIN_GUI_FILE)
        self.builder.connect_signals(self)

        # Config and Marks
        self.config = Config()
        self.marks = Marks()

        # Settings window
        self.settings = Settings(self.config)

        # Loading the API
        cache_dir = self.config.get_key("cache_dir")
        if cache_dir[-1] == os.sep:
            cache_dir = cache_dir[:-1]
        self.pycavane = pycavane.Pycavane(cache_dir=cache_dir)

        # Load the player
        self.player = Player(self, self.config)

        # Attributes
        self.current_show = None
        self.current_seasson = None
        self.current_movies = {}

        # Getting the used widgets
        self.main_window = self.builder.get_object("mainWindow")
        self.statusbar_label = self.builder.get_object("statusbarLabel")
        self.progress_box = self.builder.get_object("progressBox")
        self.progress = self.builder.get_object("progress")
        self.progress_label = self.builder.get_object("progressLabel")
        self.name_filter = self.builder.get_object("nameFilter")
        self.name_filter_clear = self.builder.get_object("nameFilterClear")
        self.name_list = self.builder.get_object("nameList")
        self.name_model = self.name_list.get_model()
        self.file_viewer = self.builder.get_object("fileViewer")
        self.file_model = self.file_viewer.get_model()
        self.mode_combo = self.builder.get_object("modeCombo")
        self.search_entry = self.builder.get_object("searchEntry")
        self.search_button = self.builder.get_object("searchButton")
        self.search_clear = self.builder.get_object("searchClear")
        self.sidebar = self.builder.get_object("sidebarVbox")
        self.path_label = self.builder.get_object("pathLabel")
        self.info_window = self.builder.get_object("infoWindow")
        self.info_title = self.builder.get_object("infoTitle")
        self.info_label = self.builder.get_object("infoLabel")
        self.info_image = self.builder.get_object("infoImage")

        # Creating a new filter model to allow the user filter the
        # shows and movies by typing on an entry box
        self.name_model_filter = self.name_model.filter_new()
        self.name_model_filter.set_visible_func(generic_visible_func,
                                          (self.name_filter, NAME_COLUMN_TEXT))
        self.name_list.set_model(self.name_model_filter)

        # Keyboard shortcuts
        accel_group = gtk.AccelGroup()
        key, modifier = gtk.accelerator_parse("<Ctrl>W")
        accel_group.connect_group(key, modifier, gtk.ACCEL_VISIBLE,
                                  lambda a, b, c, d: gtk.main_quit())
        key, modifier = gtk.accelerator_parse("<Ctrl>Q")
        accel_group.connect_group(key, modifier, gtk.ACCEL_VISIBLE,
                                  lambda a, b, c, d: gtk.main_quit())
        self.main_window.add_accel_group(accel_group)

        # Now we show the window
        self.main_window.show_all()

        # Do the login if necesary
        user = self.config.get_key("cuevana_user")
        passwd = self.config.get_key("cuevana_pass")
        if user and passwd:
            self.background_task(self.pycavane.login, self.on_login_done,
                                 user, passwd, status_message="Login in...")

        # Setup the basic stuff
        self.setup()

    def setup(self):
        """
        Sets the default things.
        """

        self.current_seasson = None

        # Get and set the last used mode
        last_mode = self.config.get_key("last_mode")
        if last_mode not in MODES:
            last_mode = MODE_SHOWS
#.........这里部分代码省略.........
开发者ID:GunioRobot,项目名称:guicavane,代码行数:103,代码来源:gui_handler.py


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