rpms/cracklib/devel cracklib-2.8.10-docstring.patch,NONE,1.1

Nalin Somabhai Dahyabhai (nalin) fedora-extras-commits at redhat.com
Thu Jul 19 14:04:40 UTC 2007


Author: nalin

Update of /cvs/pkgs/rpms/cracklib/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11990

Added Files:
	cracklib-2.8.10-docstring.patch 
Log Message:
- add a function definition so that help(cracklib) gives *something*. no idea
  how to provide a module summary from C, though


cracklib-2.8.10-docstring.patch:

--- NEW FILE cracklib-2.8.10-docstring.patch ---
Some docstrings for the Python module.  Need to figure out how to fix the
summary in the help() output.

diff -up cracklib-2.8.10/python/cracklibmodule.c cracklib-2.8.10/python/cracklibmodule.c
--- cracklib-2.8.10/python/cracklibmodule.c	2007-07-19 09:57:04.000000000 -0400
+++ cracklib-2.8.10/python/cracklibmodule.c	2007-07-19 09:57:48.000000000 -0400
@@ -24,7 +24,6 @@ static pthread_mutex_t cracklib_mutex = 
 static PyObject *
 cracklib_FascistCheck(PyObject *self, PyObject *args, PyObject *kwargs)
 {
-    int i;
     char *candidate, *dict;
     const char *result;
     struct stat st;
@@ -96,12 +95,21 @@ cracklib_FascistCheck(PyObject *self, Py
 static PyMethodDef
 cracklibmethods[] =
 {
-    {"FascistCheck", cracklib_FascistCheck, METH_VARARGS | METH_KEYWORDS},
+    {"FascistCheck", cracklib_FascistCheck, METH_VARARGS | METH_KEYWORDS,
+     "Keyword arguments:\n"
+     "  pw - candidate password\n"
+     "  dict - dictionary location (default \""
+     DEFAULT_CRACKLIB_DICT
+     "\")\n"
+     "\n"
+     "Returns:\n"
+     "  None on success, an error string on failure.\n"},
     {NULL, NULL},
 };
 
 void
 initcracklib(void)
 {
-    Py_InitModule("cracklib", cracklibmethods);
+    Py_InitModule3("cracklib", cracklibmethods,
+                   "Python interface to libcrack's FascistCheck() function.\n");
 }




More information about the fedora-extras-commits mailing list