PluginApis.py

Wed, 28 Sep 2022 17:44:38 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 28 Sep 2022 17:44:38 +0200
branch
eric7
changeset 57
67e7ac09e569
parent 55
2fde8fbab230
child 59
df5866fce885
permissions
-rw-r--r--

Added platform specific MicroPython API file
- ESP32
- ESP8266
- RP2 (Raspberry Pi Pico, RP2040 chip)
- STM32

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

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

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

import os
import glob

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.2"
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