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


Python GLIUtility.get_grp_pkgs_from_cd方法代码示例

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


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

示例1: draw_screen

# 需要导入模块: import GLIUtility [as 别名]
# 或者: from GLIUtility import get_grp_pkgs_from_cd [as 别名]
	def draw_screen(self):
		content_str = """
This is where you emerge extra packages that your system may need. Packages that
are fetch-restricted (e.g. sun-jdk) or require you to accept licenses (e.g. many
big games) will cause your install to fail. Add additional packages with
caution. These trouble packages can be installed manually after you reboot.
"""
		
		# pack the description
		self.vert.pack_start(gtk.Label(content_str), expand=False, fill=False, padding=5)
		
		scrolled_window = gtk.ScrolledWindow(hadjustment=None, vadjustment=None)
		scrolled_window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
		
		# store the objects for later ( when loading )
		self.category_objects = {}
		self.package_objects = {}
		
		self.categories = self.controller.install_profile.get_install_package_list()
		self.group_packages = GLIUtility.get_grp_pkgs_from_cd()
		
		# first load the category
		for category in self.categories:
			categ = self.Category(category)
			self.category_objects[category] = categ
			hbox = categ.Generate_GTK()
			self.vert2.pack_start(hbox,expand=False,fill=False,padding=0)
			
			# then load the packages in that category
			packages = self.categories[category][1]
			for package in packages:
				# group_packages may be in the format category/package or just package
				if "/" in package:
					displayname = package[package.index("/")+1:]
				else:
					displayname = package
				
				# if its a grp install, append (GRP) to the name
				if self.controller.install_profile.get_grp_install():
					if package in self.group_packages:
						displayname = displayname + " (GRP)"
						
				pack = self.Package(self, package, packages[package], displayname)
				self.package_objects[package] = pack
				hbox = pack.Generate_GTK()
				self.vert2.pack_start(hbox,expand=False,fill=False,padding=0)
		
		# add the custom space-seperated list bar
		entry_description = gtk.Label("Enter a space seperated list of extra packages to install on the system ( in addition to those checked above ):")
		self.entry=gtk.Entry()

		scrolled_window.add_with_viewport(self.vert2)
		viewport = scrolled_window.get_children()[0]
		viewport.set_shadow_type (gtk.SHADOW_IN)
		viewport.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse ("white"))
		
		self.vert.pack_start(scrolled_window,expand=True,fill=True,padding=0)
		self.vert.pack_start(entry_description,expand=False,fill=False,padding=0)
		self.vert.pack_start(self.entry,expand=False,fill=False,padding=0)
		self.vert.show_all()
		self.add_content(self.vert)
开发者ID:bremen77jodypurba,项目名称:pentoo,代码行数:63,代码来源:ExtraPackages.py


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