Change the help shortcut to open online documentation hosted at readthedocs.org,
as it is not clear how to package the documentation in a way that satisfies debian rules.
This commit is contained in:
parent
310367811e
commit
3664a1ab73
@ -1892,7 +1892,7 @@ class Terminal(Gtk.VBox):
|
||||
def key_help(self):
|
||||
manual_index_page = manual_lookup()
|
||||
if manual_index_page:
|
||||
self.open_url('file://%s' % (manual_index_page))
|
||||
self.open_url(manual_index_page)
|
||||
|
||||
# End key events
|
||||
|
||||
|
@ -87,23 +87,17 @@ def has_ancestor(widget, wtype):
|
||||
|
||||
def manual_lookup():
|
||||
'''Choose the manual to open based on LANGUAGE'''
|
||||
prefix = os.path.join(os.sep, 'usr', 'share', 'doc', 'terminator')
|
||||
available_languages = ['en']
|
||||
base_url = 'http://terminator-gtk3.readthedocs.io/%s/latest/'
|
||||
target = 'en' # default to English
|
||||
if 'LANGUAGE' in os.environ:
|
||||
languages = os.environ['LANGUAGE'].split(':')
|
||||
for language in languages:
|
||||
full_path = os.path.join(prefix, 'html_%s' % (language), 'index.html')
|
||||
if os.path.isfile(full_path):
|
||||
dbg('Found %s manual' % (language))
|
||||
return full_path
|
||||
dbg('Couldn\'t find manual for %s language' % (language))
|
||||
if language in available_languages:
|
||||
target = language
|
||||
break
|
||||
|
||||
full_path = os.path.join(prefix, 'html', 'index.html')
|
||||
if os.path.isfile(full_path):
|
||||
dbg('Falling back to the default manual')
|
||||
return full_path
|
||||
else:
|
||||
dbg('I can\'t find any suitable manual')
|
||||
return None
|
||||
return base_url % target
|
||||
|
||||
def path_lookup(command):
|
||||
'''Find a command in our path'''
|
||||
|
Loading…
Reference in New Issue
Block a user