99import os
1010import re
1111import shutil
12- import string
1312import sys
1413import tempfile
1514import time
@@ -46,36 +45,13 @@ def smokeTest():
4645 continue
4746
4847 for ifile in files :
49- if os .path .splitext (ifile )[1 ].lower () == ".py" :
50- content = None
51- with open (os .path .join (root , ifile ), "r+b" ) as f :
52- content = f .read ()
53- active = content
54- active = re .sub (r"(?s)\"\"\".+?\"\"\"" , "" , active )
55- active = re .sub (r"\".+?\"" , "" , active )
56- active = re .sub (r"\'.+?\'" , "" , active )
57- active = re .sub (r"#.+" , "" , active )
58- for ss in re .findall (r"\b_*?[a-z]+[A-Z].*?\b" , active ):
59- original = ss
60- if ss .startswith ("sqlmap" ) and any (_ in ss .lower () for _ in ("exception" , "sqlmapmissing" , "sqlmapundefinedmethod" )):
61- ss = "S" + ss [1 :]
62- if ss .startswith ("_" ):
63- ss = "_" + ss .lstrip ("_" )
64- content = content .replace (original , ss )
65- if content :
66- with open (os .path .join (root , ifile ), "w+b" ) as f :
67- f .write (content )
48+ if os .path .splitext (ifile )[1 ].lower () == ".py" and ifile != "__init__.py" :
6849 path = os .path .join (root , os .path .splitext (ifile )[0 ])
6950 path = path .replace (paths .SQLMAP_ROOT_PATH , '.' )
7051 path = path .replace (os .sep , '.' ).lstrip ('.' )
7152 try :
7253 __import__ (path )
7354 module = sys .modules [path ]
74- #for name in dir(module):
75- #_ = getattr(module, name)
76- #if type(_) == type(lambda x: x):
77- #if re.match(r"\b_*?[a-z]+[A-Z]", name):
78- #print name
7955 except Exception , msg :
8056 retVal = False
8157 dataToStdout ("\r " )
@@ -90,7 +66,7 @@ def smokeTest():
9066
9167 count += 1
9268 status = '%d/%d (%d%s) ' % (count , length , round (100.0 * count / length ), '%' )
93- # dataToStdout("\r[%s] [INFO] complete: %s" % (time.strftime("%X"), status))
69+ dataToStdout ("\r [%s] [INFO] complete: %s" % (time .strftime ("%X" ), status ))
9470
9571 clearConsoleLine ()
9672 if retVal :
@@ -235,4 +211,4 @@ def replaceVars(item, vars_):
235211 for var in re .findall ("\$\{([^}]+)\}" , item ):
236212 if var in vars_ :
237213 retVal = retVal .replace ("${%s}" % var , vars_ [var ])
238- return retVal
214+ return retVal
0 commit comments