• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python v8_utilities.capitalize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setter_base_name

def setter_base_name(interface, attribute, arguments):
    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:Miaque,项目名称:mojo,代码行数:9,代码来源:v8_attributes.py


示例2: has_method_name_for_dictionary_member

def has_method_name_for_dictionary_member(member):
    name = v8_utilities.cpp_name(member)
    return "has%s" % v8_utilities.capitalize(name)
开发者ID:wulala-wuwu,项目名称:Blink,代码行数:3,代码来源:v8_dictionary.py


示例3: setter_name_for_dictionary_member

def setter_name_for_dictionary_member(member):
    name = v8_utilities.cpp_name(member)
    return "set%s" % v8_utilities.capitalize(name)
开发者ID:wulala-wuwu,项目名称:Blink,代码行数:3,代码来源:v8_dictionary.py


示例4: null_setter_name_for_dictionary_member

def null_setter_name_for_dictionary_member(member):
    if member.idl_type.is_nullable:
        name = v8_utilities.cpp_name(member)
        return 'set%sToNull' % v8_utilities.capitalize(name)
    return None
开发者ID:eval1749,项目名称:evita,代码行数:5,代码来源:v8_dictionary.py


示例5: getter_name_for_dictionary_member

def getter_name_for_dictionary_member(member):
    name = v8_utilities.cpp_name(member)
    if 'PrefixGet' in member.extended_attributes:
        return 'get%s' % v8_utilities.capitalize(name)
    return name
开发者ID:eval1749,项目名称:evita,代码行数:5,代码来源:v8_dictionary.py


示例6: setter_base_name

def setter_base_name(interface, attribute, arguments):
    return 'set%s' % capitalize(cpp_name(attribute))
开发者ID:MitchRudominer,项目名称:engine,代码行数:2,代码来源:v8_attributes.py


示例7: has_method_name_for_dictionary_member

def has_method_name_for_dictionary_member(member):
    return 'has%s' % v8_utilities.capitalize(member.name)
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:2,代码来源:v8_dictionary.py


示例8: setter_name_for_dictionary_member

def setter_name_for_dictionary_member(member):
    return 'set%s' % v8_utilities.capitalize(member.name)
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:2,代码来源:v8_dictionary.py


示例9: generate_attribute

def generate_attribute(interface, attribute):
    idl_type = attribute.idl_type
    extended_attributes = attribute.extended_attributes

    v8_types.add_includes_for_type(idl_type)

    # [CheckSecurity]
    is_check_security_for_node = 'CheckSecurity' in extended_attributes
    if is_check_security_for_node:
        includes.add('bindings/v8/BindingSecurity.h')
    # [Custom]
    has_custom_getter = ('Custom' in extended_attributes and
                         extended_attributes['Custom'] in [None, 'Getter'])
    has_custom_setter = (not attribute.is_read_only and
                         'Custom' in extended_attributes and
                         extended_attributes['Custom'] in [None, 'Setter'])
    # [RaisesException]
    is_getter_raises_exception = (
        'RaisesException' in extended_attributes and
        extended_attributes['RaisesException'] in [None, 'Getter'])
    if is_check_security_for_node or is_getter_raises_exception:
        includes.update(set(['bindings/v8/ExceptionMessages.h',
                             'bindings/v8/ExceptionState.h']))
    # [Reflect]
    is_reflect = 'Reflect' in extended_attributes
    if is_reflect:
        includes.add('core/dom/custom/CustomElementCallbackDispatcher.h')

    if (idl_type == 'EventHandler' and
        interface.name in ['Window', 'WorkerGlobalScope'] and
        attribute.name == 'onerror'):
        includes.add('bindings/v8/V8ErrorHandler.h')

    contents = {
        'access_control_list': access_control_list(attribute),
        'activity_logging_world_list_for_getter': v8_utilities.activity_logging_world_list(attribute, 'Getter'),  # [ActivityLogging]
        'activity_logging_world_list_for_setter': v8_utilities.activity_logging_world_list(attribute, 'Setter'),  # [ActivityLogging]
        'cached_attribute_validation_method': extended_attributes.get('CachedAttribute'),
        'conditional_string': v8_utilities.conditional_string(attribute),
        'constructor_type': v8_types.constructor_type(idl_type) if is_constructor_attribute(attribute) else None,
        'cpp_name': cpp_name(attribute),
        'cpp_type': v8_types.cpp_type(idl_type),
        'deprecate_as': v8_utilities.deprecate_as(attribute),  # [DeprecateAs]
        'enum_validation_expression':
            v8_utilities.enum_validation_expression(idl_type),
        'has_custom_getter': has_custom_getter,
        'has_custom_setter': has_custom_setter,
        'has_strict_type_checking': (
            'StrictTypeChecking' in extended_attributes and
            v8_types.is_interface_type(idl_type)),
        'idl_type': idl_type,
        'is_call_with_execution_context': v8_utilities.has_extended_attribute_value(attribute, 'CallWith', 'ExecutionContext'),
        'is_check_security_for_node': is_check_security_for_node,
        'is_expose_js_accessors': 'ExposeJSAccessors' in extended_attributes,
        'is_getter_raises_exception': (
            'RaisesException' in extended_attributes and
            extended_attributes['RaisesException'] in [None, 'Getter']),
        'is_initialized_by_event_constructor':
            'InitializedByEventConstructor' in extended_attributes,
        'is_keep_alive_for_gc': is_keep_alive_for_gc(attribute),
        'is_nullable': attribute.is_nullable,
        'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
        'is_read_only': attribute.is_read_only,
        'is_reflect': is_reflect,
        'is_replaceable': 'Replaceable' in attribute.extended_attributes,
        'is_setter_raises_exception': (
            'RaisesException' in extended_attributes and
            extended_attributes['RaisesException'] in [None, 'Setter']),
        'is_static': attribute.is_static,
        'is_unforgeable': 'Unforgeable' in extended_attributes,
        'measure_as': v8_utilities.measure_as(attribute),  # [MeasureAs]
        'name': attribute.name,
        'per_context_enabled_function': v8_utilities.per_context_enabled_function_name(attribute),  # [PerContextEnabled]
        'property_attributes': property_attributes(attribute),
        'set_serialized_script_value': 'setSerialized' + capitalize(attribute.name),  # [EventConstructor] on interface
        'setter_callback': setter_callback_name(interface, attribute),
        'v8_type': v8_types.v8_type(idl_type),
        'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(attribute),  # [RuntimeEnabled]
        'world_suffixes': ['', 'ForMainWorld']
                          if 'PerWorldBindings' in extended_attributes
                          else [''],  # [PerWorldBindings]
    }

    if is_constructor_attribute(attribute):
        return contents
    if not has_custom_getter:
        generate_getter(interface, attribute, contents)
    if not(attribute.is_read_only or has_custom_setter):
        contents.update({
            'cpp_setter': setter_expression(interface, attribute, contents),
            'v8_value_to_local_cpp_value': v8_types.v8_value_to_local_cpp_value(
                idl_type, extended_attributes, 'jsValue', 'cppValue'),
        })

    return contents
开发者ID:Igalia,项目名称:blink,代码行数:95,代码来源:v8_attributes.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python v8_utilities.conditional_string函数代码示例发布时间:2022-05-26
下一篇:
Python v8_utilities.call_with_arguments函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap