本文整理汇总了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"
示例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"
示例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]
示例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'
示例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),
}
示例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)
}
示例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),
}
示例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
示例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
),
}