Mercurial > libervia-backend
changeset 2780:85d3240a400f
plugin text syntaxes: changed import name to TEXT_SYNTAX (better with underscore for autocompletion)
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 19 Jan 2019 11:39:02 +0100 |
parents | 4cfa2085aebf |
children | 816be0a23877 |
files | sat/plugins/plugin_blog_import.py sat/plugins/plugin_misc_text_syntaxes.py sat/plugins/plugin_syntax_wiki_dotclear.py sat/plugins/plugin_xep_0071.py sat/plugins/plugin_xep_0277.py sat/test/test_plugin_misc_groupblog.py sat/test/test_plugin_xep_0277.py |
diffstat | 7 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/sat/plugins/plugin_blog_import.py Sat Jan 19 11:38:54 2019 +0100 +++ b/sat/plugins/plugin_blog_import.py Sat Jan 19 11:39:02 2019 +0100 @@ -39,7 +39,7 @@ 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 @@ 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(
--- a/sat/plugins/plugin_misc_text_syntaxes.py Sat Jan 19 11:38:54 2019 +0100 +++ b/sat/plugins/plugin_misc_text_syntaxes.py Sat Jan 19 11:39:02 2019 +0100 @@ -112,7 +112,7 @@ 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: [],
--- a/sat/plugins/plugin_syntax_wiki_dotclear.py Sat Jan 19 11:38:54 2019 +0100 +++ b/sat/plugins/plugin_syntax_wiki_dotclear.py Sat Jan 19 11:39:02 2019 +0100 @@ -34,7 +34,7 @@ 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 @@ 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] )
--- a/sat/plugins/plugin_xep_0071.py Sat Jan 19 11:38:54 2019 +0100 +++ b/sat/plugins/plugin_xep_0071.py Sat Jan 19 11:39:02 2019 +0100 @@ -49,7 +49,7 @@ 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 @@ 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,
--- a/sat/plugins/plugin_xep_0277.py Sat Jan 19 11:38:54 2019 +0100 +++ b/sat/plugins/plugin_xep_0277.py Sat Jan 19 11:39:02 2019 +0100 @@ -55,7 +55,7 @@ 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 @@ ) 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 @@ ) ) # ... 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 @@ 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 @@ # 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)
--- a/sat/test/test_plugin_misc_groupblog.py Sat Jan 19 11:38:54 2019 +0100 +++ b/sat/test/test_plugin_misc_groupblog.py Sat Jan 19 11:39:02 2019 +0100 @@ -155,7 +155,7 @@ 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)
--- a/sat/test/test_plugin_xep_0277.py Sat Jan 19 11:38:54 2019 +0100 +++ b/sat/test/test_plugin_xep_0277.py Sat Jan 19 11:39:02 2019 +0100 @@ -82,7 +82,7 @@ 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)