當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。