本文整理汇总了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')
示例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')
示例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")
示例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')
示例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')
示例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")
示例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')
示例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")
示例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')
示例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")
示例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')
示例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")
示例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')
示例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')
示例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')