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


Python GLIUtility.generate_keymap_list方法代码示例

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


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

示例1: populate_keymap_combo

# 需要导入模块: import GLIUtility [as 别名]
# 或者: from GLIUtility import generate_keymap_list [as 别名]
	def populate_keymap_combo(self, default="us"):
		# Adds all the keymaps to the dropdown
		keymaps = GLIUtility.generate_keymap_list()
		
		for i in range(len(keymaps)):
			keymap = keymaps[i]
			self.keymap.append_text(keymap)
			
			# select the default
			if keymap == default:
				self.keymap.set_active(i)
开发者ID:bremen77jodypurba,项目名称:pentoo,代码行数:13,代码来源:RcDotConf.py

示例2: __init__

# 需要导入模块: import GLIUtility [as 别名]
# 或者: from GLIUtility import generate_keymap_list [as 别名]
	def __init__(self, controller):
		GLIScreen.GLIScreen.__init__(self, controller)

		vert    = gtk.VBox(False, 10) # This box is content so it should fill space to force title to top
		horiz   = gtk.HBox(False, 0)
		horiz2   = gtk.HBox(False, 0)
		horiz3   = gtk.HBox(False, 0)

		addme_to_vert = []
		
		# this code could be reduced, but would it make things any clearer?
		
		# create the CLOCK object
		self.clock = self.Option("Clock")
		self.clock.HelpText = "Should CLOCK be set to UTC or local? Unless you set your timezone to UTC you will want to choose local."
		self.clock.Options = ["UTC","local"]
		self.clock.Type = self.Option.OptionType.COMBO
		clock_gtk = self.clock.Generate_GTK()
		addme_to_vert.append(clock_gtk)
		
		# create the Windowkeys object
		self.windowkeys = self.Option("Windowkeys")
		self.windowkeys.HelpText = "Should we first load the 'windowkeys' console keymap?"
		self.windowkeys.Options = ["Yes","No"]
		self.windowkeys.Type = self.Option.OptionType.COMBO
		clock_gtk = self.windowkeys.Generate_GTK()
		addme_to_vert.append(clock_gtk)
		
		# create the Display Manager object
		self.displaymanager = self.Option("Display Manager")
		self.displaymanager.HelpText = "Choose your display manager for Xorg-x11 (note you must make sure that package also gets installed for it to work)"
		self.displaymanager.Options = ["xdm","kdm","gdm"]
		self.displaymanager.Type = self.Option.OptionType.COMBO_ENTRY
		clock_gtk = self.displaymanager.Generate_GTK()
		addme_to_vert.append(clock_gtk)
		
		# create the Default Editor object
		self.editor = self.Option("Default Editor")
		self.editor.HelpText = "Choose your default editor"
		self.editor.Options = ["/bin/nano","/usr/bin/vim","/usr/bin/emacs"]
		self.editor.Type = self.Option.OptionType.COMBO
		editor_gtk = self.editor.Generate_GTK()
		addme_to_vert.append(editor_gtk)

		# create the Keymap object
		self.keymap = self.Option("Keymap")
		self.keymap.HelpText = "Choose your desired keymap"
		self.keymap.Options = [""] + GLIUtility.generate_keymap_list()
		self.keymap.Type = self.Option.OptionType.COMBO
		editor_gtk = self.keymap.Generate_GTK()
		addme_to_vert.append(editor_gtk)

		# create the Console Font object
		self.font = self.Option("Console Font")
		self.font.HelpText = "Choose your default console font"
		self.font.Options = [""] + GLIUtility.generate_consolefont_list()
		self.font.Type = self.Option.OptionType.COMBO
		editor_gtk = self.font.Generate_GTK()
		addme_to_vert.append(editor_gtk)
		
		# create a last bogus one to make it look pretty.
		bogus = self.Option("")
		bogus.HelpText = ""
		bogus.Type = self.Option.OptionType.NONE
		bogus = bogus.Generate_GTK()
		addme_to_vert.append(bogus)
		
		# create the XSession object
		self.xsession = self.Option("XSession")
		self.xsession.HelpText = "Choose what window manager you want to start default with X if run with xdm, startx, or xinit. (common options are Gnome or Xsession)"
		self.xsession.Options = ["Gnome","Xsession","fluxbox"]
		self.xsession.Type = self.Option.OptionType.COMBO_ENTRY
		editor_gtk = self.xsession.Generate_GTK()
		addme_to_vert.append(editor_gtk)
		
		# create the Extended Keymaps object
		self.extkeymap = self.Option("Extended Keymaps")
		self.extkeymap.HelpText = "This sets the maps to load for extended keyboards. Most users will leave this as is."
		self.extkeymap.Type = self.Option.OptionType.TEXT
		editor_gtk = self.extkeymap.Generate_GTK()
		addme_to_vert.append(editor_gtk)
		
		addme_to_vert.reverse()
		for i,item in enumerate(addme_to_vert):
			if i< 3:
				horiz.pack_start(item, expand=True, fill=True, padding=10)
			elif i<6:
				horiz2.pack_start(item, expand=True, fill=True, padding=10)
			else:
				horiz3.pack_start(item, expand=True, fill=True, padding=10)
		
		self.add_content(horiz)
		self.add_content(horiz2)
		self.add_content(horiz3)
开发者ID:bremen77jodypurba,项目名称:pentoo,代码行数:96,代码来源:OtherSettings.py


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