diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/de/autogen/plugin_api/hdata.asciidoc | 2 | ||||
-rw-r--r-- | doc/de/autogen/plugin_api/plugins_priority.asciidoc | 12 | ||||
-rw-r--r-- | doc/docgen.py | 55 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/hdata.asciidoc | 2 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/plugins_priority.asciidoc | 12 | ||||
-rw-r--r-- | doc/en/weechat_plugin_api.en.asciidoc | 25 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/hdata.asciidoc | 2 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/plugins_priority.asciidoc | 12 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.asciidoc | 18 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/hdata.asciidoc | 2 | ||||
-rw-r--r-- | doc/it/autogen/plugin_api/plugins_priority.asciidoc | 12 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.asciidoc | 20 | ||||
-rw-r--r-- | doc/ja/autogen/plugin_api/hdata.asciidoc | 2 | ||||
-rw-r--r-- | doc/ja/autogen/plugin_api/plugins_priority.asciidoc | 12 | ||||
-rw-r--r-- | doc/ja/weechat_plugin_api.ja.asciidoc | 20 | ||||
-rw-r--r-- | doc/pl/autogen/plugin_api/hdata.asciidoc | 2 | ||||
-rw-r--r-- | doc/pl/autogen/plugin_api/plugins_priority.asciidoc | 12 |
17 files changed, 194 insertions, 28 deletions
diff --git a/doc/de/autogen/plugin_api/hdata.asciidoc b/doc/de/autogen/plugin_api/hdata.asciidoc index 2f66dad4b..2aac4832d 100644 --- a/doc/de/autogen/plugin_api/hdata.asciidoc +++ b/doc/de/autogen/plugin_api/hdata.asciidoc @@ -843,6 +843,8 @@ *** 'version' (string) *** 'license' (string) *** 'charset' (string) +*** 'priority' (integer) +*** 'initialized' (integer) *** 'debug' (integer) *** 'prev_plugin' (pointer, hdata: "plugin") *** 'next_plugin' (pointer, hdata: "plugin") diff --git a/doc/de/autogen/plugin_api/plugins_priority.asciidoc b/doc/de/autogen/plugin_api/plugins_priority.asciidoc new file mode 100644 index 000000000..d5a171b0b --- /dev/null +++ b/doc/de/autogen/plugin_api/plugins_priority.asciidoc @@ -0,0 +1,12 @@ +. charset (13000) +. logger (12000) +. exec (11000) +. trigger (10000) +. aspell (9000) +. alias (8000) +. fifo (7000) +. xfer (6000) +. irc (5000) +. relay (4000) +. guile, lua, perl, python, ruby, tcl (3000) +. script (2000) diff --git a/doc/docgen.py b/doc/docgen.py index d75ee914d..6ba11f0c4 100644 --- a/doc/docgen.py +++ b/doc/docgen.py @@ -351,6 +351,23 @@ def get_irc_colors(): return irc_colors +def get_plugins_priority(): + """ + Get priority of default WeeChat plugins as a dictionary. + """ + plugins_priority = {} + infolist = weechat.infolist_get('plugin', '', '') + while weechat.infolist_next(infolist): + name = weechat.infolist_string(infolist, 'name') + priority = weechat.infolist_integer(infolist, 'priority') + if priority in plugins_priority: + plugins_priority[priority].append(name) + else: + plugins_priority[priority] = [name] + weechat.infolist_free(infolist) + return plugins_priority + + def update_file(oldfile, newfile, num_files, num_files_updated, obj): """Update a doc file.""" try: @@ -394,6 +411,7 @@ def docgen_cmd_cb(data, buf, args): completions = get_completions() url_options = get_url_options() irc_colors = get_irc_colors() + plugins_priority = get_plugins_priority() # get path and replace ~ by home if needed path = weechat.config_get_plugin('path') @@ -675,34 +693,23 @@ def docgen_cmd_cb(data, buf, args): update_file(filename, tmpfilename, num_files, num_files_updated, 'irc_colors') + # write plugins priority + filename = directory + '/plugin_api/plugins_priority.asciidoc' + tmpfilename = filename + '.tmp' + _file = open(tmpfilename, 'w') + for priority in sorted(plugins_priority, reverse=True): + plugins = ', '.join(sorted(plugins_priority[priority])) + _file.write('. {0} ({1})\n'.format(escape(plugins), priority)) + _file.close() + update_file(filename, tmpfilename, num_files, num_files_updated, + 'plugins_priority') + # write counters weechat.prnt('', - 'docgen: {0}: {1:3d} files ' - '({2:2d} cmd, {3:2d} opt, {4:2d} infos, ' - '{5:2d} infos_hash, {6:2d} infolists, {7:2d} hdata, ' - '{8:2d} complt)' + 'docgen: {0}: {1} files, {2} updated' ''.format(locale, num_files['total1'], - num_files['commands'], - num_files['options'], - num_files['infos'], - num_files['infos_hashtable'], - num_files['infolists'], - num_files['hdata'], - num_files['completions'])) - weechat.prnt('', - ' ' - '{0:3d} updated ({1:2d} cmd, {2:2d} opt, {3:2d} infos, ' - '{4:2d} infos_hash, {5:2d} infolists, {6:2d} hdata, ' - '{7:2d} complt)' - ''.format(num_files_updated['total1'], - num_files_updated['commands'], - num_files_updated['options'], - num_files_updated['infos'], - num_files_updated['infos_hashtable'], - num_files_updated['infolists'], - num_files_updated['hdata'], - num_files_updated['completions'])) + num_files_updated['total1'])) weechat.prnt('', 'docgen: total: {0} files, {1} updated' ''.format(num_files['total2'], num_files_updated['total2'])) diff --git a/doc/en/autogen/plugin_api/hdata.asciidoc b/doc/en/autogen/plugin_api/hdata.asciidoc index 8b82d23f9..48afef9bd 100644 --- a/doc/en/autogen/plugin_api/hdata.asciidoc +++ b/doc/en/autogen/plugin_api/hdata.asciidoc @@ -843,6 +843,8 @@ *** 'version' (string) *** 'license' (string) *** 'charset' (string) +*** 'priority' (integer) +*** 'initialized' (integer) *** 'debug' (integer) *** 'prev_plugin' (pointer, hdata: "plugin") *** 'next_plugin' (pointer, hdata: "plugin") diff --git a/doc/en/autogen/plugin_api/plugins_priority.asciidoc b/doc/en/autogen/plugin_api/plugins_priority.asciidoc new file mode 100644 index 000000000..d5a171b0b --- /dev/null +++ b/doc/en/autogen/plugin_api/plugins_priority.asciidoc @@ -0,0 +1,12 @@ +. charset (13000) +. logger (12000) +. exec (11000) +. trigger (10000) +. aspell (9000) +. alias (8000) +. fifo (7000) +. xfer (6000) +. irc (5000) +. relay (4000) +. guile, lua, perl, python, ruby, tcl (3000) +. script (2000) diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc index 8b71bf8ce..5deef0cd4 100644 --- a/doc/en/weechat_plugin_api.en.asciidoc +++ b/doc/en/weechat_plugin_api.en.asciidoc @@ -45,16 +45,19 @@ This file defines structures and types used to communicate with WeeChat. The plugin must use some macros (to define some variables): WEECHAT_PLUGIN_NAME("name"):: - plugin name + the plugin name WEECHAT_PLUGIN_DESCRIPTION("description"):: - short description of plugin + a short description of plugin WEECHAT_PLUGIN_VERSION("1.0"):: - plugin version + the plugin version WEECHAT_PLUGIN_LICENSE("GPL3"):: - plugin license + the plugin license + +WEECHAT_PLUGIN_PRIORITY(1000):: + the plugin priority (optional, see below) [[main_functions]] === Main functions @@ -87,6 +90,20 @@ Return value: * 'WEECHAT_RC_OK' if successful (plugin will be loaded) * 'WEECHAT_RC_ERROR' if error (plugin will NOT be loaded) +[[plugin_priority]] +===== Plugin priority + +When plugins are auto-loaded (for example on startup), WeeChat first loads all +plugins, and then calls the 'init' functions, using the priority defined in +each plugin. A high priority means that the 'init' function is called first. + +Default priority is 1000 (with such priority, the plugin is loaded after all +default plugins). + +The default WeeChat plugins are initialized in this order: + +include::autogen/plugin_api/plugins_priority.asciidoc[] + ==== weechat_plugin_end This function is called when plugin is unloaded by WeeChat. diff --git a/doc/fr/autogen/plugin_api/hdata.asciidoc b/doc/fr/autogen/plugin_api/hdata.asciidoc index 2e8242b68..4d7c06bcb 100644 --- a/doc/fr/autogen/plugin_api/hdata.asciidoc +++ b/doc/fr/autogen/plugin_api/hdata.asciidoc @@ -843,6 +843,8 @@ *** 'version' (string) *** 'license' (string) *** 'charset' (string) +*** 'priority' (integer) +*** 'initialized' (integer) *** 'debug' (integer) *** 'prev_plugin' (pointer, hdata: "plugin") *** 'next_plugin' (pointer, hdata: "plugin") diff --git a/doc/fr/autogen/plugin_api/plugins_priority.asciidoc b/doc/fr/autogen/plugin_api/plugins_priority.asciidoc new file mode 100644 index 000000000..d5a171b0b --- /dev/null +++ b/doc/fr/autogen/plugin_api/plugins_priority.asciidoc @@ -0,0 +1,12 @@ +. charset (13000) +. logger (12000) +. exec (11000) +. trigger (10000) +. aspell (9000) +. alias (8000) +. fifo (7000) +. xfer (6000) +. irc (5000) +. relay (4000) +. guile, lua, perl, python, ruby, tcl (3000) +. script (2000) diff --git a/doc/fr/weechat_plugin_api.fr.asciidoc b/doc/fr/weechat_plugin_api.fr.asciidoc index 3cfa93f1c..f8e920bce 100644 --- a/doc/fr/weechat_plugin_api.fr.asciidoc +++ b/doc/fr/weechat_plugin_api.fr.asciidoc @@ -58,6 +58,9 @@ WEECHAT_PLUGIN_VERSION("1.0"):: WEECHAT_PLUGIN_LICENSE("GPL3"):: licence de l'extension +WEECHAT_PLUGIN_PRIORITY(1000):: + priorité de l'extension (facultatif, voir ci-dessous) + [[main_functions]] === Fonctions principales @@ -90,6 +93,21 @@ Valeur de retour : * 'WEECHAT_RC_OK' si ok (l'extension sera chargée) * 'WEECHAT_RC_ERROR' si erreur (l'extension ne sera PAS chargée) +[[plugin_priority]] +===== Priorité de l'extension + +Lorsque les extensions sont automatiquement chargées (par exemple au +démarrage), WeeChat charge d'abord toutes les extensions, puis appelle les +fonctions 'init', en utilisant la priorité définie dans chaque extension. +Une grande priorité signifie que la fonction 'init' est appelée en premier. + +La priorité par défaut est 1000 (avec une telle priorité, l'extension est +chargée après toutes les extensions par défaut). + +Les extensions par défaut de WeeChat sont initialisées dans cet ordre : + +include::autogen/plugin_api/plugins_priority.asciidoc[] + ==== weechat_plugin_end Cette fonction est appelée quand l'extension est déchargée par WeeChat. diff --git a/doc/it/autogen/plugin_api/hdata.asciidoc b/doc/it/autogen/plugin_api/hdata.asciidoc index 5c70d6c63..7ea6f5bda 100644 --- a/doc/it/autogen/plugin_api/hdata.asciidoc +++ b/doc/it/autogen/plugin_api/hdata.asciidoc @@ -843,6 +843,8 @@ *** 'version' (string) *** 'license' (string) *** 'charset' (string) +*** 'priority' (integer) +*** 'initialized' (integer) *** 'debug' (integer) *** 'prev_plugin' (pointer, hdata: "plugin") *** 'next_plugin' (pointer, hdata: "plugin") diff --git a/doc/it/autogen/plugin_api/plugins_priority.asciidoc b/doc/it/autogen/plugin_api/plugins_priority.asciidoc new file mode 100644 index 000000000..d5a171b0b --- /dev/null +++ b/doc/it/autogen/plugin_api/plugins_priority.asciidoc @@ -0,0 +1,12 @@ +. charset (13000) +. logger (12000) +. exec (11000) +. trigger (10000) +. aspell (9000) +. alias (8000) +. fifo (7000) +. xfer (6000) +. irc (5000) +. relay (4000) +. guile, lua, perl, python, ruby, tcl (3000) +. script (2000) diff --git a/doc/it/weechat_plugin_api.it.asciidoc b/doc/it/weechat_plugin_api.it.asciidoc index d8fae2550..35a82b4c4 100644 --- a/doc/it/weechat_plugin_api.it.asciidoc +++ b/doc/it/weechat_plugin_api.it.asciidoc @@ -63,6 +63,10 @@ WEECHAT_PLUGIN_VERSION("1.0"):: WEECHAT_PLUGIN_LICENSE("GPL3"):: licenza del plugin +// TRANSLATION MISSING +WEECHAT_PLUGIN_PRIORITY(1000):: + the plugin priority (optional, see below) + [[main_functions]] === Funzioni principali @@ -98,6 +102,22 @@ Valori restituiti: * 'WEECHAT_RC_ERROR' se c'è un errore (il plugin NON verrà caricato) +// TRANSLATION MISSING +[[plugin_priority]] +===== Plugin priority + +// TRANSLATION MISSING +When plugins are auto-loaded (for example on startup), WeeChat first loads all +plugins, and then calls the 'init' functions, using the priority defined in +each plugin. A high priority means that the 'init' function is called first. + +Default priority is 1000 (with such priority, the plugin is loaded after all +default plugins). + +The default WeeChat plugins are initialized in this order: + +include::autogen/plugin_api/plugins_priority.asciidoc[] + ==== weechat_plugin_end Questa funzione viene chiamata quando il plugin viene diff --git a/doc/ja/autogen/plugin_api/hdata.asciidoc b/doc/ja/autogen/plugin_api/hdata.asciidoc index 65e1f906e..dbffd4c99 100644 --- a/doc/ja/autogen/plugin_api/hdata.asciidoc +++ b/doc/ja/autogen/plugin_api/hdata.asciidoc @@ -843,6 +843,8 @@ *** 'version' (string) *** 'license' (string) *** 'charset' (string) +*** 'priority' (integer) +*** 'initialized' (integer) *** 'debug' (integer) *** 'prev_plugin' (pointer, hdata: "plugin") *** 'next_plugin' (pointer, hdata: "plugin") diff --git a/doc/ja/autogen/plugin_api/plugins_priority.asciidoc b/doc/ja/autogen/plugin_api/plugins_priority.asciidoc new file mode 100644 index 000000000..d5a171b0b --- /dev/null +++ b/doc/ja/autogen/plugin_api/plugins_priority.asciidoc @@ -0,0 +1,12 @@ +. charset (13000) +. logger (12000) +. exec (11000) +. trigger (10000) +. aspell (9000) +. alias (8000) +. fifo (7000) +. xfer (6000) +. irc (5000) +. relay (4000) +. guile, lua, perl, python, ruby, tcl (3000) +. script (2000) diff --git a/doc/ja/weechat_plugin_api.ja.asciidoc b/doc/ja/weechat_plugin_api.ja.asciidoc index a5e0c0a40..4f88732a9 100644 --- a/doc/ja/weechat_plugin_api.ja.asciidoc +++ b/doc/ja/weechat_plugin_api.ja.asciidoc @@ -62,6 +62,10 @@ WEECHAT_PLUGIN_VERSION("1.0"):: WEECHAT_PLUGIN_LICENSE("GPL3"):: プラグインのライセンス +// TRANSLATION MISSING +WEECHAT_PLUGIN_PRIORITY(1000):: + the plugin priority (optional, see below) + [[main_functions]] === 重要な関数 @@ -93,6 +97,22 @@ int weechat_plugin_init (struct t_weechat_plugin *plugin, * 'WEECHAT_RC_OK' 成功した場合 (プラグインを読み込みます) * 'WEECHAT_RC_ERROR' エラーが起きた場合 (プラグインを読み込みません) +// TRANSLATION MISSING +[[plugin_priority]] +===== Plugin priority + +// TRANSLATION MISSING +When plugins are auto-loaded (for example on startup), WeeChat first loads all +plugins, and then calls the 'init' functions, using the priority defined in +each plugin. A high priority means that the 'init' function is called first. + +Default priority is 1000 (with such priority, the plugin is loaded after all +default plugins). + +The default WeeChat plugins are initialized in this order: + +include::autogen/plugin_api/plugins_priority.asciidoc[] + ==== weechat_plugin_end WeeChat プラグインを再読み込みする際にこの関数を呼び出します。 diff --git a/doc/pl/autogen/plugin_api/hdata.asciidoc b/doc/pl/autogen/plugin_api/hdata.asciidoc index 6e92ef980..bf962a9df 100644 --- a/doc/pl/autogen/plugin_api/hdata.asciidoc +++ b/doc/pl/autogen/plugin_api/hdata.asciidoc @@ -843,6 +843,8 @@ *** 'version' (string) *** 'license' (string) *** 'charset' (string) +*** 'priority' (integer) +*** 'initialized' (integer) *** 'debug' (integer) *** 'prev_plugin' (pointer, hdata: "plugin") *** 'next_plugin' (pointer, hdata: "plugin") diff --git a/doc/pl/autogen/plugin_api/plugins_priority.asciidoc b/doc/pl/autogen/plugin_api/plugins_priority.asciidoc new file mode 100644 index 000000000..d5a171b0b --- /dev/null +++ b/doc/pl/autogen/plugin_api/plugins_priority.asciidoc @@ -0,0 +1,12 @@ +. charset (13000) +. logger (12000) +. exec (11000) +. trigger (10000) +. aspell (9000) +. alias (8000) +. fifo (7000) +. xfer (6000) +. irc (5000) +. relay (4000) +. guile, lua, perl, python, ruby, tcl (3000) +. script (2000) |