phabricator/__init__.py
def map_param_type(param_type):
    """
    Perform param type mapping
    This requires a bit of logic since this isn't standardized.
    If a type doesn't map, assume str
    """
    main_type, sub_type = TYPE_INFO_RE.match(param_type).groups()

    if main_type in ('list', 'array'):
        # Handle no sub-type: "required list"
        if sub_type is not None:
            sub_type = sub_type.strip()

        if not sub_type:
            sub_type = 'str'

        # Handle list of pairs: "optional list<pair<callsign, path>>"
        sub_match = TYPE_INFO_RE.match(sub_type)
        if sub_match:
            sub_type = sub_match.group(1).lower()

        return [PARAM_TYPE_MAP.setdefault(sub_type, string_types)]

    return PARAM_TYPE_MAP.setdefault(main_type, string_types)
def map_param_type(param_type):
    """
    Perform param type mapping
    This requires a bit of logic since this isn't standardized.
    If a type doesn't map, assume str
    """
    main_type, sub_type = TYPE_INFO_RE.match(param_type).groups()

    if main_type in ('list', 'array'):
        # Handle no sub-type: "required list"
        if sub_type is not None:
            sub_type = sub_type.strip()

        if not sub_type:
            sub_type = 'str'

        # Handle list of pairs: "optional list<pair<callsign, path>>"
        sub_match = TYPE_INFO_RE.match(sub_type)
        if sub_match:
            sub_type = sub_match.group(1).lower()

        return [PARAM_TYPE_MAP.setdefault(sub_type, string_types)]

    return PARAM_TYPE_MAP.setdefault(main_type, string_types)
def map_param_type ( param_type ) : main_type , sub_type = TYPE_INFO_RE . match ( param_type ) . groups ( ) if main_type in ( 'list' , 'array' ) : # Handle no sub-type: "required list" if sub_type is not None : sub_type = sub_type . strip ( ) if not sub_type : sub_type = 'str' # Handle list of pairs: "optional list<pair<callsign, path>>" sub_match = TYPE_INFO_RE . match ( sub_type ) if sub_match : sub_type = sub_match . group ( 1 ) . lower ( ) return [ PARAM_TYPE_MAP . setdefault ( sub_type , string_types ) ] return PARAM_TYPE_MAP . setdefault ( main_type , string_types )
Perform param type mapping
    This requires a bit of logic since this isn't standardized.
    If a type doesn't map, assume str
Perform param type mapping This requires a bit of logic since this isn t standardized . If a type doesn t map assume str