Commits

Anonymous committed af46d8b

Added version infos. Minor doc improvements for generic module information.

Comments (0)

Files changed (23)

 
 docclean:
 	-rm -rf sphinx/build *~ *.pyc *.orig ref/pygame2_*
+	-rm -f ref/pygame2.rst
 	-rm -f builddarwin.rst buildmingw.rst buildunix.rst buildvc.rst
 	-rm -f newmodules.rst module_faq.rst news.rst
 
 # built documents.
 #
 # The short X.Y version.
-version = '2.0.0-alpha1'
+version = '2.0.0-alpha2'
 # The full version, including alpha/beta/rc tags.
-release = '2.0.0-alpha1'
+release = '2.0.0-alpha2'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

doc/create_rstref.py

 class Doc(object):
     def __init__ (self, filename):
         self.filename = filename
+        self.showhead = True
         self.modulename = None
         self.modulealias = None
         self.shortdesc = "TODO"
         self.example = ""
         self.classes = []
         self.functions = []
+        self.includes = []
     
     def parse_content (self):
         dom = parse (self.filename)
         module = self.get_module_docs (dom)
         self.get_module_funcs (module)
         self.get_class_refs (module)
+        self.get_includes (module)
+
+    def get_includes (self, module):
+        incs = module.getElementsByTagName ("include")
+        for node in incs:
+            self.includes.append (node.firstChild.nodeValue)
     
     def get_module_docs (self, dom):
         module = dom.getElementsByTagName ("module")[0]
         self.modulename = module.getAttribute ("name")
+        node = module.getElementsByTagName ("show")
+        if node and node[0].firstChild.nodeValue:
+            self.showhead = node[0].firstChild.nodeValue == "1"
         node = module.getElementsByTagName ("alias")
         if node and node[0].firstChild:
             self.modulealias = node[0].firstChild.nodeValue
             self.modulealias = self.modulealias.strip ()
+
         node = module.getElementsByTagName ("short")[0]
         if node.firstChild:
             self.shortdesc = node.firstChild.nodeValue
         if self.modulealias:
             name = self.modulealias
 
-        fp.write (":mod:`%s` -- %s\n" % (name, self.shortdesc))
-        fp.write ("%s\n" % ("=" * (11 + len (name) + len (self.shortdesc))))
-        fp.write ("%s" % self.create_desc_rst (self.description))
-        fp.write (".. module:: %s\n" % (name))
-        fp.write ("   :synopsis: %s\n\n" % (self.shortdesc))
+        if self.showhead:
+            fp.write (":mod:`%s` -- %s\n" % (name, self.shortdesc))
+            fp.write ("%s\n" % ("=" * (11 + len (name) + len (self.shortdesc))))
+            fp.write ("%s" % self.create_desc_rst (self.description))
+            fp.write (".. module:: %s\n" % (name))
+            fp.write ("   :synopsis: %s\n\n" % (self.shortdesc))
 
         if len (self.example) > 0:
             fp.write (self.create_example_rst (self.example, True))
                             fp.write (self.create_example_rst (method.example))
 
         fp.write ("\n")
+        for include in self.includes:
+            fp.write (".. include:: %s\n" % include)
         fp.write (RST_FOOTER)
         fp.close ()
         
 .. toctree::
    :maxdepth: 2
 
-   ref/pygame2_base.rst
+   ref/pygame2.rst
    ref/examples.rst
    ref/pygame2_font.rst
    ref/pygame2_freetype_base.rst
    ref/pygame2_mask.rst
    ref/pygame2_physics.rst
+   ref/pygame2_sdl.rst
    ref/pygame2_sdl_audio.rst
-   ref/pygame2_sdl_base.rst
    ref/pygame2_sdl_cursors.rst
    ref/pygame2_sdl_cdrom.rst
    ref/pygame2_sdl_event.rst
    ref/pygame2_sdl_time.rst
    ref/pygame2_sdl_video.rst
    ref/pygame2_sdl_wm.rst
-   ref/pygame2_sdlext_base.rst
+   ref/pygame2_sdlext.rst
    ref/pygame2_sdlext_draw.rst
    ref/pygame2_sdlext_fastevent.rst
    ref/pygame2_sdlext_font.rst
    ref/pygame2_sdlext_scrap.rst
    ref/pygame2_sdlext_surfarray.rst
    ref/pygame2_sdlext_transform.rst
-   ref/pygame2_sdlgfx_base.rst
+   ref/pygame2_sdlgfx.rst
    ref/pygame2_sdlgfx_primitives.rst
    ref/pygame2_sdlgfx_rotozoom.rst
-   ref/pygame2_sdlimage_base.rst
-   ref/pygame2_sdlmixer_base.rst
+   ref/pygame2_sdlimage.rst
+   ref/pygame2_sdlmixer.rst
    ref/pygame2_sdlmixer_channel.rst
    ref/pygame2_sdlmixer_music.rst
    ref/pygame2_sdlmixer_numericsndarray.rst
-   ref/pygame2_sdlttf_base.rst
+   ref/pygame2_sdlttf.rst
    ref/pygame2_sdlttf_sysfont.rst
+   ref/tests.rst

doc/ref/tests.rst

+:mod:`pygame2.test` -- unit tests for Pygame2
+=============================================
+
+This package contains the unit tests for Pygame2. You can execute the
+unit tests using ::
+
+    python -m pygame2.test
 <!DOCTYPE module [
-<!ELEMENT module (alias?, short, desc, example?, (func | class)*)>
+<!ELEMENT module
+          (show?, alias?, short, desc, example?, (func | class)*, include*)>
 <!ATTLIST module name CDATA #REQUIRED>
 
+<!ELEMENT show (0 | 1) "1">
 <!ELEMENT alias (#PCDATA)>
 <!ELEMENT desc (#PCDATA)>
 <!ELEMENT short (#PCDATA)>
+
 <!ELEMENT call (#PCDATA)>
+<!ELEMENT include (#PCDATA)>
 
 <!ELEMENT func (call, desc, example?)>
 <!ATTLIST func name CDATA #REQUIRED>
 <!DOCTYPE module SYSTEM "api.dtd">
 
 <module name="pygame2.base">
+  <show>0</show>
   <alias>pygame2</alias>
   <short>basic features used by pygame2</short>
   <desc>
     Base features for pygame2 that are shared shared and used throughout
     the whole pygame2 package.
-  
-    All classes and functions listed here are incorporated from the
-    :mod:`pygame2.base` module.
   </desc>
 
   <class name="BufferProxy">

doc/src/pygame2.xml

+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE module SYSTEM "api.dtd">
+
+<module name="pygame2">
+  <alias>pygame2</alias>
+  <short>basic features used by pygame2</short>
+  <desc>
+    Base features for pygame2 that are shared shared and used throughout
+    the whole pygame2 package.
+  </desc>
+
+  <include>pygame2_base.rst</include>
+</module>

doc/src/pygame2sdl.xml

+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE module SYSTEM "api.dtd">
+
+<module name="pygame2.sdl">
+  <alias>pygame2.sdl</alias>
+  <short>basic SDL wrapper module</short>
+  <desc>
+    Basic Pygame2 SDL wrapper module
+  </desc>
+  <include>pygame2_sdl_base.rst</include>
+</module>

doc/src/pygame2sdlext.xml

+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE module SYSTEM "api.dtd">
+
+<module name="pygame2.sdlext">
+  <alias>pygame2.sdlext</alias>
+  <short>basic extensions for SDL modules</short>
+  <desc>
+    Extension module for the pygame2 SDL wrapper.
+  </desc>
+  <include>pygame2_sdlext_base.rst</include>
+ 
+</module>

doc/src/pygame2sdlgfx.xml

+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE module SYSTEM "api.dtd">
+
+<module name="pygame2.sdlgfx">
+  <alias>pygame2.sdlgfx</alias>
+  <short>basic SDL_gfx wrapper module</short>
+  <desc>
+    Basic SDL_gfx library wrapper module
+  </desc>
+  <include>pygame2_sdlgfx_base.rst</include>
+</module>

doc/src/pygame2sdlimage.xml

+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE module SYSTEM "api.dtd">
+
+<module name="pygame2.sdlimage">
+  <alias>pygame2.sdlimage</alias>
+  <short>basic SDL_image wrapper module</short>
+  <desc>
+    Basic SDL_image wrapper module
+  </desc>
+  <include>pygame2_sdlimage_base.rst</include>
+</module>

doc/src/pygame2sdlmixer.xml

+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE module SYSTEM "api.dtd">
+
+<module name="pygame2.sdlmixer">
+  <alias>pygame2.sdlmixer</alias>
+  <short>basic SDL_mixer wrapper module</short>
+  <desc>
+    .. note::
+      
+      Do not use :mod:`pygame2.sdlmixer` and :mod:`pygame2.sdl.audio` at the
+      same time. As they both deal with audio hardware access, this can lead
+      to problems and weird behaviour.
+  
+  </desc>
+  <include>pygame2_sdlmixer_base.rst</include>
+</module>

doc/src/pygame2sdlttf.xml

+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE module SYSTEM "api.dtd">
+
+<module name="pygame2.sdlttf">
+  <alias>pygame2.sdlttf</alias>
+  <short>basic SDL_ttf wrapper module</short>
+  <desc>
+    Basic SDL_ttf wrapper module
+  </desc>
+  <include>pygame2_sdlttf_base.rst</include>
+</module>

doc/src/sdlbase.xml

 <!DOCTYPE module SYSTEM "api.dtd">
 
 <module name="pygame2.sdl.base">
-  <alias>pygame2.sdl</alias>
+  <show>0</show>
+  <alias>pygame2.sdl.base</alias>
   <short>basic SDL wrapper module</short>
   <desc>
-    Basic Pygame2 SDL wrapper module
-
-    All classes and functions listed here are incorporated from the
-    :mod:`pygame2.sdl.base` module.
+    Basic Pygame2 SDL wrapper functions.
   </desc>
 
   <func name="get_compiled_version">

doc/src/sdlextbase.xml

 <!DOCTYPE module SYSTEM "api.dtd">
 
 <module name="pygame2.sdlext.base">
-  <alias>pygame2.sdlext</alias>
+  <show>0</show>
+  <alias>pygame2.sdlext.base</alias>
   <short>basic extensions for SDL modules</short>
   <desc>
-    Extension module for the pygame2 SDL wrapper.
-
-    All classes and functions listed here are incorporated from the
-    :mod:`pygame2.sdlext.base` module.
+    Basic extensions for the pygame2 SDL wrapper.
   </desc>
 
   <class name="PixelArray">

doc/src/sdlgfxbase.xml

 <!DOCTYPE module SYSTEM "api.dtd">
 
 <module name="pygame2.sdlgfx.base">
-  <alias>pygame2.sdlgfx</alias>
+  <show>0</show>
+  <alias>pygame2.sdlgfx.base</alias>
   <short>basic SDL_gfx wrapper module</short>
   <desc>
     Basic SDL_gfx library wrapper module

doc/src/sdlimagebase.xml

 <!DOCTYPE module SYSTEM "api.dtd">
 
 <module name="pygame2.sdlimage.base">
-  <alias>pygame2.sdlimage</alias>
+  <show>0</show>
+  <alias>pygame2.sdlimage.base</alias>
   <short>basic SDL_image wrapper module</short>
   <desc>
     Basic SDL_image wrapper module
-  
-    All classes and functions listed here are incorporated from the
-    :mod:`pygame2.sdlimage.base` module.
   </desc>
 
   <func name="get_error">

doc/src/sdlmixerbase.xml

 <!DOCTYPE module SYSTEM "api.dtd">
 
 <module name="pygame2.sdlmixer.base">
-  <alias>pygame2.sdlmixer</alias>
+  <show>0</show>
+  <alias>pygame2.sdlmixer.base</alias>
   <short>basic SDL_mixer wrapper module</short>
   <desc>
-    All classes and functions listed here are incorporated from the
-    :mod:`pygame2.sdlmixer.base` module.
-    
     .. note::
       
       Do not use :mod:`pygame2.sdlmixer` and :mod:`pygame2.sdl.audio` at the

doc/src/sdlttfbase.xml

 <!DOCTYPE module SYSTEM "api.dtd">
 
 <module name="pygame2.sdlttf.base">
-  <alias>pygame2.sdlttf</alias>
+  <show>0</show>
+  <alias>pygame2.sdlttf.base</alias>
   <short>basic SDL_ttf wrapper module</short>
   <desc>
     Basic SDL_ttf wrapper module
-
-    All classes and functions listed here are incorporated from the
-    :mod:`pygame2.sdlttf.base` module.
   </desc>
 
   <class name="Font">
 
 DLLPATH = os.path.join (path, "dll")
 
+__version__ = "2.0.0-alpha2"
+version_info = (2, 0, 0, "alpha2")
+
 from pygame2.base import *
 import modules, cfg
 from config import helpers, msys, config_modules
 
-VERSION = "2.0.0-alpha1"
+VERSION = "2.0.0-alpha2"
 DEBUG = True
 
 # Minimum requirements.
+"""Unit tests for Pygame2.
+
+This package contains the unit tests for Pygame2. You can execute the
+unit tests using
+
+    python -m pygame2.test
+
+"""
 import sys
 
 #
     def run ():
         import pygame2.test.run_tests
         pygame2.test.run_tests.run ()
+
+if __name__ == "__main__":
+    run ()