help.py

来自「LINUX下强大的文件管理器。遵循 GNU 协议。」· Python 代码 · 共 48 行

PY
48
字号
from zeroinstall.injector import autopolicy, model, readerimport rox, osfrom rox import filerdef get_impl_path(policy, impl):	if impl.id.startswith('.') or impl.id.startswith('/'):		return impl.id	elif impl.id.startswith('package:'):		return None	else:		impl_path = policy.get_implementation_path(impl)		assert impl_path		return impl_pathdef show_help(uri):	p = autopolicy.AutoPolicy(uri, download_only = True)	p.freshness = 0		# Don't check for updates	if p.need_download():		os.spawnlp(os.P_WAIT, '0launch', '0launch', '-d', uri)		reader.update_from_cache(p.get_interface(p.root))	p.recalculate()	iface = p.get_interface(uri)	impl = p.get_implementation(iface)	path = get_impl_path(p, impl)	# Get the help directory from the feed meta-data if possible	help = None	if hasattr(impl, 'metadata'):		docdir = impl.metadata.get('doc-dir', None)		if docdir:			help = os.path.join(path, docdir)	# Nothing in the feed. See if there's a Help directory next to the executable	if help is None:		if hasattr(impl, 'main'):			main = impl.main		else:			main = iface.main		assert main		help = os.path.join(path, os.path.dirname(main), 'Help')	if not os.path.isdir(help):		rox.alert('Sorry, this program has no documentation\n\n(%s directory missing)' % help)	else:		filer.open_dir(help)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?