MCPcopy Index your code
hub / github.com/RustPython/RustPython / Parameter

Class Parameter

Lib/email/_header_value_parser.py:673–698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671
672
673class Parameter(TokenList):
674
675 token_type = 'parameter'
676 sectioned = False
677 extended = False
678 charset = 'us-ascii'
679
680 @property
681 def section_number(self):
682 # Because the first token, the attribute (name) eats CFWS, the second
683 # token is always the section if there is one.
684 return self[1].number if self.sectioned else 0
685
686 @property
687 def param_value(self):
688 # This is part of the "handle quoted extended parameters" hack.
689 for token in self:
690 if token.token_type == 'value':
691 return token.stripped_value
692 if token.token_type == 'quoted-string':
693 for token in token:
694 if token.token_type == 'bare-quoted-string':
695 for token in token:
696 if token.token_type == 'value':
697 return token.stripped_value
698 return ''
699
700
701class InvalidParameter(Parameter):

Callers 1

get_parameterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected