00001 """
00002 Helper functions that can produce a list of package names and the html equivalent
00003 """
00004
00005 __copyright__ = """
00006 Copyright 2008 Sean Ross-Ross
00007 """
00008 __license__ = """
00009 This file is part of SLIMpy .
00010
00011 SLIMpy is free software: you can redistribute it and/or modify
00012 it under the terms of the GNU Lesser General Public License as published by
00013 the Free Software Foundation, either version 3 of the License, or
00014 (at your option) any later version.
00015
00016 SLIMpy is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 GNU Lesser General Public License for more details.
00020
00021 You should have received a copy of the GNU Lesser General Public License
00022 along with SLIMpy . If not, see <http://www.gnu.org/licenses/>.
00023 """
00024
00025 from os import walk, system
00026 from os.path import dirname, join, split, sep
00027 import slimpy_base
00028
00029
00030
00031 slfile = dirname( slimpy_base.__file__ )
00032 w = walk( slfile )
00033 fpath = split( slfile )[0]
00034
00035
00036
00037 def helper():
00038 """
00039 Genorator function that yields a tuple of
00040 """
00041 for dir , nextdirs , files in w:
00042 if ".svn" not in dir and 'test' not in dir and 'Plugin' not in dir:
00043
00044 imp = dir.replace( fpath, "" )
00045 ldir = imp.split( sep )
00046
00047
00048
00049 for f in files:
00050 if f.endswith( ".py" ):
00051 file = join( dir+[f] )
00052 html = ".".join( ldir+[f[:-3] + ".html"] )
00053 imp = ".".join( ldir+[f[:-3]] )
00054 yield file, html, imp
00055
00056 if __name__ == "__main__":
00057 for dir in helper():
00058 system( "pydoc -w %(dir)s" %vars() )
00059