本文整理汇总了Python中keyboard.Keyboard.get_model方法的典型用法代码示例。如果您正苦于以下问题:Python Keyboard.get_model方法的具体用法?Python Keyboard.get_model怎么用?Python Keyboard.get_model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类keyboard.Keyboard
的用法示例。
在下文中一共展示了Keyboard.get_model方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete
# 需要导入模块: from keyboard import Keyboard [as 别名]
# 或者: from keyboard.Keyboard import get_model [as 别名]
class MainWindow:
def delete(self, widget, event=None):
Gtk.main_quit()
return False
def next_page(self, widget, notebook):
page = self.notebook.get_current_page()
if page == 0:
self.lang.save_selection()
Kbbox = Gtk.VBox(False, 0)
Kbbox.show()
self.kb = Keyboard(self.button3)
get_kb = self.kb.get_model()
Kbbox.pack_start(get_kb, True, True, 0)
label = Gtk.Label("Keyboard")
self.notebook.insert_page(Kbbox, label, 1)
self.window.show_all()
self.notebook.next_page()
self.button1.set_sensitive(True)
self.button3.set_sensitive(False)
elif page == 1:
self.kb.save_selection()
Tbbox = Gtk.VBox(False, 0)
Tbbox.show()
self.tz = TimeZone(self.button3)
get_tz = self.tz.get_model()
Tbbox.pack_start(get_tz, True, True, 0)
label = Gtk.Label("TimeZone")
self.notebook.insert_page(Tbbox, label, 2)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(False)
elif page == 2:
self.tz.save_selection()
typebox = Gtk.VBox(False, 0)
typebox.show()
self.types = Types()
get_types = self.types.get_model()
typebox.pack_start(get_types, True, True, 0)
label = Gtk.Label("Types")
self.notebook.insert_page(typebox, label, 3)
self.window.show_all()
self.notebook.next_page()
elif page == 3:
if self.types.get_type() == "disk":
Udbox = Gtk.VBox(False, 0)
Udbox.show()
self.partition = UFSDisk(self.button3)
get_UD = self.partition.get_model()
Udbox.pack_start(get_UD, True, True, 0)
label = Gtk.Label("UFS Disk Configuration")
self.notebook.insert_page(Udbox, label, 4)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(False)
elif self.types.get_type() == "custom":
Pbox = Gtk.VBox(False, 0)
Pbox.show()
self.partition = Partitions(self.button3)
get_part = self.partition.get_model()
Pbox.pack_start(get_part, True, True, 0)
label = Gtk.Label("UFS Custom Configuration")
self.notebook.insert_page(Pbox, label, 4)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(False)
elif self.types.get_type() == "zfs":
Zbox = Gtk.VBox(False, 0)
Zbox.show()
self.partition = ZFS(self.button3)
get_ZFS = self.partition.get_model()
Zbox.pack_start(get_ZFS, True, True, 0)
label = Gtk.Label("ZFS Configuration")
self.notebook.insert_page(Zbox, label, 4)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(False)
elif page == 4:
self.partition.save_selection()
Rbox = Gtk.VBox(False, 0)
Rbox.show()
self.rootuser = RootUser(self.button3)
get_root = self.rootuser.get_model()
Rbox.pack_start(get_root, True, True, 0)
label = Gtk.Label("Root Password")
self.notebook.insert_page(Rbox, label, 5)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(False)
elif page == 5:
self.rootuser.save_selection()
Abox = Gtk.VBox(False, 0)
Abox.show()
self.adduser = AddUser(self.button3)
get_adduser = self.adduser.get_model()
Abox.pack_start(get_adduser, True, True, 0)
label = Gtk.Label("Adding User")
self.notebook.insert_page(Abox, label, 6)
self.button3.set_label("Install")
#.........这里部分代码省略.........
示例2: MainWindow
# 需要导入模块: from keyboard import Keyboard [as 别名]
# 或者: from keyboard.Keyboard import get_model [as 别名]
class MainWindow():
"""Main window class."""
def delete(self, widget, event=None):
"""Close the main window."""
if os.path.exists('/tmp/.gbi'):
shutil.rmtree('/tmp/.gbi')
Gtk.main_quit()
return False
def next_page(self, widget, notebook):
"""Go to the next window."""
page = self.notebook.get_current_page()
if page == 0:
self.lang.save_selection()
kbbox = Gtk.VBox(False, 0)
kbbox.show()
self.kb = Keyboard(self.button3)
get_kb = self.kb.get_model()
kbbox.pack_start(get_kb, True, True, 0)
label = Gtk.Label("Keyboard")
self.notebook.insert_page(kbbox, label, 1)
self.window.show_all()
self.notebook.next_page()
self.button1.set_sensitive(True)
self.button3.set_sensitive(True)
elif page == 1:
self.kb.save_selection()
tbbox = Gtk.VBox(False, 0)
tbbox.show()
self.tz = TimeZone(self.button3)
get_tz = self.tz.get_model()
tbbox.pack_start(get_tz, True, True, 0)
label = Gtk.Label("TimeZone")
self.notebook.insert_page(tbbox, label, 2)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(True)
elif page == 2:
self.tz.save_selection()
typebox = Gtk.VBox(False, 0)
typebox.show()
self.types = Types()
get_types = self.types.get_model()
typebox.pack_start(get_types, True, True, 0)
label = Gtk.Label("Types")
self.notebook.insert_page(typebox, label, 3)
self.window.show_all()
self.notebook.next_page()
elif page == 3:
if self.types.get_type() == "ufs":
partition_repos()
udbox = Gtk.VBox(False, 0)
udbox.show()
self.partition = use_ufs(self.button3)
get_ud = self.partition.get_model()
udbox.pack_start(get_ud, True, True, 0)
label = Gtk.Label("UFS Disk Configuration")
self.notebook.insert_page(udbox, label, 4)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(False)
elif self.types.get_type() == "custom":
partition_repos()
Pbox = Gtk.VBox(False, 0)
Pbox.show()
self.partition = Partitions(self.button3)
get_part = self.partition.get_model()
Pbox.pack_start(get_part, True, True, 0)
label = Gtk.Label("UFS Custom Configuration")
self.notebook.insert_page(Pbox, label, 4)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(False)
elif self.types.get_type() == "zfs":
Zbox = Gtk.VBox(False, 0)
Zbox.show()
self.partition = ZFS(self.button3)
get_ZFS = self.partition.get_model()
Zbox.pack_start(get_ZFS, True, True, 0)
label = Gtk.Label("ZFS Configuration")
self.notebook.insert_page(Zbox, label, 4)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(False)
elif page == 4:
self.partition.save_selection()
Mbox = Gtk.VBox(False, 0)
Mbox.show()
self.bootmanager = bootManager()
get_root = self.bootmanager.get_model()
Mbox.pack_start(get_root, True, True, 0)
label = Gtk.Label("Boot Option")
self.notebook.insert_page(Mbox, label, 5)
self.window.show_all()
self.notebook.next_page()
self.button3.set_sensitive(True)
elif page == 5:
Rbox = Gtk.VBox(False, 0)
Rbox.show()
#.........这里部分代码省略.........