Skip to content

Commit a8db677

Browse files
committed
Added mapcode.__doc__ documentation.
1 parent a7ba3d1 commit a8db677

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

mapcodemodule.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static PyObject *version(PyObject *self, PyObject *args)
3232
static char isvalid_doc[] =
3333
"isvalid()\n\
3434
\n\
35-
Verify if the provided mapcode has the right syntax.\n";
35+
Verify if the provided mapcode has the correct syntax.\n";
3636

3737
static PyObject *isvalid(PyObject *self, PyObject *args)
3838
{
@@ -160,6 +160,16 @@ static PyObject *encode_single(PyObject *self, PyObject *args)
160160
}
161161

162162

163+
static char mapcode_doc[] =
164+
"Support for mapcodes. (See http://www.mapcode.org/).\n\
165+
\n\
166+
This module exports the following functions:\n\
167+
version Returns the version of the mapcode C-library used.\n\
168+
isvalid Verifies if the provided mapcode has the correct syntax.\n\
169+
decode Decodes a mapcode to latitude and longitude.\n\
170+
encode Encodes latitude and longitude to one or more mapcodes.\n\
171+
encode_single Encodes latitude and longitude to shortest mapcode possible.\n";
172+
163173
/* The methods we expose in Python. */
164174
static PyMethodDef mapcode_methods[] = {
165175
{ "version", version, METH_VARARGS, version_doc },
@@ -170,9 +180,8 @@ static PyMethodDef mapcode_methods[] = {
170180
{ NULL, NULL, 0, NULL }
171181
};
172182

173-
174183
/* Initialisation that gets called when module is imported. */
175184
PyMODINIT_FUNC initmapcode(void)
176185
{
177-
Py_InitModule("mapcode", mapcode_methods);
186+
Py_InitModule3("mapcode", mapcode_methods, mapcode_doc);
178187
}

0 commit comments

Comments
 (0)