Python uuid.html() Examples

The following are 4 code examples of uuid.html(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module uuid , or try the search function .
Example #1
Source File: ble_node_definitions.py    From BlueSTSDK_Python with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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 
Example #2
Source File: document.py    From blitzdb with MIT License 5 votes vote down vote up
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 
Example #3
Source File: bot.py    From EvilOSX with GNU General Public License v3.0 5 votes vote down vote up
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__) 
Example #4
Source File: ble_node_definitions.py    From BlueSTSDK_Python with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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)