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


Python test_screen.run函数代码示例

本文整理汇总了Python中test_screen.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: pw_validated

            # self.spinner.show()
            # self.spinner.start()

        self.selection_changed(None)

    def pw_validated(self, unused, validated):
        pass

    def prepare(self, direction):
        self.translate_ui()
        self.show_all()
        if not nm.wireless_hardware_present():
            self.nmwidget.set_sensitive(False)
            btn = self.ui.get_object('use_wireless')
            btn.set_sensitive(False)

    def store_values():
        return True

# When testing, no _() is available
try:
    _("")
except NameError as err:
    def _(message):
        return message

if __name__ == '__main__':
    from test_screen import _, run

    run('Wireless')
开发者ID:codyzu,项目名称:Cnchi,代码行数:30,代码来源:wireless.py

示例2: _

            txt = _("Loading, please wait...")
        else:
            txt = ""
        self.labels['loading'].set_markup(txt)
        self.labels['loading'].queue_draw()
        misc.gtk_refresh()

    def store_values(self):
        self.forward_button.show()
        return True

    def prepare(self, direction):
        self.translate_ui()
        self.show_all()
        self.forward_button.hide()
        if self.disable_tryit:
            self.buttons['tryit'].set_sensitive(False)
        if direction == "backwards":
            self.show_loading_message(do_show=False)

# When testing, no _() is available
try:
    _("")
except NameError as err:
    def _(message):
        return message

if __name__ == '__main__':
    from test_screen import _, run
    run('Welcome')
开发者ID:WaWei,项目名称:ApricityOS,代码行数:30,代码来源:welcome.py

示例3: call

        # Store hostid
        hostid = call(["hostid"])
        if hostid:
            with open("/install/etc/hostid", "w") as hostid_file:
                hostid_file.write("{0}\n".format(hostid))

    def run_install(self, packages, metalinks):
        """ Start installation process """

        self.installation = install.Installation(
            self.settings, self.callback_queue, packages, metalinks, self.mount_devices, self.fs_devices
        )

        self.installation.start()


try:
    _("")
except NameError as err:

    def _(message):
        return message


if __name__ == "__main__":
    # When testing, no _() is available

    from test_screen import _, run

    run("zfs")
开发者ID:satriani-vai,项目名称:Cnchi,代码行数:30,代码来源:zfs.py

示例4: call

        hostid = call(["hostid"])
        if hostid:
            hostid_path = os.path.join(DEST_DIR, "etc/hostid")
            with open(hostid_path, "w") as hostid_file:
                hostid_file.write("{0}\n".format(hostid))

    def run_install(self, packages, metalinks):
        """ Start installation process """

        self.installation = install.Installation(
            self.settings,
            self.callback_queue,
            packages,
            metalinks,
            self.mount_devices,
            self.fs_devices)

        self.installation.start()

try:
    _("")
except NameError as err:
    def _(message):
        return message

if __name__ == '__main__':
    # When testing, no _() is available

    from test_screen import _, run
    run('zfs')
开发者ID:FrankDev14,项目名称:Cnchi,代码行数:30,代码来源:zfs.py

示例5: AutoRankmirrorsThread

        if not self.testing and not self.reflector_launched:
            # Launch reflector script to determine the 10 fastest mirrors
            self.thread = AutoRankmirrorsThread()
            self.thread.start()
            self.reflector_launched = True

        return True

    def prepare(self, direction):
        """ Load screen """
        self.translate_ui()
        self.show_all()

        self.forward_button.set_sensitive(self.check_all())

        # Set timer
        self.timeout_id = GLib.timeout_add(5000, self.on_timer)

# When testing, no _() is available
try:
    _("")
except NameError as err:
    def _(message):
        return message

if __name__ == '__main__':
    from test_screen import _, run

    run('Check')
开发者ID:WaWei,项目名称:ApricityOS,代码行数:29,代码来源:check.py

示例6: _

                self.error_label["password"],
                self.password_strength,
            )

        # Check if all fields are filled and ok
        all_ok = True
        ok_widgets = self.is_ok.values()
        if not self.settings.get("z_hidden"):
            for ok_widget in ok_widgets:
                (icon_name, icon_size) = ok_widget.get_stock()
                visible = ok_widget.get_visible()
                if visible == False or icon_name != "gtk-yes":
                    all_ok = False

        self.forward_button.set_sensitive(all_ok)


# When testing, no _() is available
try:
    _("")
except NameError as err:

    def _(message):
        return message


if __name__ == "__main__":
    from test_screen import _, run

    run("UserInfo")
开发者ID:nhold,项目名称:Cnchi,代码行数:30,代码来源:user_info.py

示例7: _

            if self.keyboard_variant['code']:
                cmd.extend(["-variant", self.keyboard_variant['code']])
                txt = _("Set keyboard to layout name '{0}' ({1}) and variant name '{2}' ({3})").format(
                    self.keyboard_layout['description'],
                    self.keyboard_layout['code'],
                    self.keyboard_variant['description'],
                    self.keyboard_variant['code'])
            else:
                txt = _("Set keyboard to layout name '{0}' ({1})").format(
                    self.keyboard_layout['description'],
                    self.keyboard_layout['code'])
            logging.debug(txt)

    def set_keyboard_widget_keymap(self):
        """ Pass current keyboard layout to the keyboard widget. """
        self.keyboard_widget.set_layout(self.keyboard_layout['code'])
        self.keyboard_widget.set_variant(self.keyboard_variant['code'])
        self.keyboard_widget.show_all()

# When testing, no _() is available
try:
    _("")
except NameError as err:
    def _(message):
        return message

if __name__ == '__main__':
    from test_screen import _, run

    run('Keymap')
开发者ID:KGkotzamanidis,项目名称:DSGos-Installer,代码行数:30,代码来源:keymap.py

示例8: AutoRankmirrorsProcess

        self.translate_ui()
        # Enable forward button
        self.forward_button.set_sensitive(True)
        self.show_all()

        # Launch rank mirrors process to optimize Arch and Antergos mirrorlists
        if not self.testing and not self.disable_rank_mirrors and not self.rank_mirrors_launched:
            proc = AutoRankmirrorsProcess()
            proc.daemon = True
            proc.name = "rankmirrors"
            proc.start()
            self.process_list.append(proc)
            self.rank_mirrors_launched = True
        else:
            logging.debug("Not running rank mirrors. This is discouraged.")


# When testing, no _() is available
try:
    _("")
except NameError as err:

    def _(message):
        return message


if __name__ == "__main__":
    from test_screen import _, run

    run("Language")
开发者ID:raneon,项目名称:Cnchi,代码行数:30,代码来源:language.py

示例9: empty_queue

            self.callback_queue.task_done()

        return True

    def empty_queue(self):
        """ Empties messages queue """
        while not self.callback_queue.empty():
            try:
                self.callback_queue.get_nowait()
                self.callback_queue.task_done()
            except queue.Empty:
                return

    @misc.raise_privileges
    def reboot(self):
        """ Reboots the system, used when installation is finished """
        os.system("sync")
        subprocess.call(["/usr/bin/systemctl", "reboot", "--force", "--no-wall"])

# When testing, no _() is available
try:
    _("")
except NameError as err:
    def _(message):
        return message

if __name__ == '__main__':
    from test_screen import _, run

    run('Slides')
开发者ID:blinkythebear,项目名称:Cnchi,代码行数:30,代码来源:slides.py

示例10: store_values

    def store_values(self):
        country = self.selected_country
        lang_code = self.settings.get("language_code")
        for mylocale in self.locales:
            if self.locales[mylocale] == country:
                self.settings.set("locale", mylocale)
                try:
                    import locale

                    locale.setlocale(locale.LC_ALL, mylocale)
                    logging.info(_("locale changed to : %s") % mylocale)
                except (ImportError, locale.Error):
                    logging.warning(_("Can't change to locale '%s'") % mylocale)

        return True


# When testing, no _() is available
try:
    _("")
except NameError as err:

    def _(message):
        return message


if __name__ == "__main__":
    from test_screen import _, run

    run("Location")
开发者ID:nhold,项目名称:Cnchi,代码行数:30,代码来源:location.py

示例11: store_values

    def store_values(self):
        country = self.selected_country
        lang_code = self.settings.get("language_code")
        for mylocale in self.locales:
            if self.locales[mylocale] == country:
                self.settings.set("locale", mylocale)
                try:
                    import locale
                    locale.setlocale(locale.LC_ALL, mylocale)
                    logging.info(_("locale changed to : %s") % mylocale)
                except (ImportError, locale.Error):
                    logging.warning(_("Can't change to locale '%s'") % mylocale)

        return True

    def get_prev_page(self):
        return _prev_page

    def get_next_page(self):
        return _next_page

# When testing, no _() is available
try:
    _("")
except NameError as err:
    def _(message): return message

if __name__ == '__main__':
    from test_screen import _,run
    run('Location')
开发者ID:triplem,项目名称:Cnchi,代码行数:30,代码来源:location.py

示例12: empty_queue

    def empty_queue(self):
        """ Empties messages queue """
        while self.callback_queue.empty() == False:
            try:
                event = self.callback_queue.get_nowait()
                self.callback_queue.task_done()
            except queue.Empty:
                return

    @misc.raise_privileges
    def reboot(self):
        """ Reboots the system, used when installation is finished """
        os.system("sync")
        subprocess.call(["/usr/bin/systemctl", "reboot", "--force", "--no-wall"])


# When testing, no _() is available
try:
    _("")
except NameError as err:

    def _(message):
        return message


if __name__ == "__main__":
    from test_screen import _, run

    run("Slides")
开发者ID:nhold,项目名称:Cnchi,代码行数:29,代码来源:slides.py

示例13: elif

        elif widget == self.entry['username']:
            username = self.entry['username'].get_text()
            self.validate('username', username)

        elif (widget == self.entry['password'] or
              widget == self.entry['verified_password']):
            validation.check_password(
                self.entry['password'],
                self.entry['verified_password'],
                self.image_is_ok['password'],
                self.error_label['password'],
                self.password_strength)

        # Check if all fields are filled and ok
        all_ok = True
        ok_widgets = self.image_is_ok.values()
        if not self.settings.get('z_hidden'):
            for ok_widget in ok_widgets:
                icon_name = ok_widget.get_property('icon-name')
                visible = ok_widget.is_visible()
                if not visible or icon_name == ICON_WARNING:
                    all_ok = False

        self.forward_button.set_sensitive(all_ok)


if __name__ == '__main__':
    from test_screen import _, run
    run('UserInfo')
开发者ID:EntityOS,项目名称:Cnchi,代码行数:29,代码来源:user_info.py

示例14: store_values

            label = self.ui.get_object("features_label")
            label.hide()

    def store_values(self):
        response = show.question(
            self.get_toplevel(),
            _("Are you REALLY sure you want to continue?"))
        if response != Gtk.ResponseType.YES:
            return False
        install_screen = self.get_install_screen()
        self.process = Process(install_screen, self.settings, self.callback_queue)
        self.process.start()
        return True

    def get_prev_page(self):
        page = "installation_" + self.settings.get('partition_mode')
        return page


# When testing, no _() is available
try:
    _("")
except NameError as err:
    def _(message):
        return message

if __name__ == '__main__':
    from test_screen import _, run

    run('Summary')
开发者ID:KGkotzamanidis,项目名称:DSGos-Installer,代码行数:30,代码来源:summary.py

示例15: get_next_page

            self.settings.set('partition_mode', 'automatic')

        return True

    def get_next_page(self):
        return self.next_page

    def on_automatic_radiobutton_toggled(self, widget):
        """ Automatic selected, enable all options """
        if widget.get_active():
            self.next_page = "installation_automatic"
            self.enable_automatic_options(True)

    def on_alongside_radiobutton_toggled(self, widget):
        """ Alongside selected, disable all automatic options """
        if widget.get_active():
            self.next_page = "installation_alongside"
            self.enable_automatic_options(False)

    def on_advanced_radiobutton_toggled(self, widget):
        """ Advanced selected, disable all automatic options """
        if widget.get_active():
            self.next_page = "installation_advanced"
            self.enable_automatic_options(False)


if __name__ == '__main__':
    from test_screen import _, run

    run('InstallationAsk')
开发者ID:Gyruman,项目名称:thus,代码行数:30,代码来源:ask.py


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