PluginApis.py

Sun, 13 Oct 2013 18:09:10 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 13 Oct 2013 18:09:10 +0200
changeset 4
a27bb7a06650
parent 3
551bd94613ac
child 6
89b4debad1df
permissions
-rw-r--r--

Shortened lines to adhere to the 79 character limit.

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

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

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

from __future__ import unicode_literals    # __IGNORE_WARNING__

import os
import glob

from PyQt4.QtCore import QObject

# Start-of-Header
name = "APIs Plugin"
author = "Detlev Offenbach <detlev@die-offenbachs.de>"
autoactivate = True
deactivateable = True
version = "1.1.0"
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.
    
    @return list of API filenames (list of string)
    """
    if language in ["Python3",  "Python2", "Python"]:
        apisDir = \
            os.path.join(os.path.dirname(__file__), "APIs", "Python")
        apis = glob.glob(os.path.join(apisDir, '*.api'))
        if language == "Python3":
            apisDir = \
                os.path.join(os.path.dirname(__file__), "APIs", "Python3")
            apis.extend(glob.glob(os.path.join(apisDir, '*.api')))
        else:
            apisDir = \
                os.path.join(os.path.dirname(__file__), "APIs", "Python2")
            apis.extend(glob.glob(os.path.join(apisDir, '*.api')))
    else:
        apis = []
    return apis


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(PluginApis, self).__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