def help(self): if not hasattr(self.loop.widget, 'help'): return global_help = [(self.config.keymap.formatKeys(k), t) for (k, t) in mywid.GLOBAL_HELP] for d in self.config.dashboards.values(): global_help.append((keymap.formatKey(d['key']), d['name'])) parts = [('Global Keys', global_help), ('This Screen', self.loop.widget.help())] keylen = 0 for title, items in parts: for keys, text in items: keylen = max(len(keys), keylen) text = '' for title, items in parts: if text: text += '\n' text += title + '\n' text += '%s\n' % ('=' * len(title), ) for keys, cmdtext in items: text += '{keys:{width}} {text}\n'.format(keys=keys, width=keylen, text=cmdtext) dialog = mywid.MessageDialog('Help for %s' % version(), text) lines = text.split('\n') urwid.connect_signal(dialog, 'close', lambda button: self.backScreen()) self.popup(dialog, min_width=76, min_height=len(lines) + 4)
def help(self): if not hasattr(self.loop.widget, 'help'): return global_help = [(self.config.keymap.formatKeys(k), t) for (k, t) in mywid.GLOBAL_HELP] for d in self.config.dashboards.values(): global_help.append((keymap.formatKey(d['key']), d['name'])) parts = [('Global Keys', global_help), ('This Screen', self.loop.widget.help())] keylen = 0 for title, items in parts: for keys, text in items: keylen = max(len(keys), keylen) text = '' for title, items in parts: if text: text += '\n' text += title+'\n' text += '%s\n' % ('='*len(title),) for keys, cmdtext in items: text += '{keys:{width}} {text}\n'.format( keys=keys, width=keylen, text=cmdtext) dialog = mywid.MessageDialog('Help for %s' % version(), text) lines = text.split('\n') urwid.connect_signal(dialog, 'close', lambda button: self.backScreen()) self.popup(dialog, min_width=76, min_height=len(lines)+4)
def help(self): key = self.app.config.keymap.formatKeys commands = self.getCommands() ret = [(c[0], key(c[0]), c[1]) for c in commands] for k in self.app.config.reviewkeys.values(): action = ', '.join(['{category}:{value}'.format(**a) for a in k['approvals']]) ret.append(('', keymap.formatKey(k['key']), action)) return ret
def help(self): key = self.app.config.keymap.formatKeys commands = self.getCommands() ret = [(c[0], key(c[0]), c[1]) for c in commands] for k in self.app.config.reviewkeys.values(): action = ', '.join( ['{category}:{value}'.format(**a) for a in k['approvals']]) ret.append(('', keymap.formatKey(k['key']), action)) return ret
def help(self): key = self.app.config.keymap.formatKeys ret = [ (key(keymap.LOCAL_CHECKOUT), "Checkout the most recent revision into the local repo"), (key(keymap.DIFF), "Show the diff of the most recent revision"), (key(keymap.TOGGLE_HIDDEN), "Toggle the hidden flag for the current change"), (key(keymap.NEXT_CHANGE), "Go to the next change in the list"), (key(keymap.PREV_CHANGE), "Go to the previous change in the list"), (key(keymap.REVIEW), "Leave a review for the most recent revision"), (key(keymap.TOGGLE_HELD), "Toggle the held flag for the current change"), (key(keymap.TOGGLE_HIDDEN_COMMENTS), "Toggle display of hidden comments"), (key(keymap.SEARCH_RESULTS), "Back to the list of changes"), (key(keymap.TOGGLE_REVIEWED), "Toggle the reviewed flag for the current change"), (key(keymap.TOGGLE_STARRED), "Toggle the starred flag for the current change"), (key(keymap.LOCAL_CHERRY_PICK), "Cherry-pick the most recent revision onto the local repo"), (key(keymap.ABANDON_CHANGE), "Abandon this change"), (key(keymap.EDIT_COMMIT_MESSAGE), "Edit the commit message of this change"), (key(keymap.REBASE_CHANGE), "Rebase this change (remotely)"), (key(keymap.RESTORE_CHANGE), "Restore this change"), (key(keymap.REFRESH), "Refresh this change"), (key(keymap.EDIT_TOPIC), "Edit the topic of this change"), (key(keymap.SUBMIT_CHANGE), "Submit this change"), (key(keymap.CHERRY_PICK_CHANGE), "Propose this change to another branch"), ] for k in self.app.config.reviewkeys.values(): action = ', '.join(['{category}:{value}'.format(**a) for a in k['approvals']]) ret.append((keymap.formatKey(k['key']), action)) return ret
def help(self): key = self.app.config.keymap.formatKeys ret = [ (key(keymap.LOCAL_CHECKOUT), "Checkout the most recent revision into the local repo"), (key(keymap.DIFF), "Show the diff of the most recent revision"), (key(keymap.TOGGLE_HIDDEN), "Toggle the hidden flag for the current change"), (key(keymap.NEXT_CHANGE), "Go to the next change in the list"), (key(keymap.PREV_CHANGE), "Go to the previous change in the list"), (key(keymap.REVIEW), "Leave a review for the most recent revision"), (key(keymap.TOGGLE_HELD), "Toggle the held flag for the current change"), (key(keymap.TOGGLE_HIDDEN_COMMENTS), "Toggle display of hidden comments"), (key(keymap.SEARCH_RESULTS), "Back to the list of changes"), (key(keymap.TOGGLE_REVIEWED), "Toggle the reviewed flag for the current change"), (key(keymap.TOGGLE_STARRED), "Toggle the starred flag for the current change"), (key(keymap.LOCAL_CHERRY_PICK), "Cherry-pick the most recent revision onto the local repo"), (key(keymap.ABANDON_CHANGE), "Abandon this change"), (key(keymap.EDIT_COMMIT_MESSAGE), "Edit the commit message of this change"), (key(keymap.REBASE_CHANGE), "Rebase this change (remotely)"), (key(keymap.RESTORE_CHANGE), "Restore this change"), (key(keymap.REFRESH), "Refresh this change"), (key(keymap.EDIT_TOPIC), "Edit the topic of this change"), (key(keymap.SUBMIT_CHANGE), "Submit this change"), (key(keymap.CHERRY_PICK_CHANGE), "Propose this change to another branch"), ] for k in self.app.config.reviewkeys.values(): action = ', '.join( ['{category}:{value}'.format(**a) for a in k['approvals']]) ret.append((keymap.formatKey(k['key']), action)) return ret