Saturday, April 4, 2009

Gosser Product Snowboard

dependencies in Python 3 - 2 GetFunction

basic function: GetFunctionClass , you need to get the name of the functions belonging to a class (ie indented)
 
final GetClassFunction (line): # Find 'def' need for space and a spazio.Lo # avoid false positives, such as' def'inizione line.find start = (" final ( final ) # The next two lines are used to create a string # full of start spaces txt = "" txt = txt.ljust (start, " ") # Check if before 'def' there are only spaces if line [: start] == \u200b\u200btxt: # Search the open parenthesis line.find end = (( ") # Check that the function is not empty if line [start +4: ]!='': end # Returns the function name and the column return line [start +4: end], start # Returns -1, -1 if the function name is empty else: return -1, -1 # Returns -1, -1 if before 'def' is something else maybe # 'def' is written in a comment else : return -1, -1
I leave you to write code to get a line of text from an external function to classes. If you have any problems comment!
TrovaNelFile
getClass

0 comments:

Post a Comment