Change docstrings from being C programmer oriented to being Python programmer oriented
diff --git a/src/crypto/crypto.c b/src/crypto/crypto.c
index 257c016..e12c72a 100644
--- a/src/crypto/crypto.c
+++ b/src/crypto/crypto.c
@@ -49,14 +49,13 @@
static char crypto_load_privatekey_doc[] = "\n\
Load a private key from a buffer\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be:\n\
- type - The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
- buffer - The buffer the key is stored in\n\
- passphrase - (optional) if encrypted PEM format, this can be\n\
- either the passphrase to use, or a callback for\n\
- providing the passphrase.\n\
-Returns: The PKey object\n\
+@param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
+@param buffer: The buffer the key is stored in\n\
+@param passphrase: (optional) if encrypted PEM format, this can be\n\
+ either the passphrase to use, or a callback for\n\
+ providing the passphrase.\n\
+\n\
+@return: The PKey object\n\
";
static PyObject *
@@ -123,16 +122,15 @@
static char crypto_dump_privatekey_doc[] = "\n\
Dump a private key to a buffer\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be:\n\
- type - The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
- pkey - The PKey to dump\n\
- cipher - (optional) if encrypted PEM format, the cipher to\n\
- use\n\
- passphrase - (optional) if encrypted PEM format, this can be either\n\
- the passphrase to use, or a callback for providing the\n\
- passphrase.\n\
-Returns: The buffer with the dumped key in\n\
+@param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
+@param pkey: The PKey to dump\n\
+@param cipher: (optional) if encrypted PEM format, the cipher to\n\
+ use\n\
+@param passphrase - (optional) if encrypted PEM format, this can be either\n\
+ the passphrase to use, or a callback for providing the\n\
+ passphrase.\n\
+@return: The buffer with the dumped key in\n\
+@rtype: C{str}\n\
";
static PyObject *
@@ -229,11 +227,9 @@
static char crypto_load_certificate_doc[] = "\n\
Load a certificate from a buffer\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be:\n\
- type - The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
+@param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
buffer - The buffer the certificate is stored in\n\
-Returns: The X509 object\n\
+@return: The X509 object\n\
";
static PyObject *
@@ -278,11 +274,9 @@
static char crypto_dump_certificate_doc[] = "\n\
Dump a certificate to a buffer\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be:\n\
- type - The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
- cert - The certificate to dump\n\
-Returns: The buffer with the dumped certificate in\n\
+@param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
+@param cert: The certificate to dump\n\
+@return: The buffer with the dumped certificate in\n\
";
static PyObject *
@@ -336,11 +330,9 @@
static char crypto_load_certificate_request_doc[] = "\n\
Load a certificate request from a buffer\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be:\n\
- type - The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
+@param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
buffer - The buffer the certificate request is stored in\n\
-Returns: The X509Req object\n\
+@return: The X509Req object\n\
";
static PyObject *
@@ -385,11 +377,9 @@
static char crypto_dump_certificate_request_doc[] = "\n\
Dump a certificate request to a buffer\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be:\n\
- type - The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
+@param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)\n\
req - The certificate request to dump\n\
-Returns: The buffer with the dumped certificate request in\n\
+@return: The buffer with the dumped certificate request in\n\
";
static PyObject *
@@ -443,11 +433,9 @@
static char crypto_load_pkcs7_data_doc[] = "\n\
Load pkcs7 data from a buffer\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The argument tuple, should be:\n\
- type - The file type (one of FILETYPE_PEM or FILETYPE_ASN1)\n\
+@param type: The file type (one of FILETYPE_PEM or FILETYPE_ASN1)\n\
buffer - The buffer with the pkcs7 data.\n\
-Returns: The PKCS7 object\n\
+@return: The PKCS7 object\n\
";
static PyObject *
@@ -497,11 +485,9 @@
static char crypto_load_pkcs12_doc[] = "\n\
Load a PKCS12 object from a buffer\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be:\n\
- buffer - The buffer the certificate is stored in\n\
- passphrase (Optional) - The password to decrypt the PKCS12 lump\n\
-Returns: The PKCS12 object\n\
+@param buffer: The buffer the certificate is stored in\n\
+ passphrase (Optional) - The password to decrypt the PKCS12 lump\n\
+@returns: The PKCS12 object\n\
";
static PyObject *
@@ -533,9 +519,7 @@
The factory function inserted in the module dictionary to create X509\n\
objects\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be empty\n\
-Returns: The X509 object\n\
+@returns: The X509 object\n\
";
static PyObject *
@@ -551,10 +535,8 @@
The factory function inserted in the module dictionary as a copy\n\
constructor for X509Name objects.\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be:\n\
- name - An X509Name object to copy\n\
-Returns: The X509Name object\n\
+@param name: An X509Name object to copy\n\
+@return: The X509Name object\n\
";
static PyObject *
@@ -572,9 +554,7 @@
The factory function inserted in the module dictionary to create X509Req\n\
objects\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be empty\n\
-Returns: The X509Req object\n\
+@returns: The X509Req object\n\
";
static PyObject *
@@ -590,9 +570,7 @@
The factory function inserted in the module dictionary to create PKey\n\
objects\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be empty\n\
-Returns: The PKey object\n\
+@return: The PKey object\n\
";
static PyObject *
@@ -614,12 +592,12 @@
The factory function inserted in the module dictionary to create\n\
X509Extension objects.\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be\n\
- typename - ???\n\
- critical - ???\n\
- value - ???\n\
-Returns: The X509Extension object\n\
+@param typename: The name of the extension to create.\n\
+@type typename: C{str}\n\
+@param critical: A flag indicating whether this is a critical extension.\n\
+@param value: The value of the extension.\n\
+@type value: C{str}\n\
+@return: The X509Extension object\n\
";
static PyObject *
@@ -639,10 +617,9 @@
The factory function inserted in the module dictionary to create NetscapeSPKI\n\
objects\n\
\n\
-Arguments: spam - Always NULL\n\
- args - The Python argument tuple, should be empty or, optionally\n\
- enc - Base64 encoded NetscapeSPKI object.\n\
-Returns: The NetscapeSPKI object\n\
+@param enc: Base64 encoded NetscapeSPKI object.\n\
+@type enc: C{str}\n\
+@return: The NetscapeSPKI object\n\
";
static PyObject *
@@ -670,8 +647,8 @@
static char crypto_X509_verify_cert_error_string_doc[] = "\n\
Get X509 verify certificate error string.\n\
\n\
-Arguments: errnum - Error number\n\
-Returns: Error string as a Python string\n\
+@param errnum: The error number.\n\
+@return: Error string as a Python string\n\
";
static PyObject *