core (plugins): added missing contants + use of new constants in PLUGIN_INFO

This commit is contained in:
Goffi 2017-02-12 18:59:10 +01:00
commit ac7d587c49
72 changed files with 586 additions and 560 deletions

View file

@ -176,9 +176,17 @@ class Const(object):
# PLUGIN_INFO keys
# XXX: we use PI instead of PLUG_INFO which would normally be used
# to make the header more readable
PI_NAME = u'name'
PI_IMPORT_NAME = u'import_name'
PI_MAIN = u'main'
PI_HANDLER = u'handler'
PI_TYPE = u'type'
PI_MODES = u'modes'
PI_PROTOCOLS = u'protocols'
PI_DEPENDENCIES = u'dependencies'
PI_RECOMMENDATIONS = u'recommendations'
PI_DESCRIPTION = u'description'
PI_USAGE = u'usage'
# Types
PLUG_TYPE_XEP = "XEP"

View file

@ -43,14 +43,14 @@ IGNORED_IFACES_START = ('org.freedesktop', 'org.qtproject', 'org.kde.KMainWindow
FLAG_LOOP = 'LOOP'
PLUGIN_INFO = {
"name": "Ad-Hoc Commands - D-Bus",
"import_name": "AD_HOC_DBUS",
"type": "Misc",
"protocols": [],
"dependencies": ["XEP-0050"],
"main": "AdHocDBus",
"handler": "no",
"description": _("""Add D-Bus management to Ad-Hoc commands""")
C.PI_NAME: "Ad-Hoc Commands - D-Bus",
C.PI_IMPORT_NAME: "AD_HOC_DBUS",
C.PI_TYPE: "Misc",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: ["XEP-0050"],
C.PI_MAIN: "AdHocDBus",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Add D-Bus management to Ad-Hoc commands""")
}

View file

@ -35,13 +35,13 @@ import uuid
PLUGIN_INFO = {
"name": "blog import",
"import_name": "BLOG_IMPORT",
"type": C.PLUG_TYPE_BLOG,
"dependencies": ["XEP-0060", "XEP-0277", "TEXT-SYNTAXES", "UPLOAD"],
"main": "BlogImportPlugin",
"handler": "no",
"description": _(u"""Blog import management:
C.PI_NAME: "blog import",
C.PI_IMPORT_NAME: "BLOG_IMPORT",
C.PI_TYPE: C.PLUG_TYPE_BLOG,
C.PI_DEPENDENCIES: ["XEP-0060", "XEP-0277", "TEXT-SYNTAXES", "UPLOAD"],
C.PI_MAIN: "BlogImportPlugin",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _(u"""Blog import management:
This plugin manage the different blog importers which can register to it, and handler generic importing tasks.""")
}

View file

@ -43,13 +43,13 @@ except:
raise exceptions.MissingModule(u"Missing module pillow, please download/install it from https://python-pillow.github.io")
PLUGIN_INFO = {
"name": "Dokuwiki import",
"import_name": "IMPORT_DOKUWIKI",
"type": C.PLUG_TYPE_BLOG,
"dependencies": ["BLOG_IMPORT"],
"main": "DokuwikiImport",
"handler": "no",
"description": _("""Blog importer for Dokuwiki blog engine.""")
C.PI_NAME: "Dokuwiki import",
C.PI_IMPORT_NAME: "IMPORT_DOKUWIKI",
C.PI_TYPE: C.PLUG_TYPE_BLOG,
C.PI_DEPENDENCIES: ["BLOG_IMPORT"],
C.PI_MAIN: "DokuwikiImport",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Blog importer for Dokuwiki blog engine.""")
}
SHORT_DESC = D_(u"import posts from Dokuwiki blog engine")

View file

@ -32,13 +32,13 @@ import os.path
PLUGIN_INFO = {
"name": "Dotclear import",
"import_name": "IMPORT_DOTCLEAR",
"type": C.PLUG_TYPE_BLOG,
"dependencies": ["BLOG_IMPORT"],
"main": "DotclearImport",
"handler": "no",
"description": _("""Blog importer for Dotclear blog engine.""")
C.PI_NAME: "Dotclear import",
C.PI_IMPORT_NAME: "IMPORT_DOTCLEAR",
C.PI_TYPE: C.PLUG_TYPE_BLOG,
C.PI_DEPENDENCIES: ["BLOG_IMPORT"],
C.PI_MAIN: "DotclearImport",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Blog importer for Dotclear blog engine.""")
}
SHORT_DESC = D_(u"import posts from Dotclear blog engine")

View file

@ -28,14 +28,14 @@ from sat.tools import trigger
from sat.tools.utils import clean_ustr
PLUGIN_INFO = {
"name": "Command export plugin",
"import_name": "EXP-COMMANS-EXPORT",
"type": "EXP",
"protocols": [],
"dependencies": [],
"main": "CommandExport",
"handler": "no",
"description": _("""Implementation of command export""")
C.PI_NAME: "Command export plugin",
C.PI_IMPORT_NAME: "EXP-COMMANS-EXPORT",
C.PI_TYPE: "EXP",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: [],
C.PI_MAIN: "CommandExport",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Implementation of command export""")
}
class ExportCommandProtocol(protocol.ProcessProtocol):

View file

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sat.core.i18n import _, D_
from sat.core.constants import Const as C
from sat.core.log import getLogger
log = getLogger(__name__)
from sat.core import exceptions
@ -31,14 +32,14 @@ identifier = LanguageIdentifier.from_modelstring(model, norm_probs=False)
PLUGIN_INFO = {
"name": "Language detection plugin",
"import_name": "EXP-LANG-DETECT",
"type": "EXP",
"protocols": [],
"dependencies": [],
"main": "LangDetect",
"handler": "no",
"description": _("""Detect and set message language when unknown""")
C.PI_NAME: "Language detection plugin",
C.PI_IMPORT_NAME: "EXP-LANG-DETECT",
C.PI_TYPE: "EXP",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: [],
C.PI_MAIN: "LangDetect",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Detect and set message language when unknown""")
}
CATEGORY = D_(u"Misc")

View file

@ -27,15 +27,15 @@ from sat.core.exceptions import UnknownEntityError
#from sat.tools import trigger
PLUGIN_INFO = {
"name": "Parrot Plugin",
"import_name": "EXP-PARROT",
"type": "EXP",
"protocols": [],
"dependencies": ["XEP-0045"],
"recommendations": [C.TEXT_CMDS],
"main": "Exp_Parrot",
"handler": "no",
"description": _(u"""Implementation of parrot mode (repeat messages between 2 entities)""")
C.PI_NAME: "Parrot Plugin",
C.PI_IMPORT_NAME: "EXP-PARROT",
C.PI_TYPE: "EXP",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: ["XEP-0045"],
C.PI_RECOMMENDATIONS: [C.TEXT_CMDS],
C.PI_MAIN: "Exp_Parrot",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _(u"""Implementation of parrot mode (repeat messages between 2 entities)""")
}

View file

@ -30,14 +30,14 @@ NS_PIPE = 'http://salut-a-toi.org/protocol/pipe'
SECURITY_LIMIT=30
PLUGIN_INFO = {
"name": "Pipe Plugin",
"import_name": "EXP-PIPE",
"type": "EXP",
"protocols": ["EXP-PIPE"],
"dependencies": ["XEP-0166"],
"main": "Exp_Pipe",
"handler": "no",
"description": _("""Jingle Pipe Transfer experimental plugin""")
C.PI_NAME: "Pipe Plugin",
C.PI_IMPORT_NAME: "EXP-PIPE",
C.PI_TYPE: "EXP",
C.PI_PROTOCOLS: ["EXP-PIPE"],
C.PI_DEPENDENCIES: ["XEP-0166"],
C.PI_MAIN: "Exp_Pipe",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Jingle Pipe Transfer experimental plugin""")
}
CONFIRM = D_(u"{peer} wants to send you a pipe stream, do you accept ?")

View file

@ -37,15 +37,15 @@ import random
PLUGIN_INFO = {
"name": "Account Plugin",
"import_name": "MISC-ACCOUNT",
"type": "MISC",
"protocols": [],
"dependencies": [],
"recommendations": ['GROUPBLOG'],
"main": "MiscAccount",
"handler": "no",
"description": _(u"""SàT account creation""")
C.PI_NAME: "Account Plugin",
C.PI_IMPORT_NAME: "MISC-ACCOUNT",
C.PI_TYPE: "MISC",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: [],
C.PI_RECOMMENDATIONS: ['GROUPBLOG'],
C.PI_MAIN: "MiscAccount",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _(u"""SàT account creation""")
}
CONFIG_SECTION = "plugin account"

View file

@ -27,12 +27,12 @@ import mmap
PLUGIN_INFO = {
"name": "Android ",
"import_name": "android",
"type": C.PLUG_TYPE_MISC,
"main": "AndroidPlugin",
"handler": "no",
"description": D_("""Manage Android platform specificities, like pause or notifications""")
C.PI_NAME: "Android ",
C.PI_IMPORT_NAME: "android",
C.PI_TYPE: C.PLUG_TYPE_MISC,
C.PI_MAIN: "AndroidPlugin",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: D_("""Manage Android platform specificities, like pause or notifications""")
}
if sys.platform != "android":

View file

@ -24,14 +24,14 @@ from sat.core.constants import Const as C
import json
PLUGIN_INFO = {
"name": "Debug Plugin",
"import_name": "DEBUG",
"type": "Misc",
"protocols": [],
"dependencies": [],
"main": "Debug",
"handler": "no",
"description": _("""Set of method to make development and debugging easier""")
C.PI_NAME: "Debug Plugin",
C.PI_IMPORT_NAME: "DEBUG",
C.PI_TYPE: "Misc",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: [],
C.PI_MAIN: "Debug",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Set of method to make development and debugging easier""")
}

View file

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sat.core.i18n import _, D_
from sat.core.constants import Const as C
from sat.core.log import getLogger
log = getLogger(__name__)
from sat.memory import params
@ -25,15 +26,15 @@ from twisted.words.protocols.jabber import jid
PLUGIN_INFO = {
"name": "Extra PEP",
"import_name": "EXTRA-PEP",
"type": "MISC",
"protocols": [],
"dependencies": [],
"recommendations": [],
"main": "ExtraPEP",
"handler": "no",
"description": _(u"""Display messages from extra PEP services""")
C.PI_NAME: "Extra PEP",
C.PI_IMPORT_NAME: "EXTRA-PEP",
C.PI_TYPE: "MISC",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: [],
C.PI_RECOMMENDATIONS: [],
C.PI_MAIN: "ExtraPEP",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _(u"""Display messages from extra PEP services""")
}

View file

@ -31,12 +31,12 @@ import uuid
PLUGIN_INFO = {
"name": "File Tansfer",
"import_name": "FILE",
"type": C.PLUG_TYPE_MISC,
"main": "FilePlugin",
"handler": "no",
"description": _("""File Tansfer Management:
C.PI_NAME: "File Tansfer",
C.PI_IMPORT_NAME: "FILE",
C.PI_TYPE: C.PLUG_TYPE_MISC,
C.PI_MAIN: "FilePlugin",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""File Tansfer Management:
This plugin manage the various ways of sending a file, and choose the best one.""")
}

View file

@ -41,14 +41,14 @@ NS_PUBSUB_ITEM_CONFIG = NS_PUBSUB_EXP + "#item-config"
PLUGIN_INFO = {
"name": "Group blogging through collections",
"import_name": "GROUPBLOG",
"type": "MISC",
"protocols": [],
"dependencies": ["XEP-0277"],
"main": "GroupBlog",
"handler": "yes",
"description": _("""Implementation of microblogging fine permissions""")
C.PI_NAME: "Group blogging through collections",
C.PI_IMPORT_NAME: "GROUPBLOG",
C.PI_TYPE: "MISC",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: ["XEP-0277"],
C.PI_MAIN: "GroupBlog",
C.PI_HANDLER: "yes",
C.PI_DESCRIPTION: _("""Implementation of microblogging fine permissions""")
}

View file

@ -18,6 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from sat.core.i18n import _
from sat.core.constants import Const as C
from sat.core.log import getLogger
log = getLogger(__name__)
from twisted.internet import protocol, defer
@ -33,14 +34,14 @@ from twisted.internet import reactor
from zope.interface import implements
PLUGIN_INFO = {
"name": "IMAP server Plugin",
"import_name": "IMAP",
"type": "Misc",
"protocols": [],
"dependencies": ["Maildir"],
"main": "IMAP_server",
"handler": "no",
"description": _("""Create an Imap server that you can use to read your "normal" type messages""")
C.PI_NAME: "IMAP server Plugin",
C.PI_IMPORT_NAME: "IMAP",
C.PI_TYPE: "Misc",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: ["Maildir"],
C.PI_MAIN: "IMAP_server",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Create an Imap server that you can use to read your "normal" type messages""")
}

View file

@ -42,14 +42,14 @@ except ImportError:
PLUGIN_INFO = {
"name": "IP discovery",
"import_name": "IP",
"type": C.PLUG_TYPE_MISC,
"protocols": ["XEP-0279"],
"recommendations": ["NAT-PORT"],
"main": "IPPlugin",
"handler": "yes",
"description": _("""This plugin help to discover our external IP address.""")
C.PI_NAME: "IP discovery",
C.PI_IMPORT_NAME: "IP",
C.PI_TYPE: C.PLUG_TYPE_MISC,
C.PI_PROTOCOLS: ["XEP-0279"],
C.PI_RECOMMENDATIONS: ["NAT-PORT"],
C.PI_MAIN: "IPPlugin",
C.PI_HANDLER: "yes",
C.PI_DESCRIPTION: _("""This plugin help to discover our external IP address.""")
}
# TODO: GET_IP_PAGE should be configurable in sat.conf

View file

@ -32,14 +32,14 @@ from sat.memory.persistent import PersistentBinaryDict
PLUGIN_INFO = {
"name": "Maildir Plugin",
"import_name": "Maildir",
"type": "Misc",
"protocols": [],
"dependencies": [],
"main": "MaildirBox",
"handler": "no",
"description": _("""Intercept "normal" type messages, and put them in a Maildir type box""")
C.PI_NAME: "Maildir Plugin",
C.PI_IMPORT_NAME: "Maildir",
C.PI_TYPE: "Misc",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: [],
C.PI_MAIN: "MaildirBox",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Intercept "normal" type messages, and put them in a Maildir type box""")
}
MAILDIR_PATH = "Maildir"

View file

@ -34,12 +34,12 @@ except ImportError:
PLUGIN_INFO = {
"name": "NAT port mapping",
"import_name": "NAT-PORT",
"type": C.PLUG_TYPE_MISC,
"main": "NatPort",
"handler": "no",
"description": _("""Automatic NAT port mapping using UPnP"""),
C.PI_NAME: "NAT port mapping",
C.PI_IMPORT_NAME: "NAT-PORT",
C.PI_TYPE: C.PLUG_TYPE_MISC,
C.PI_MAIN: "NatPort",
C.PI_HANDLER: "no",
C.PI_DESCRIPTION: _("""Automatic NAT port mapping using UPnP"""),
}
STARTING_PORT = 6000 # starting point to automatically find a port

View file

@ -31,14 +31,14 @@ NS_QG = 'http://www.goffi.org/protocol/quiz'
QG_TAG = 'quiz'
PLUGIN_INFO = {
"name": "Quiz game plugin",
"import_name": "Quiz",
"type": "Game",
"protocols": [],
"dependencies": ["XEP-0045", "XEP-0249", "ROOM-GAME"],
"main": "Quiz",
"handler": "yes",
"description": _("""Implementation of Quiz game""")
C.PI_NAME: "Quiz game plugin",
C.PI_IMPORT_NAME: "Quiz",
C.PI_TYPE: "Game",
C.PI_PROTOCOLS: [],
C.PI_DEPENDENCIES: ["XEP-0045", "XEP-0249", "ROOM-GAME"],
C.PI_MAIN: "Quiz",
C.PI_HANDLER: "yes",
C.PI_DESCRIPTION: _("""Implementation of Quiz game""")
}

Some files were not shown because too many files have changed in this diff Show more