compare_docs.py :  » Game-2D-3D » Pygame » pygame-1.9.1release » test » util » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Game 2D 3D » Pygame 
Pygame » pygame 1.9.1release » test » util » compare_docs.py
"""
For finding out what is not documented.

python compare_docs.py pygame.sprite sprite.doc



An example showing how to compare what the .doc docs have in them
 with what the module has in them.

For example, to see what the sprite.doc has documented compared to what the
  sprite module actually has in it.

To be move to 
"""

import sys, os
#import pygame.sprite

#the_module = pygame.sprite
#the_doc = "sprite.doc"

try:
#if 1:
    the_module = __import__(sys.argv[-2])
    last_part = sys.argv[-2].split(".")[-1]
    print last_part
    the_module = getattr(the_module, last_part)

    the_doc = sys.argv[-1]
except:
    print "useage:\n  python compare_docs.py pygame.sprite sprite.doc"
    raise



# put makeref.py in the path.
sys.path.append(os.path.join("..", ".."))
from makeref import Doc


f = None
f2 = None
f = os.path.join("..", "..", "lib", the_doc)
if not os.path.exists(f):
    f2 = os.path.join("..", "..", "src", the_doc)
    if not os.path.exists(f2):
        raise "paths do not exist :%s:    :%s:" % (f,f2)
    else:
        f = f2

    

d = Doc('', open(f, "U"))

print d
for x in dir(d):
    print ":%s:" % x, getattr(d, x)
#def obj_doc_file():

print "\n\n"
print "Stuff in docs - the_module.  In the_module, not in docs:"
print set(dir(the_module)) - set([x.name for x in d.kids])
print "-" * 20


print "\n\n"
print "stuff in docs - the_module.   In docs, not in the_module."
print set([x.name for x in d.kids]) - set(dir(the_module)) 



print "\n\n"
print "everything in the module."
print set(dir(the_module)) 



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.