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 ''
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
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
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
def format_type(self): """Returns a string designation of the value type.""" return util.name_type2cli(self.conv)
def message(self): return "Bad format for {0}: {1!r}".format( util.name_type2cli(self.typ), self.val)
def format_type(self): return '=' + util.name_type2cli(self.typ)