@@ -1221,7 +1221,13 @@ def initCommonOutputs():
12211221 cfile .close ()
12221222
12231223def getGoodSamaritanParameters (part , prevValue , originalCharset ):
1224- ###wild card . (dot) is supported for compatibility with threading
1224+ """
1225+ Function for retrieving parameters needed for good samaritan (common outputs) feature.
1226+ Returns singleValue if there is a complete single match (in part of common-outputs.txt set by parameter 'part')
1227+ regarding parameter prevValue. If there is no single value match, but multiple, predictedCharset is returned
1228+ containing more probable characters (retrieved from matched items in common-outputs.txt) together with the
1229+ rest of charset as otherCharset
1230+ """
12251231 if kb .commonOutputs is None :
12261232 initCommonOutputs ()
12271233
@@ -1272,15 +1278,20 @@ def getGoodSamaritanParameters(part, prevValue, originalCharset):
12721278 return None , None , originalCharset
12731279
12741280def getCompiledRegex (regex , args = ()):
1281+ """
1282+ Returns compiled regular expression and stores it in cache for further usage
1283+ """
12751284 if regex in __compiledRegularExpressions :
12761285 return __compiledRegularExpressions [regex ]
12771286 else :
12781287 retVal = re .compile (regex , * args )
12791288 __compiledRegularExpressions [regex ] = retVal
12801289 return retVal
12811290
1282- #dumper.dbTableValues(conf.dbmsHandler.dumpTable()) -> dumpTable
12831291def getPartRun ():
1292+ """
1293+ Goes through call stack and finds constructs matching conf.dmbsHandler.*. Returns it or it's alias used in common-outputs.txt
1294+ """
12841295 commonPartsDict = { "getTables" :"Tables" , "getColumns" :"Columns" , "getUsers" :"Users" , "getBanner" :"Banners" , "getDbs" :"Databases" }
12851296 retVal = None
12861297 stack = [item [4 ][0 ] if isinstance (item [4 ], list ) else '' for item in inspect .stack ()]
0 commit comments