📄 help.py
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -