當前位置: 首頁>>代碼示例>>Python>>正文


Python Keyboard.get_model方法代碼示例

本文整理匯總了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")
#.........這裏部分代碼省略.........
開發者ID:angelescuo,項目名稱:gbi,代碼行數:103,代碼來源:gbiWindow.py

示例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()
#.........這裏部分代碼省略.........
開發者ID:GhostBSD,項目名稱:gbi,代碼行數:103,代碼來源:gbiWindow.py


注:本文中的keyboard.Keyboard.get_model方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。