diff options
author | mathieui <mathieui@mathieui.net> | 2012-05-21 02:14:25 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-05-21 02:14:25 +0200 |
commit | 0af1c7fe9a03be34e14ae8ecc332f6d1fa168511 (patch) | |
tree | 845d50087b964486c1274cbecf3ebda30a21de0f /src/plugin.py | |
parent | 837b46d68b10f5c6e9cc80e07e33fd025b51634b (diff) | |
download | poezio-0af1c7fe9a03be34e14ae8ecc332f6d1fa168511.tar.gz poezio-0af1c7fe9a03be34e14ae8ecc332f6d1fa168511.tar.bz2 poezio-0af1c7fe9a03be34e14ae8ecc332f6d1fa168511.tar.xz poezio-0af1c7fe9a03be34e14ae8ecc332f6d1fa168511.zip |
Docstrings, and small cleanup
Diffstat (limited to 'src/plugin.py')
-rw-r--r-- | src/plugin.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugin.py b/src/plugin.py index f35bdab1..bd5c88be 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -1,3 +1,8 @@ +""" +Define the PluginConfig and Plugin classes, plus the SafetyMetaclass. +These are used in the plugin system added in poezio 0.7.5 +(see plugin_manager.py) +""" import os from configparser import RawConfigParser import config @@ -5,6 +10,11 @@ import inspect import traceback class PluginConfig(config.Config): + """ + Plugin configuration object. + They are accessible inside the plugin with self.config + and behave like the core Config object. + """ def __init__(self, filename, module_name): self.file_name = filename self.module_name = module_name @@ -28,6 +38,10 @@ class PluginConfig(config.Config): self.add_section(self.module_name) def options(self, section=None): + """ + Return the options of the section + If no section is given, it defaults to the plugin name. + """ if not section: section = self.module_name if not self.has_section(section): |