From: Oz Date: Sun, 16 Dec 2012 22:27:09 +0000 (+0100) Subject: add docstring to insert and remove methods X-Git-Tag: v0.9.1~5^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9da1d454345806da6ff88276817cdc6c012ed4af;p=python-kmod.git add docstring to insert and remove methods --- diff --git a/kmod/module.pyx b/kmod/module.pyx index eadfbbf..42aa92e 100644 --- a/kmod/module.pyx +++ b/kmod/module.pyx @@ -117,6 +117,13 @@ cdef class Module (object): def insert(self, flags=0, extra_options=None, install_callback=None, data=None, print_action_callback=None): + """ + insert module to current tree. + e.g. + km = kmod.Kmod() + tp = km.module_from_name("thinkpad_acpi") + tp.insert(extra_options='fan_control=1') + """ cdef char *opt = NULL #cdef _libkmod_h.install_callback_t install = NULL cdef int (*install)( @@ -139,6 +146,13 @@ cdef class Module (object): raise _KmodError('Could not load module') def remove(self, flags=0): + """ + remove module from current tree + e.g. + km = kmod.Kmod() + tp = km.module_from_name("thinkpad_acpi") + tp.remove() + """ err = _libkmod_h.kmod_module_remove_module(self.module, flags) if err < 0: raise _KmodError('Could not remove module')