Wednesday, April 8, 2009

Sounf Blaster Mb Lizens Schlüssel

Dependencies Python 4 - GetClasses & GetFunctions

We come now to write code that uses the basic functions to get all classes and all functions: GetClasses and GetFunctions. Are very similar in structure because the result of taking TrovaNelFile and apply getClass, GetPublicFunction and GetClassFunction to get classes and functions. Let's see how:
 
final GetClasses (inds, lines): # Find the classes classes = {} # inds are the result of TrovaNelFile ('class') f or us in inds: # lines are all lines # file we are reading cl = getClass (lines [us]) # If the class is added to a dictionary # if cl! =- 1: classes [cl] = (us, []) return classes
 
def GetFunctions (inds, lines): # Find function # initialize a two dictionaries for the functions # within classes and one for external funcs, pfuncs ={},{} # inds are the result of TrovaNelFile ('def') f or fi in inds: # lines are all lines # file we are reading GetPublicFunction pf = ( lines [fi]) # if is an external function adds if pf! =- 1: pfuncs [pf] = fi # otherwise look for an internal else: cf, col = GetClassFunction (lines [fi]) # if is an internal function adds if cf! =- 1: funcs [fi] = (cf, col, []) return pfuncs, funcs
For this time is all hello to everyone at the near post and comment many:).
TrovaNelFile getClass
Last

0 comments:

Post a Comment