Commits

marcus  committed ecba0b4

Added doc strings for sdlext.draw module. Fixed :exc: rST marker for C API doc strings and XML call node for documentation generator.

  • Participants
  • Parent commits 66bbde3
  • Branches pgreloaded

Comments (0)

Files changed (5)

-PYTHON = python
+PYTHON = python3.0
 top_srcdir = `pwd`
 SUBDIRS = \
 	$(top_srcdir)/config \
 
 build:
 	@echo "Running build..."
-	@$(PYTHON) setup.py build -c mingw32
+	@$(PYTHON) setup.py build #-c mingw32
 	@echo "Build finished, invoke 'make install' to install."
 
 install:

File doc/MODULE_FAQ.txt

   ABS(x)         - returns the absolute value
   trunc(x)       - truncates a number
   round(x)       - rounds a number
+  DEG2RAD        - converts degrees to radians
+  DEG2RAD        - converts radians to degrees
   ADD_LIMIT(x,y) - variable addition using overflow limits
   SUB_LIMIT(x,y) - variable subtraction using overflow limits
 

File doc/create_cref.py

             l = l.replace (":class:", "       ")
             l = l.replace (":meth:", "      ")
             l = l.replace (":ref:", "     ")
+            l = l.replace (":exc:", "     ")
             l = l.replace ("`", " ")
         else:
             l = l.replace (":const:", "")
             l = l.replace (":class:", "")
             l = l.replace (":meth:", "")
             l = l.replace (":ref:", "")
+            l = l.replace (":exc:", "")
             l = l.replace ("`", "")
         
         tmptext += l + "\\n"
     funcs = module.getElementsByTagName ("func")
     for func in funcs:
         name = func.getAttribute ("name").upper ()
-        call = func.getAttribute ("call") + "\n"
+        call = ""
+        node = func.getElementsByTagName ("call")
+        if node and node[0].firstChild:
+            call = node[0].firstChild.nodeValue + "\n"
         node = func.getElementsByTagName ("desc")
         desc = call
         if node and node[0].firstChild:

File src/sdl/rwopsmod.c

         /* TODO: allow wb ops! */
         return SDL_RWFromFile (name, "rb");
     }
+#warning FIXME: Do not use the file descriptor, but a FILE* handle!
 #ifdef IS_PYTHON_3
     else if ((fd = PyObject_AsFileDescriptor (obj)) != -1)
         return SDL_RWFromFP (fd, 0);

File src/sdlext/drawmod.c

 #include "pgsdlext.h"
 #include "pgsdl.h"
 #include "draw.h"
+#include "sdlextdraw_doc.h"
 #include "surface.h"
 
+
 static PyObject* _draw_aaline (PyObject* self, PyObject* args);
 static PyObject* _draw_line (PyObject* self, PyObject* args);
 static PyObject* _draw_aalines (PyObject* self, PyObject* args);
 
 static PyMethodDef _draw_methods[] =
 {
-    { "aaline", _draw_aaline, METH_VARARGS, "" },
-    { "line", _draw_line, METH_VARARGS, "" },
-    { "aalines", _draw_aalines, METH_VARARGS, "" },
-    { "lines", _draw_lines, METH_VARARGS, "" },
-    { "ellipse", _draw_ellipse, METH_VARARGS, "" },
-    { "arc", _draw_arc, METH_VARARGS, "" },
-    { "circle", _draw_circle, METH_VARARGS, "" },
-    { "polygon", _draw_polygon, METH_VARARGS, "" },
-    { "aapolygon", _draw_aapolygon, METH_VARARGS, "" },
-    { "rect", _draw_rect, METH_VARARGS, "" },
+    { "aaline", _draw_aaline, METH_VARARGS, DOC_DRAW_AALINE },
+    { "line", _draw_line, METH_VARARGS, DOC_DRAW_LINE },
+    { "aalines", _draw_aalines, METH_VARARGS, DOC_DRAW_AALINES },
+    { "lines", _draw_lines, METH_VARARGS, DOC_DRAW_LINES },
+    { "ellipse", _draw_ellipse, METH_VARARGS, DOC_DRAW_ELLIPSE },
+    { "arc", _draw_arc, METH_VARARGS, DOC_DRAW_ARC },
+    { "circle", _draw_circle, METH_VARARGS, DOC_DRAW_CIRCLE },
+    { "polygon", _draw_polygon, METH_VARARGS, DOC_DRAW_POLYGON },
+    { "aapolygon", _draw_aapolygon, METH_VARARGS, DOC_DRAW_AAPOLYGON },
+    { "rect", _draw_rect, METH_VARARGS, DOC_DRAW_RECT },
     { NULL, NULL, 0, NULL }
 };
 
     static struct PyModuleDef _module = {
         PyModuleDef_HEAD_INIT,
         "draw",
-        "",
+        DOC_DRAW,
         -1,
         _draw_methods,
         NULL, NULL, NULL, NULL
     };
     mod = PyModule_Create (&_module);
 #else
-    mod = Py_InitModule3 ("draw", _draw_methods, NULL);
+    mod = Py_InitModule3 ("draw", _draw_methods, DOC_DRAW);
 #endif
     if (!mod)
         goto fail;