Example #1
0
 def format_type(self):
     if (
             self.typ is not util.identity
             and not issubclass(self.typ, six.string_types)
         ):
         return '=' + util.name_type2cli(self.typ)
     return ''
Example #2
0
 def help_parens(self):
     """Puts the value type in parenthesis since it isn't shown in
     the parameter's signature."""
     if self.conv is not identity:
         yield 'type: ' + util.name_type2cli(self.conv)
     for s in super(PositionalParameter, self).help_parens():
         yield s
Example #3
0
 def help_parens(self):
     """Puts the value type in parenthesis since it isn't shown in
     the parameter's signature."""
     if self.conv is not identity:
         yield 'type: ' + util.name_type2cli(self.conv)
     for s in super(PositionalParameter, self).help_parens():
         yield s
Example #4
0
 def decorate(func):
     info = {
         'name': util.name_type2cli(func) if name is None else name,
     }
     try:
         func._clize__value_converter = info
         return func
     except (TypeError, AttributeError):
         @wraps(func)
         def _wrapper(*args, **kwargs):
             return func(*args, **kwargs)
         _wrapper._clize__value_converter = info
         return _wrapper
Example #5
0
 def decorate(func):
     info = {
         'name': util.name_type2cli(func) if name is None else name,
         'convert_default': convert_default,
     }
     try:
         func._clize__value_converter = info
         return func
     except (TypeError, AttributeError):
         @wraps(func)
         def _wrapper(*args, **kwargs):
             return func(*args, **kwargs)
         _wrapper._clize__value_converter = info
         return _wrapper
Example #6
0
 def format_type(self):
     """Returns a string designation of the value type."""
     return util.name_type2cli(self.conv)
Example #7
0
 def format_type(self):
     """Returns a string designation of the value type."""
     return util.name_type2cli(self.conv)
Example #8
0
 def message(self):
     return "Bad format for {0}: {1!r}".format(
         util.name_type2cli(self.typ), self.val)
Example #9
0
 def format_type(self):
     return '=' + util.name_type2cli(self.typ)