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


Python uuid.html方法代码示例

本文整理汇总了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 
开发者ID:STMicroelectronics,项目名称:BlueSTSDK_Python,代码行数:22,代码来源:ble_node_definitions.py

示例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 
开发者ID:adewes,项目名称:blitzdb,代码行数:12,代码来源:document.py

示例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__) 
开发者ID:Marten4n6,项目名称:EvilOSX,代码行数:7,代码来源:bot.py

示例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) 
开发者ID:STMicroelectronics,项目名称:BlueSTSDK_Python,代码行数:15,代码来源:ble_node_definitions.py


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