PluginApis.py

Tue, 29 Oct 2024 15:01:25 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 29 Oct 2024 15:01:25 +0100
branch
eric7
changeset 82
2c9d5ef4e3aa
parent 80
9e1c29f50a44
child 83
96a323edb728
permissions
-rw-r--r--

- updated the CircuitPython API file
- updated Adafruit CircuitPython Library Bundle API file
- updated CircuitPython Community Bundle API file

# -*- coding: utf-8 -*-

# Copyright (c) 2013 - 2024 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing the APIs plugin.
"""

import glob
import os

from PyQt6.QtCore import QObject

# Start-of-Header
name = "APIs Plugin"
author = "Detlev Offenbach <detlev@die-offenbachs.de>"
autoactivate = True
deactivateable = True
version = "10.3.10"
className = "PluginApis"
packageName = "APIs"
shortDescription = "API files for auto-completion and call tips."
longDescription = (
    """This plug-in provides API files for auto-completion"""
    """ and call tips that are often missing from distribution packages."""
)
needsRestart = False
pyqtApi = 2
# End-of-Header

error = ""


def apiFiles(language):
    """
    Module function to return the API files made available by this plugin.

    @param language language to get APIs for
    @type str
    @return list of API filenames
    @rtype list of str
    """
    if language:
        apisDir = os.path.join(os.path.dirname(__file__), "APIs", language)
        return glob.glob(os.path.join(apisDir, "*.api"))
    else:
        return []


class PluginApis(QObject):
    """
    Class implementing the Django project plugin.
    """

    def __init__(self, ui):
        """
        Constructor

        @param ui reference to the user interface object
        @type UserInterface
        """
        super().__init__(ui)
        self.__ui = ui

    def activate(self):
        """
        Public method to activate this plugin.

        @return tuple of None and activation status
        @rtype tuple of (None, bool)
        """
        return None, True

    def deactivate(self):
        """
        Public method to deactivate this plugin.
        """
        pass

#
# eflag: noqa = U200

eric ide

mercurial