Introducing 'new style classes' (idea from Pull request #284)

This commit is contained in:
Miroslav Stampar 2012-12-06 10:42:53 +01:00
parent 0f191f624c
commit b6650add46
13 changed files with 18 additions and 18 deletions

View File

@ -34,7 +34,7 @@ from lib.core.settings import GENERIC_SQL_COMMENT
from lib.core.settings import PAYLOAD_DELIMITER
from lib.core.unescaper import unescaper
class Agent:
class Agent(object):
"""
This class defines the SQL agent methods.
"""

View File

@ -11,7 +11,7 @@ import tempfile
from lib.core.settings import BIGARRAY_CHUNK_LENGTH
class Cache:
class Cache(object):
"""
Auxiliary class used for storing cached chunks
"""

View File

@ -168,7 +168,7 @@ class UnicodeRawConfigParser(RawConfigParser):
fp.write("\n")
class Format:
class Format(object):
@staticmethod
def humanize(values, chain=" or "):
return chain.join(values)
@ -2824,7 +2824,7 @@ def expandMnemonics(mnemonics, parser, args):
Expands mnemonic options
"""
class MnemonicNode:
class MnemonicNode(object):
def __init__(self):
self.next = {}
self.current = []

View File

@ -37,7 +37,7 @@ from lib.core.settings import METADB_SUFFIX
from lib.core.settings import TRIM_STDOUT_DUMP_SIZE
from lib.core.settings import UNICODE_ENCODING
class Dump:
class Dump(object):
"""
This class defines methods used to parse and output the results
of SQL injection actions

View File

@ -9,7 +9,7 @@ from lib.core.common import getUnicode
from lib.core.common import dataToStdout
from lib.core.data import conf
class ProgressBar:
class ProgressBar(object):
"""
This class defines methods to update and draw a progress bar
"""

View File

@ -13,7 +13,7 @@ from lib.core.exception import sqlmapGenericException
from lib.core.exception import sqlmapMissingDependence
from lib.core.exception import sqlmapValueException
class Replication:
class Replication(object):
"""
This class holds all methods/classes used for database
replication purposes.

View File

@ -11,7 +11,7 @@ import zipfile
from lib.core.exception import sqlmapDataException
from lib.core.settings import UNICODE_ENCODING
class Wordlist:
class Wordlist(object):
"""
Iterator for looping over a large dictionaries
"""

View File

@ -74,7 +74,7 @@ SCHEME_NAME_ATTR = "xsi:noNamespaceSchemaLocation"
CHARACTERS_TO_ENCODE = range(32) + range(127, 256)
ENTITIES = {'"': '"', "'": "'"}
class XMLDump:
class XMLDump(object):
'''
This class purpose is to dump the data into an xml Format.
The format of the xml file is described in the scheme file xml/sqlmap.xsd

View File

@ -81,7 +81,7 @@ from thirdparty.socks.socks import ProxyError
from thirdparty.multipart import multipartpost
class Connect:
class Connect(object):
"""
This class defines methods used to perform HTTP requests
"""

View File

@ -12,7 +12,7 @@ import socket
import threading
import time
class DNSQuery:
class DNSQuery(object):
"""
Used for making fake DNS resolution responses based on received
raw request
@ -58,7 +58,7 @@ class DNSQuery:
return retVal
class DNSServer:
class DNSServer(object):
def __init__(self):
self._requests = []
self._lock = threading.Lock()

View File

@ -25,7 +25,7 @@ from lib.request.connect import Connect as Request
from thirdparty.beautifulsoup.beautifulsoup import BeautifulSoup
from thirdparty.oset.pyoset import oset
class Crawler:
class Crawler(object):
"""
This class defines methods used to perform crawling (command
line option '--crawl'

View File

@ -5,7 +5,7 @@ Copyright (c) 2006-2012 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
class _Getch:
class _Getch(object):
"""
Gets a single character from standard input. Does not echo to
the screen (reference: http://code.activestate.com/recipes/134892/)
@ -22,7 +22,7 @@ class _Getch:
def __call__(self): return self.impl()
class _GetchUnix:
class _GetchUnix(object):
def __init__(self):
import tty
@ -38,7 +38,7 @@ class _GetchUnix:
return ch
class _GetchWindows:
class _GetchWindows(object):
def __init__(self):
import msvcrt
@ -47,7 +47,7 @@ class _GetchWindows:
return msvcrt.getch()
class _GetchMacCarbon:
class _GetchMacCarbon(object):
"""
A function which returns the current ASCII key that is down;
if no ASCII key is down, the null string is returned. The

View File

@ -26,7 +26,7 @@ from lib.core.settings import UNICODE_ENCODING
from lib.core.settings import URI_INJECTABLE_REGEX
from lib.request.basic import decodePage
class Google:
class Google(object):
"""
This class defines methods used to perform Google dorking (command
line option '-g <google dork>'