plugin text syntaxes: changed import name to TEXT_SYNTAX (better with underscore for autocompletion)
This commit is contained in:
parent
604ff498da
commit
f1c0eca9ab
7 changed files with 18 additions and 18 deletions
|
|
@ -39,7 +39,7 @@ PLUGIN_INFO = {
|
|||
C.PI_NAME: "blog import",
|
||||
C.PI_IMPORT_NAME: "BLOG_IMPORT",
|
||||
C.PI_TYPE: (C.PLUG_TYPE_BLOG, C.PLUG_TYPE_IMPORT),
|
||||
C.PI_DEPENDENCIES: ["IMPORT", "XEP-0060", "XEP-0277", "TEXT-SYNTAXES", "UPLOAD"],
|
||||
C.PI_DEPENDENCIES: ["IMPORT", "XEP-0060", "XEP-0277", "TEXT_SYNTAXES", "UPLOAD"],
|
||||
C.PI_MAIN: "BlogImportPlugin",
|
||||
C.PI_HANDLER: "no",
|
||||
C.PI_DESCRIPTION: _(
|
||||
|
|
@ -66,7 +66,7 @@ class BlogImportPlugin(object):
|
|||
self._u = host.plugins["UPLOAD"]
|
||||
self._p = host.plugins["XEP-0060"]
|
||||
self._m = host.plugins["XEP-0277"]
|
||||
self._s = self.host.plugins["TEXT-SYNTAXES"]
|
||||
self._s = self.host.plugins["TEXT_SYNTAXES"]
|
||||
host.plugins["IMPORT"].initialize(self, u"blog")
|
||||
|
||||
def importItem(
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ STYLES_ACCEPTED_VALUE = re.compile(STYLES_VALUES_REGEX)
|
|||
|
||||
PLUGIN_INFO = {
|
||||
C.PI_NAME: "Text syntaxes",
|
||||
C.PI_IMPORT_NAME: "TEXT-SYNTAXES",
|
||||
C.PI_IMPORT_NAME: "TEXT_SYNTAXES",
|
||||
C.PI_TYPE: "MISC",
|
||||
C.PI_PROTOCOLS: [],
|
||||
C.PI_DEPENDENCIES: [],
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ PLUGIN_INFO = {
|
|||
C.PI_NAME: "Dotclear Wiki Syntax Plugin",
|
||||
C.PI_IMPORT_NAME: "SYNT_DC_WIKI",
|
||||
C.PI_TYPE: C.PLUG_TYPE_SYNTAXE,
|
||||
C.PI_DEPENDENCIES: ["TEXT-SYNTAXES"],
|
||||
C.PI_DEPENDENCIES: ["TEXT_SYNTAXES"],
|
||||
C.PI_MAIN: "DCWikiSyntax",
|
||||
C.PI_HANDLER: "",
|
||||
C.PI_DESCRIPTION: _("""Implementation of Dotclear wiki syntax"""),
|
||||
|
|
@ -665,7 +665,7 @@ class DCWikiSyntax(object):
|
|||
self.host = host
|
||||
self._dc_parser = DCWikiParser()
|
||||
self._xhtml_parser = XHTMLParser()
|
||||
self._stx = self.host.plugins["TEXT-SYNTAXES"]
|
||||
self._stx = self.host.plugins["TEXT_SYNTAXES"]
|
||||
self._stx.addSyntax(
|
||||
self.SYNTAX_NAME, self.parseWiki, self.parseXHTML, [self._stx.OPT_NO_THREAD]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ PLUGIN_INFO = {
|
|||
C.PI_IMPORT_NAME: "XEP-0071",
|
||||
C.PI_TYPE: "XEP",
|
||||
C.PI_PROTOCOLS: ["XEP-0071"],
|
||||
C.PI_DEPENDENCIES: ["TEXT-SYNTAXES"],
|
||||
C.PI_DEPENDENCIES: ["TEXT_SYNTAXES"],
|
||||
C.PI_MAIN: "XEP_0071",
|
||||
C.PI_HANDLER: "yes",
|
||||
C.PI_DESCRIPTION: _("""Implementation of XHTML-IM"""),
|
||||
|
|
@ -93,7 +93,7 @@ class XEP_0071(object):
|
|||
def __init__(self, host):
|
||||
log.info(_("XHTML-IM plugin initialization"))
|
||||
self.host = host
|
||||
self._s = self.host.plugins["TEXT-SYNTAXES"]
|
||||
self._s = self.host.plugins["TEXT_SYNTAXES"]
|
||||
self._s.addSyntax(
|
||||
self.SYNTAX_XHTML_IM,
|
||||
lambda xhtml: xhtml,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ PLUGIN_INFO = {
|
|||
C.PI_IMPORT_NAME: "XEP-0277",
|
||||
C.PI_TYPE: "XEP",
|
||||
C.PI_PROTOCOLS: ["XEP-0277"],
|
||||
C.PI_DEPENDENCIES: ["XEP-0163", "XEP-0060", "TEXT-SYNTAXES"],
|
||||
C.PI_DEPENDENCIES: ["XEP-0163", "XEP-0060", "TEXT_SYNTAXES"],
|
||||
C.PI_RECOMMENDATIONS: ["XEP-0059", "EXTRA-PEP"],
|
||||
C.PI_MAIN: "XEP_0277",
|
||||
C.PI_HANDLER: "yes",
|
||||
|
|
@ -249,7 +249,7 @@ class XEP_0277(object):
|
|||
)
|
||||
key = check_conflict(u"{}_xhtml".format(elem.name))
|
||||
data = data_elt.toXml()
|
||||
microblog_data[key] = yield self.host.plugins["TEXT-SYNTAXES"].cleanXHTML(
|
||||
microblog_data[key] = yield self.host.plugins["TEXT_SYNTAXES"].cleanXHTML(
|
||||
data
|
||||
)
|
||||
else:
|
||||
|
|
@ -322,10 +322,10 @@ class XEP_0277(object):
|
|||
)
|
||||
)
|
||||
# ... and do the conversion if it's not
|
||||
microblog_data[key] = yield self.host.plugins["TEXT-SYNTAXES"].convert(
|
||||
microblog_data[key] = yield self.host.plugins["TEXT_SYNTAXES"].convert(
|
||||
microblog_data[u"{}_xhtml".format(key)],
|
||||
self.host.plugins["TEXT-SYNTAXES"].SYNTAX_XHTML,
|
||||
self.host.plugins["TEXT-SYNTAXES"].SYNTAX_TEXT,
|
||||
self.host.plugins["TEXT_SYNTAXES"].SYNTAX_XHTML,
|
||||
self.host.plugins["TEXT_SYNTAXES"].SYNTAX_TEXT,
|
||||
False,
|
||||
)
|
||||
|
||||
|
|
@ -472,7 +472,7 @@ class XEP_0277(object):
|
|||
entry_elt[(C.NS_XML, u"lang")] = data[u"language"].strip()
|
||||
|
||||
## content and title ##
|
||||
synt = self.host.plugins["TEXT-SYNTAXES"]
|
||||
synt = self.host.plugins["TEXT_SYNTAXES"]
|
||||
|
||||
for elem_name in ("title", "content"):
|
||||
for type_ in ["", "_rich", "_xhtml"]:
|
||||
|
|
@ -514,11 +514,11 @@ class XEP_0277(object):
|
|||
# so we create one from xhtml content
|
||||
elem_txt = entry_elt.addElement(elem_name)
|
||||
text_content = yield self.host.plugins[
|
||||
"TEXT-SYNTAXES"
|
||||
"TEXT_SYNTAXES"
|
||||
].convert(
|
||||
xml_content,
|
||||
self.host.plugins["TEXT-SYNTAXES"].SYNTAX_XHTML,
|
||||
self.host.plugins["TEXT-SYNTAXES"].SYNTAX_TEXT,
|
||||
self.host.plugins["TEXT_SYNTAXES"].SYNTAX_XHTML,
|
||||
self.host.plugins["TEXT_SYNTAXES"].SYNTAX_TEXT,
|
||||
False,
|
||||
)
|
||||
elem_txt.addContent(text_content)
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class XEP_groupblogTest(helpers.SatTestCase):
|
|||
self.host.plugins["XEP-0060"] = plugin_xep_0060.XEP_0060(self.host)
|
||||
self.host.plugins["XEP-0163"] = plugin_xep_0163.XEP_0163(self.host)
|
||||
reload(plugin_misc_text_syntaxes) # reload the plugin to avoid conflict error
|
||||
self.host.plugins["TEXT-SYNTAXES"] = plugin_misc_text_syntaxes.TextSyntaxes(
|
||||
self.host.plugins["TEXT_SYNTAXES"] = plugin_misc_text_syntaxes.TextSyntaxes(
|
||||
self.host
|
||||
)
|
||||
self.host.plugins["XEP-0277"] = plugin_xep_0277.XEP_0277(self.host)
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class XEP_0277Test(helpers.SatTestCase):
|
|||
self.host.plugins["XEP-0060"] = plugin_xep_0060.XEP_0060(self.host)
|
||||
self.host.plugins["XEP-0163"] = XEP_0163(self.host)
|
||||
reload(plugin_misc_text_syntaxes) # reload the plugin to avoid conflict error
|
||||
self.host.plugins["TEXT-SYNTAXES"] = plugin_misc_text_syntaxes.TextSyntaxes(
|
||||
self.host.plugins["TEXT_SYNTAXES"] = plugin_misc_text_syntaxes.TextSyntaxes(
|
||||
self.host
|
||||
)
|
||||
self.plugin = plugin_xep_0277.XEP_0277(self.host)
|
||||
|
|
|
|||
Loading…
Reference in a new issue