本文整理汇总了Python中uuid.html方法的典型用法代码示例。如果您正苦于以下问题:Python uuid.html方法的具体用法?Python uuid.html怎么用?Python uuid.html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uuid
的用法示例。
在下文中一共展示了uuid.html方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_extended_feature_class
# 需要导入模块: import uuid [as 别名]
# 或者: from uuid import html [as 别名]
def get_extended_feature_class(self, uuid):
"""Getting the extended feature class from a UUID.
Args:
uuid (UUID): Characteristic's UUID.
Refer to
`UUID: <https://ianharvey.github.io/bluepy-doc/uuid.html>`_ for
more information.
Returns:
type: The feature's class if found, "None" otherwise.
"""
# Extracting the feature mask from the characteristic's UUID.
feature_mask = FeatureCharacteristic.extract_feature_mask(uuid)
# Returning the feature's class.
if feature_mask in FeatureCharacteristic.EXTENDED_MASK_TO_FEATURE_DIC:
return FeatureCharacteristic.EXTENDED_MASK_TO_FEATURE_DIC[
feature_mask]
return None
示例2: autogenerate_pk
# 需要导入模块: import uuid [as 别名]
# 或者: from uuid import html [as 别名]
def autogenerate_pk(self):
"""
Autogenerates a primary key for this document. This function gets called by the backend
if you save a document without a primary key field. By default, it uses `uuid.uuid4().hex`
to generate a (statistically) unique primary key for the object (`more about UUIDs
<https://docs.python.org/2/library/uuid.html>`_).
If you want to define your own primary key generation mechanism, just redefine this function
in your document class.
"""
self.pk = uuid.uuid4().hex
示例3: get_uid
# 需要导入模块: import uuid [as 别名]
# 或者: from uuid import html [as 别名]
def get_uid():
""":return The unique ID of this bot."""
# The bot must be connected to WiFi anyway, so getnode is fine.
# See https://docs.python.org/2/library/uuid.html#uuid.getnode
return hexlify(getpass.getuser() + "-" + str(uuid.getnode()) + "-" + __version__)
示例4: extract_feature_mask
# 需要导入模块: import uuid [as 别名]
# 或者: from uuid import html [as 别名]
def extract_feature_mask(self, uuid):
""""Extract the fist 32 bits from the characteristic's UUID.
Args:
uuid (UUID): Characteristic's UUID.
Refer to
`UUID: <https://ianharvey.github.io/bluepy-doc/uuid.html>`_ for
more information.
Returns:
int: The first 32 bit of the characteristic's UUID.
"""
return int(str(uuid).split('-')[0], 16)