当前位置: 首页>>代码示例>>Python>>正文


Python v8_utilities.uncapitalize函数代码示例

本文整理汇总了Python中v8_utilities.uncapitalize函数的典型用法代码示例。如果您正苦于以下问题:Python uncapitalize函数的具体用法?Python uncapitalize怎么用?Python uncapitalize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了uncapitalize函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setter_base_name

def setter_base_name(interface, attribute, arguments):
    if "ImplementedInPrivateScript" in attribute.extended_attributes:
        return "%sAttributeSetter" % uncapitalize(cpp_name(attribute))

    if "Reflect" not in attribute.extended_attributes:
        return "set%s" % capitalize(cpp_name(attribute))
    arguments.append(scoped_content_attribute_name(interface, attribute))

    base_idl_type = attribute.idl_type.base_type
    if base_idl_type in CONTENT_ATTRIBUTE_SETTER_NAMES:
        return CONTENT_ATTRIBUTE_SETTER_NAMES[base_idl_type]
    return "setAttribute"
开发者ID:howardroark2018,项目名称:chromium,代码行数:12,代码来源:v8_attributes.py

示例2: getter_base_name

def getter_base_name(interface, attribute, arguments):
    extended_attributes = attribute.extended_attributes

    if "ImplementedInPrivateScript" in extended_attributes:
        return "%sAttributeGetter" % uncapitalize(cpp_name(attribute))

    if "Reflect" not in extended_attributes:
        return uncapitalize(cpp_name(attribute))

    content_attribute_name = extended_attributes["Reflect"] or attribute.name.lower()
    if content_attribute_name in ["class", "id", "name"]:
        # Special-case for performance optimization.
        return "get%sAttribute" % content_attribute_name.capitalize()

    arguments.append(scoped_content_attribute_name(interface, attribute))

    base_idl_type = attribute.idl_type.base_type
    if base_idl_type in CONTENT_ATTRIBUTE_GETTER_NAMES:
        return CONTENT_ATTRIBUTE_GETTER_NAMES[base_idl_type]
    if "URL" in attribute.extended_attributes:
        return "getURLAttribute"
    return "fastGetAttribute"
开发者ID:howardroark2018,项目名称:chromium,代码行数:22,代码来源:v8_attributes.py

示例3: get_install_functions

def get_install_functions(interfaces, feature_names):
    """Construct a list of V8 bindings installation functions for each feature
    on each interface.

    interfaces is a list of ConditionalInterfaceInfo tuples
    feature_names is a list of strings, containing names of features which can
        be installed on those interfaces.
    """
    return [
        {"condition": 'OriginTrials::%sEnabled' % uncapitalize(feature_name),
         "name": feature_name,
         "install_method": "install%s" % feature_name,
         "interface_is_global": interface_info.is_global,
         "v8_class": interface_info.v8_class,
         "v8_class_or_partial": interface_info.v8_class_or_partial}
        for feature_name in feature_names
        for interface_info in interfaces]
开发者ID:eval1749,项目名称:evita,代码行数:17,代码来源:generate_conditional_features.py

示例4: getter_base_name

def getter_base_name(interface, attribute, arguments):
    extended_attributes = attribute.extended_attributes

    return uncapitalize(cpp_name(attribute))

    content_attribute_name = attribute.name.lower()
    if content_attribute_name in ['class', 'id']:
        # Special-case for performance optimization.
        return 'get%sAttribute' % content_attribute_name.capitalize()

    arguments.append(scoped_content_attribute_name(interface, attribute))

    base_idl_type = attribute.idl_type.base_type
    if base_idl_type in CONTENT_ATTRIBUTE_GETTER_NAMES:
        return CONTENT_ATTRIBUTE_GETTER_NAMES[base_idl_type]
    if 'URL' in attribute.extended_attributes:
        return 'getURLAttribute'
    return 'getAttribute'
开发者ID:MitchRudominer,项目名称:engine,代码行数:18,代码来源:v8_attributes.py

示例5: member_context

def member_context(member, interfaces_info):
    interface_info = interfaces_info.get(member.name, None)
    _update_includes_and_forward_decls(member, interface_info)
    if member.is_nullable:
        member = member.inner_type
    return {
        'cpp_name': v8_utilities.uncapitalize(member.name),
        'cpp_type': member.cpp_type_args(used_in_cpp_sequence=True),
        'cpp_local_type': member.cpp_type,
        'cpp_value_to_v8_value': member.cpp_value_to_v8_value(
            cpp_value='impl.getAs%s()' % member.name, isolate='isolate',
            creation_context='creationContext'),
        'enum_values': member.enum_values,
        'is_traceable': member.is_traceable,
        'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True),
        'specific_type_enum': 'SpecificType' + member.name,
        'type_name': member.name,
        'v8_value_to_local_cpp_value': member.v8_value_to_local_cpp_value(
            {}, 'v8Value', 'cppValue', isolate='isolate',
            use_exception_state=True, restricted_float=True),
    }
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:21,代码来源:v8_union.py

示例6: member_context

def member_context(member, info_provider):
    _update_includes_and_forward_decls(member, info_provider)
    if member.is_nullable:
        member = member.inner_type
    return {
        'cpp_name': v8_utilities.uncapitalize(member.name),
        'cpp_type': member.cpp_type_args(used_in_cpp_sequence=True),
        'cpp_local_type': member.cpp_type,
        'cpp_value_to_v8_value': member.cpp_value_to_v8_value(
            cpp_value='impl.getAs%s()' % member.name, isolate='isolate',
            creation_context='creationContext'),
        'enum_values': member.enum_values,
        'is_array_buffer_or_view_type': member.is_array_buffer_or_view,
        'is_array_buffer_view_or_typed_array': member.is_array_buffer_view_or_typed_array,
        'is_traceable': member.is_traceable,
        'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True),
        'specific_type_enum': 'SpecificType' + member.name,
        'type_name': member.name,
        'v8_value_to_local_cpp_value': member.v8_value_to_local_cpp_value(
            {}, 'v8Value', 'cppValue', isolate='isolate',
            use_exception_state=True)
    }
开发者ID:eval1749,项目名称:evita,代码行数:22,代码来源:v8_union.py

示例7: member_context

def member_context(member, interfaces_info):
    cpp_includes.update(member.includes_for_type)
    interface_info = interfaces_info.get(member.name, None)
    if interface_info:
        cpp_includes.update(interface_info.get('dependencies_include_paths', []))
        header_forward_decls.add(member.implemented_as)
    if member.is_nullable:
        member = member.inner_type
    return {
        'cpp_name': v8_utilities.uncapitalize(member.name),
        'cpp_type': member.cpp_type_args(used_in_cpp_sequence=True),
        'cpp_local_type': member.cpp_type,
        'cpp_value_to_v8_value': member.cpp_value_to_v8_value(
            cpp_value='impl.getAs%s()' % member.name, isolate='isolate',
            creation_context='creationContext'),
        'is_traceable': member.is_traceable,
        'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True),
        'specific_type_enum': 'SpecificType' + member.name,
        'type_name': member.name,
        'v8_value_to_local_cpp_value': member.v8_value_to_local_cpp_value(
            {}, 'v8Value', 'cppValue', isolate='isolate',
            needs_exception_state_for_string=True),
    }
开发者ID:eth-srl,项目名称:BlinkER,代码行数:23,代码来源:v8_union.py

示例8: generate_attribute_and_includes

def generate_attribute_and_includes(attribute):
    idl_type = attribute.data_type
    # FIXME: need to check should_keep_attribute_alive, but for now sufficient
    # to check if primitive.
    should_keep_attribute_alive = not v8_types.primitive_type(idl_type)
    if should_keep_attribute_alive:
        return_v8_value_statement = None  # unused
        includes = v8_types.includes_for_type(idl_type)
        includes.add('bindings/v8/V8HiddenPropertyName.h')
    else:
        cpp_value = 'imp->%s()' % uncapitalize(attribute.name)
        return_v8_value_statement = v8_types.v8_set_return_value(idl_type, cpp_value, callback_info='info')
        includes = []
    contents = {
        'name': attribute.name,
        'conditional_string': generate_conditional_string(attribute),
        'cpp_method_name': cpp_method_name(attribute),
        'cpp_type': v8_types.cpp_type(idl_type, pointer_type='RefPtr'),
        'should_keep_attribute_alive': should_keep_attribute_alive,
        'return_v8_value_statement': return_v8_value_statement,
        'v8_type': v8_types.v8_type(idl_type),
    }
    return contents, includes
开发者ID:halton,项目名称:blink-crosswalk,代码行数:23,代码来源:v8_attributes.py

示例9: member_context

def member_context(member, interfaces_info):
    cpp_includes.update(member.includes_for_type())
    interface_info = interfaces_info.get(member.name, None)
    if interface_info:
        cpp_includes.update(interface_info.get("dependencies_include_paths", []))
        header_forward_decls.add(member.implemented_as)
    if member.is_nullable:
        member = member.inner_type
    return {
        "cpp_name": v8_utilities.uncapitalize(member.name),
        "cpp_type": member.cpp_type_args(used_in_cpp_sequence=True),
        "cpp_local_type": member.cpp_type,
        "cpp_value_to_v8_value": member.cpp_value_to_v8_value(
            cpp_value="impl.getAs%s()" % member.name, isolate="isolate", creation_context="creationContext"
        ),
        "enum_values": member.enum_values,
        "is_traceable": member.is_traceable,
        "rvalue_cpp_type": member.cpp_type_args(used_as_rvalue_type=True),
        "specific_type_enum": "SpecificType" + member.name,
        "type_name": member.name,
        "v8_value_to_local_cpp_value": member.v8_value_to_local_cpp_value(
            {}, "v8Value", "cppValue", isolate="isolate", use_exception_state=True, restricted_float=True
        ),
    }
开发者ID:dreifachstein,项目名称:chromium-src,代码行数:24,代码来源:v8_union.py


注:本文中的v8_utilities.uncapitalize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。