コード例 #1
0
ファイル: app.py プロジェクト: bradleyjones/gertty
 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)
コード例 #2
0
ファイル: app.py プロジェクト: bradleyjones/gertty
def main():
    parser = argparse.ArgumentParser(
        description='Console client for Gerrit Code Review.')
    parser.add_argument('-c', dest='path',
                        default=config.DEFAULT_CONFIG_PATH,
                        help='path to config file')
    parser.add_argument('-d', dest='debug', action='store_true',
                        help='enable debug logging')
    parser.add_argument('--no-sync', dest='no_sync', action='store_true',
                        help='disable remote syncing')
    parser.add_argument('--fetch-missing-refs', dest='fetch_missing_refs',
                        action='store_true',
                        help='fetch any refs missing from local repos')
    parser.add_argument('--print-keymap', nargs=0, action=PrintKeymapAction,
                        help='print the keymap command names to stdout')
    parser.add_argument('--print-palette', nargs=0, action=PrintPaletteAction,
                        help='print the palette attribute names to stdout')
    parser.add_argument('--version', dest='version', action='version',
                        version=version(),
                        help='show zuul version')
    parser.add_argument('-p', dest='palette', default='default',
                        help='Color palette to use')
    parser.add_argument('-k', dest='keymap', default='default',
                        help='Keymap to use')
    parser.add_argument('server', nargs='?',
                        help='the server to use (as specified in config file)')
    args = parser.parse_args()
    g = App(args.server, args.palette, args.keymap, args.debug, args.no_sync,
            args.fetch_missing_refs, args.path)
    g.run()
コード例 #3
0
ファイル: app.py プロジェクト: bradleyjones/gertty
 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)
コード例 #4
0
ファイル: app.py プロジェクト: bradleyjones/gertty
def main():
    parser = argparse.ArgumentParser(
        description='Console client for Gerrit Code Review.')
    parser.add_argument('-c',
                        dest='path',
                        default=config.DEFAULT_CONFIG_PATH,
                        help='path to config file')
    parser.add_argument('-d',
                        dest='debug',
                        action='store_true',
                        help='enable debug logging')
    parser.add_argument('--no-sync',
                        dest='no_sync',
                        action='store_true',
                        help='disable remote syncing')
    parser.add_argument('--fetch-missing-refs',
                        dest='fetch_missing_refs',
                        action='store_true',
                        help='fetch any refs missing from local repos')
    parser.add_argument('--print-keymap',
                        nargs=0,
                        action=PrintKeymapAction,
                        help='print the keymap command names to stdout')
    parser.add_argument('--print-palette',
                        nargs=0,
                        action=PrintPaletteAction,
                        help='print the palette attribute names to stdout')
    parser.add_argument('--version',
                        dest='version',
                        action='version',
                        version=version(),
                        help='show zuul version')
    parser.add_argument('-p',
                        dest='palette',
                        default='default',
                        help='Color palette to use')
    parser.add_argument('-k',
                        dest='keymap',
                        default='default',
                        help='Keymap to use')
    parser.add_argument('server',
                        nargs='?',
                        help='the server to use (as specified in config file)')
    args = parser.parse_args()
    g = App(args.server, args.palette, args.keymap, args.debug, args.no_sync,
            args.fetch_missing_refs, args.path)
    g.run()
コード例 #5
0
ファイル: app.py プロジェクト: ahnan4arch/gertty
 def help(self):
     if not hasattr(self.frame.body, 'help'):
         return
     global_help = self.getGlobalHelp()
     parts = [('Global Keys', global_help),
              ('This Screen', self.frame.body.help())]
     keylen = 0
     for title, items in parts:
         for cmd, 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 cmd, 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)
コード例 #6
0
 def help(self):
     if not hasattr(self.frame.body, 'help'):
         return
     global_help = self.getGlobalHelp()
     parts = [('Global Keys', global_help),
              ('This Screen', self.frame.body.help())]
     keylen = 0
     for title, items in parts:
         for cmd, 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 cmd, 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)