예제 #1
0
파일: celery.py 프로젝트: llonchj/celery
    def get_command_info(self,
                         command,
                         indent=0,
                         prefix='',
                         color=None,
                         help=False):
        if help:
            help = '|' + text.indent(self.choices[command][1], indent + 4)
        else:
            help = None
        try:
            # see if it uses args.
            meth = getattr(self, command)
            return text.join([
                '|' + text.indent(
                    '{0}{1} {2}'.format(prefix, color(command), meth.__doc__),
                    indent),
                help,
            ])

        except AttributeError:
            return text.join([
                '|' + text.indent(prefix + str(color(command)), indent),
                help,
            ])
예제 #2
0
    def get_command_info(self, command, indent=0, prefix="", color=None, help=False):
        if help:
            help = "|" + text.indent(self.choices[command][1], indent + 4)
        else:
            help = None
        try:
            # see if it uses args.
            meth = getattr(self, command)
            return text.join(["|" + text.indent("%s%s %s" % (prefix, color(command), meth.__doc__), indent), help])

        except AttributeError:
            return text.join(["|" + text.indent(prefix + str(color(command)), indent), help])
예제 #3
0
 def get_command_info(
     cls,
     command,
     indent=0,
     prefix="",
     color=None,
     help=False,
     app=None,
     choices=None,
 ):
     if choices is None:
         choices = cls._choices_by_group(app)
     meta = choices[command]
     if help:
         help = "|" + text.indent(meta.help, indent + 4)
     else:
         help = None
     return text.join([
         "|" + text.indent(
             "{0}{1} {2}".format(prefix, color(command), meta.signature
                                 or ""),
             indent,
         ),
         help,
     ])
예제 #4
0
파일: celery.py 프로젝트: e98cuenc/celery
    def get_command_info(self, command, indent=0, prefix='', color=None,
            help=False):
        if help:
            help = '|' + text.indent(self.choices[command][1], indent + 4)
        else:
            help = None
        try:
            # see if it uses args.
            meth = getattr(self, command)
            return text.join([
                '|' + text.indent('{0}{1} {2}'.format(prefix, color(command),
                                                meth.__doc__), indent), help,
            ])

        except AttributeError:
            return text.join([
                '|' + text.indent(prefix + str(color(command)), indent), help,
            ])
예제 #5
0
파일: celery.py 프로젝트: leobantech/celery
 def get_command_info(self, command, indent=0, color=None):
     colored = term.colored().names[color] if color else lambda x: x
     obj = self.commands[command]
     if obj.leaf:
         return '|' + text.indent("celery %s" % colored(command), indent)
     return text.join([
         " ",
         '|' + text.indent("celery %s --help" % colored(command), indent),
         obj.list_commands(indent, "celery %s" % command, colored),
     ])
예제 #6
0
 def get_command_info(self, command, indent=0, color=None):
     colored = term.colored().names[color] if color else lambda x: x
     obj = self.commands[command]
     if obj.leaf:
         return '|' + text.indent('celery %s' % colored(command), indent)
     return text.join([
         ' ',
         '|' + text.indent('celery %s --help' % colored(command), indent),
         obj.list_commands(indent, 'celery %s' % command, colored),
     ])
예제 #7
0
파일: celery.py 프로젝트: llonchj/celery
 def get_command_info(self, command, indent=0, color=None):
     colored = term.colored().names[color] if color else lambda x: x
     obj = self.commands[command]
     cmd = 'celery {0}'.format(colored(command))
     if obj.leaf:
         return '|' + text.indent(cmd, indent)
     return text.join([
         ' ',
         '|' + text.indent('{0} --help'.format(cmd), indent),
         obj.list_commands(indent, 'celery {0}'.format(command), colored),
     ])
예제 #8
0
파일: celery.py 프로젝트: chrisw1229/celery
 def get_command_info(self, command, indent=0, color=None):
     colored = term.colored().names[color] if color else lambda x: x
     obj = self.commands[command]
     cmd = 'celery {0}'.format(colored(command))
     if obj.leaf:
         return '|' + text.indent(cmd, indent)
     return text.join([
         ' ',
         '|' + text.indent('{0} --help'.format(cmd), indent),
         obj.list_commands(indent, 'celery {0}'.format(command), colored),
     ])
예제 #9
0
파일: celery.py 프로젝트: frol/celery
 def get_command_info(self, command, indent=0, color=None):
     colored = term.colored().names[color] if color else lambda x: x
     obj = self.commands[command]
     cmd = "celery {0}".format(colored(command))
     if obj.leaf:
         return "|" + text.indent(cmd, indent)
     return text.join(
         [
             " ",
             "|" + text.indent("{0} --help".format(cmd), indent),
             obj.list_commands(indent, "celery {0}".format(command), colored),
         ]
     )
예제 #10
0
파일: celery.py 프로젝트: zxjly/celery
 def get_command_info(cls, command, indent=0,
                      color=None, colored=None, app=None):
     colored = term.colored() if colored is None else colored
     colored = colored.names[color] if color else lambda x: x
     obj = cls.commands[command]
     cmd = 'celery {0}'.format(colored(command))
     if obj.leaf:
         return '|' + text.indent(cmd, indent)
     return text.join([
         ' ',
         '|' + text.indent('{0} --help'.format(cmd), indent),
         obj.list_commands(indent, 'celery {0}'.format(command), colored,
                           app=app),
     ])
예제 #11
0
 def get_command_info(self, command,
                      indent=0, prefix='', color=None,
                      help=False, app=None, choices=None):
     if choices is None:
         choices = self._choices_by_group(app)
     meta = choices[command]
     if help:
         help = '|' + text.indent(meta.help, indent + 4)
     else:
         help = None
     return text.join([
         '|' + text.indent('{0}{1} {2}'.format(
             prefix, color(command), meta.signature or ''), indent),
         help,
     ])
예제 #12
0
 def get_command_info(cls, command,
                      indent=0, prefix='', color=None,
                      help=False, app=None, choices=None):
     if choices is None:
         choices = cls._choices_by_group(app)
     meta = choices[command]
     if help:
         help = '|' + text.indent(meta.help, indent + 4)
     else:
         help = None
     return text.join([
         '|' + text.indent('{0}{1} {2}'.format(
             prefix, color(command), meta.signature or ''), indent),
         help,
     ])