]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
(no commit message)
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 27 Oct 2005 03:10:25 +0000 (03:10 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 27 Oct 2005 03:10:25 +0000 (03:10 +0000)
doc/build/components/pydoc.myt [new file with mode: 0644]
doc/build/content/docstrings.myt [new file with mode: 0644]
doc/build/genhtml.py

diff --git a/doc/build/components/pydoc.myt b/doc/build/components/pydoc.myt
new file mode 100644 (file)
index 0000000..4acf659
--- /dev/null
@@ -0,0 +1,93 @@
+<%method obj_doc>
+    <%args>
+        obj
+    </%args>
+    <%init>
+        import types
+        isclass = isinstance(obj, types.ClassType) or isinstance(obj, types.TypeType)
+        name= obj.__name__
+        
+        if not isclass:
+            if hasattr(obj, '__ALL__'):
+                objects = obj.__ALL__
+            else:
+                objects = obj.__dict__.keys()
+            functions = [getattr(obj, x, None) 
+                for x in objects 
+                if getattr(obj,x,None) is not None and 
+                    (isinstance(getattr(obj,x), types.FunctionType))
+                    and not getattr(obj,x).__name__[0] == '_'
+                ]
+            classes = [getattr(obj, x, None) 
+                for x in objects 
+                if getattr(obj,x,None) is not None and 
+                    (isinstance(getattr(obj,x), types.TypeType) 
+                    or isinstance(getattr(obj,x), types.ClassType))
+                    and not getattr(obj,x).__name__[0] == '_'
+                ]
+        else:
+            functions = [getattr(obj, x).im_func for x in obj.__dict__.keys() if isinstance(getattr(obj,x), types.MethodType) and not getattr(obj,x).__name__[0] == '_']
+            classes = []
+            
+        functions.sort(lambda a, b: cmp(a.__name__, b.__name__))
+        classes.sort(lambda a, b: cmp(a.__name__, b.__name__))
+    </%init>
+
+<h2>
+% if isclass:
+    Class <% name %>
+% else:
+    Module <% name %>
+%
+</h2>
+<% obj.__doc__ %>
+<br/>
+
+<&|formatting.myt:paramtable&>
+% if not isclass and len(functions):
+    <h3>Module Functions</h3>
+%   for func in functions:
+hi
+    <& SELF:function_doc, func=func &>
+%
+%
+
+% if len(classes):
+    <h3>Classes</h3>
+%   for class_ in classes:
+      <& SELF:obj_doc, obj=class_ &>
+%   
+%    
+</&>
+</%method>
+
+
+<%method function_doc>
+    <%args>func</%args>
+    <%init>
+        import inspect
+        argspec = inspect.getargspec(func)
+        argnames = argspec[0]
+        varargs = argspec[1]
+        varkw = argspec[2]
+        defaults = argspec[3] or ()
+        argstrings = []
+        i = 0
+        for arg in argnames:
+            try:
+                default = defaults[i]
+                argstrings.append("%s=%s" % (arg, repr(default)))
+                i +=1
+            except IndexError:
+                argstrings.append(arg)
+        if varargs is not None:
+           argstrings.append("*%s" % varargs)
+        if varkw is not None:
+           argstrings.append("**%s" % varkw)
+    </%init>
+    
+    huh ? <% repr(func) |h %>
+    <&| formatting.myt:function_doc, name="def " + func.__name__, arglist=argstrings &>
+    <% func.__doc__ %>
+    </&>
+</%method>
\ No newline at end of file
diff --git a/doc/build/content/docstrings.myt b/doc/build/content/docstrings.myt
new file mode 100644 (file)
index 0000000..8f6a0c7
--- /dev/null
@@ -0,0 +1,19 @@
+<%flags>inherit='document_base.myt'</%flags>
+<&|doclib.myt:item, name="docstrings", description="Modules and Classes" &>
+<%init>
+    import sqlalchemy.schema as schema
+    import sqlalchemy.engine as engine
+    import sqlalchemy.sql as sql
+    import sqlalchemy.pool as pool
+    import sqlalchemy.mapper as mapper
+    import sqlalchemy.objectstore as objectstore
+</%init>
+
+
+<& pydoc.myt:obj_doc, obj=schema &>
+<& pydoc.myt:obj_doc, obj=engine.SQLEngine &>
+<& pydoc.myt:obj_doc, obj=sql &>
+<& pydoc.myt:obj_doc, obj=pool &>
+<& pydoc.myt:obj_doc, obj=mapper &>
+<& pydoc.myt:obj_doc, obj=objectstore &>
+</&>
\ No newline at end of file
index d456b9cf5e8611cc24bf8dde32721748d9cbb406..62bb7c9b0b72dcd0b06d526c1f26f1e9ea7ec81f 100644 (file)
@@ -8,7 +8,7 @@ component_root = [
 doccomp = ['document_base.myt']
 output = os.path.dirname(os.getcwd())
 
-sys.path = ['./lib/'] + sys.path
+sys.path = ['../../lib', './lib/'] + sys.path
 
 import documentgen