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
ba6eccc19d
commit
e778c1423c
@ -1894,7 +1894,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
|
||||
|
||||
|
@ -86,23 +86,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-gtk2.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