mirror of
				https://github.com/sqlmapproject/sqlmap.git
				synced 2025-10-31 16:07:55 +03:00 
			
		
		
		
	minor updates
This commit is contained in:
		
							parent
							
								
									3bb4ea2c7a
								
							
						
					
					
						commit
						bb6e36fb02
					
				|  | @ -10,6 +10,8 @@ import sys | ||||||
| total = 0.0 | total = 0.0 | ||||||
| count = 0 | count = 0 | ||||||
| 
 | 
 | ||||||
|  | __RATING__ = False | ||||||
|  | 
 | ||||||
| def check(module): | def check(module): | ||||||
|     global total, count |     global total, count | ||||||
| 
 | 
 | ||||||
|  | @ -20,15 +22,15 @@ def check(module): | ||||||
|         for line in pout: |         for line in pout: | ||||||
|             if  re.match("E....:.", line): |             if  re.match("E....:.", line): | ||||||
|                 print line |                 print line | ||||||
|             if "Your code has been rated at" in line: |             if __RATING__ and "Your code has been rated at" in line: | ||||||
|                 print line |                print line | ||||||
|                 score = re.findall("\d.\d\d", line)[0] |                score = re.findall("\d.\d\d", line)[0] | ||||||
|                 total += float(score) |                total += float(score) | ||||||
|                 count += 1 |                count += 1 | ||||||
| 
 | 
 | ||||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||||
|     try: |     try: | ||||||
|         print sys.argv    |         print sys.argv | ||||||
|         BASE_DIRECTORY = sys.argv[1] |         BASE_DIRECTORY = sys.argv[1] | ||||||
|     except IndexError: |     except IndexError: | ||||||
|         print "no directory specified, defaulting to current working directory" |         print "no directory specified, defaulting to current working directory" | ||||||
|  | @ -40,6 +42,7 @@ if __name__ == "__main__": | ||||||
|             filepath = os.path.join(root, name) |             filepath = os.path.join(root, name) | ||||||
|             check(filepath) |             check(filepath) | ||||||
| 
 | 
 | ||||||
|     print "==" * 50 |     if __RATING__: | ||||||
|     print "%d modules found"% count |         print "==" * 50 | ||||||
|     print "AVERAGE SCORE = %.02f"% (total / count) |         print "%d modules found"% count | ||||||
|  |         print "AVERAGE SCORE = %.02f"% (total / count) | ||||||
|  |  | ||||||
|  | @ -14,6 +14,7 @@ import rlcompleter | ||||||
| from lib.core import readlineng as readline | from lib.core import readlineng as readline | ||||||
| from lib.core.common import backend | from lib.core.common import backend | ||||||
| from lib.core.data import kb | from lib.core.data import kb | ||||||
|  | from lib.core.data import logger | ||||||
| from lib.core.data import paths | from lib.core.data import paths | ||||||
| from lib.core.data import queries | from lib.core.data import queries | ||||||
| 
 | 
 | ||||||
|  | @ -25,7 +26,11 @@ def loadHistory(): | ||||||
|     historyPath = os.path.expanduser(paths.SQLMAP_HISTORY) |     historyPath = os.path.expanduser(paths.SQLMAP_HISTORY) | ||||||
| 
 | 
 | ||||||
|     if os.path.exists(historyPath): |     if os.path.exists(historyPath): | ||||||
|         readline.read_history_file(historyPath) |         try: | ||||||
|  |             readline.read_history_file(historyPath) | ||||||
|  |         except IOError, msg: | ||||||
|  |             warnMsg = "there was a problem with loading of history file '%s' (%s)" % (historyPath, msg) | ||||||
|  |             logger.warn(warnMsg) | ||||||
| 
 | 
 | ||||||
| def queriesForAutoCompletion(): | def queriesForAutoCompletion(): | ||||||
|     autoComplQueries = {} |     autoComplQueries = {} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user