PluginApis.py

Mon, 15 May 2023 13:37:37 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 15 May 2023 13:37:37 +0200
branch
eric7
changeset 61
c3ff08a62f7f
parent 60
c82fc89e80e4
child 63
566338138983
permissions
-rw-r--r--

Updated to prepare a new release
- added platform specific MicroPython API files (µPy 1.20.0)
-- ESP32
-- ESP32 OTA
-- RP2 (RP2040 chip, Pi Pico, Pi Pico W, Pimoroni PicoLipo)
-- SAMD
-- STM32 incl. STM32 PyBoard v11
- updated the CircuitPython API file
- updated Adafruit CircuitPython Library Bundle API file
- added API files for the CircuitPython Community Bundle
- updated PyQt6 API files (for PyQt 6.5.0)

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

# Copyright (c) 2013 - 2023 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.3"
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 (string)
    @return list of API filenames (list of string)
    """
    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 (UI.UserInterface)
        """
        super().__init__(ui)
        self.__ui = ui

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

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

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

eric ide

mercurial