mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Minor refactoring
This commit is contained in:
@@ -55,6 +55,7 @@ from lib.core.convert import htmlunescape
|
||||
from lib.core.convert import unicodeencode
|
||||
from lib.core.convert import urldecode
|
||||
from lib.core.convert import urlencode
|
||||
from lib.core.decorators import cachedmethod
|
||||
from lib.core.enums import CHARSET_TYPE
|
||||
from lib.core.enums import DBMS
|
||||
from lib.core.enums import EXPECTED
|
||||
@@ -492,15 +493,6 @@ class Backend:
|
||||
def isOs(os):
|
||||
return Backend.getOs() is not None and Backend.getOs().lower() == os.lower()
|
||||
|
||||
# Reference: http://code.activestate.com/recipes/325205-cache-decorator-in-python-24/
|
||||
def cachedmethod(f, cache={}):
|
||||
def _(*args, **kwargs):
|
||||
key = (f, tuple(args), frozenset(kwargs.items()))
|
||||
if key not in cache:
|
||||
cache[key] = f(*args, **kwargs)
|
||||
return cache[key]
|
||||
return _
|
||||
|
||||
def paramToDict(place, parameters=None):
|
||||
"""
|
||||
Split the parameters into names and values, check if these parameters
|
||||
|
||||
Reference in New Issue
Block a user