Trivial code style updates

This commit is contained in:
Miroslav Stampar 2019-04-19 13:54:48 +02:00
parent 10fe87fb4e
commit e7469ab570
14 changed files with 73 additions and 54 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
# Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
# See the file 'LICENSE' for copying permission
# Removes trailing spaces from blank lines inside project files

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
# Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
# See the file 'LICENSE' for copying permission
# Stress test against Python3

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
# Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
# See the file 'LICENSE' for copying permission
# Runs py2diatra on all python files (prerequisite: pip install pydiatra)

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
# Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
# See the file 'LICENSE' for copying permission
# Runs pyflakes on all python files (prerequisite: apt-get install pyflakes)

View File

@ -117,7 +117,7 @@ class ReqHandler(BaseHTTPRequestHandler):
output += "<td>%s</td>" % value
output += "</tr>\n"
output += "</table>\n"
output += "</body></html>";
output += "</body></html>"
except Exception as ex:
output = "%s: %s" % (re.search(r"'([^']+)'", str(type(ex))).group(1), ex)

View File

@ -17,7 +17,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
from lib.core.enums import OS
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.3.4.30"
VERSION = "1.3.4.31"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -121,12 +121,15 @@ class SGMLParser(_markupbase.ParserBase):
i = n
break
match = interesting.search(rawdata, i)
if match: j = match.start()
else: j = n
if match:
j = match.start()
else:
j = n
if i < j:
self.handle_data(rawdata[i:j])
i = j
if i == n: break
if i == n:
break
if rawdata[i] == '<':
if starttagopen.match(rawdata, i):
if self.literal:
@ -134,12 +137,14 @@ class SGMLParser(_markupbase.ParserBase):
i = i + 1
continue
k = self.parse_starttag(i)
if k < 0: break
if k < 0:
break
i = k
continue
if rawdata.startswith("</", i):
k = self.parse_endtag(i)
if k < 0: break
if k < 0:
break
i = k
self.literal = 0
continue
@ -157,12 +162,14 @@ class SGMLParser(_markupbase.ParserBase):
# This should be removed,
# and comments handled only in parse_declaration.
k = self.parse_comment(i)
if k < 0: break
if k < 0:
break
i = k
continue
if rawdata.startswith("<?", i):
k = self.parse_pi(i)
if k < 0: break
if k < 0:
break
i = i+k
continue
if rawdata.startswith("<!", i):
@ -170,7 +177,8 @@ class SGMLParser(_markupbase.ParserBase):
# deployed," this should only be the document type
# declaration ("<!DOCTYPE html...>").
k = self.parse_declaration(i)
if k < 0: break
if k < 0:
break
i = k
continue
elif rawdata[i] == '&':
@ -183,14 +191,16 @@ class SGMLParser(_markupbase.ParserBase):
name = match.group(1)
self.handle_charref(name)
i = match.end(0)
if rawdata[i-1] != ';': i = i-1
if rawdata[i-1] != ';':
i = i-1
continue
match = entityref.match(rawdata, i)
if match:
name = match.group(1)
self.handle_entityref(name)
i = match.end(0)
if rawdata[i-1] != ';': i = i-1
if rawdata[i-1] != ';':
i = i-1
continue
else:
self.error('neither < nor & ??')
@ -275,7 +285,8 @@ class SGMLParser(_markupbase.ParserBase):
self.lasttag = tag
while k < j:
match = attrfind.match(rawdata, k)
if not match: break
if not match:
break
attrname, rest, attrvalue = match.group(1, 2, 3)
if not rest:
attrvalue = attrname
@ -361,7 +372,8 @@ class SGMLParser(_markupbase.ParserBase):
return
found = len(self.stack)
for i in range(found):
if self.stack[i] == tag: found = i
if self.stack[i] == tag:
found = i
while len(self.stack) > found:
tag = self.stack[-1]
try:
@ -450,10 +462,17 @@ class SGMLParser(_markupbase.ParserBase):
pass
# To be overridden -- handlers for unknown objects
def unknown_starttag(self, tag, attrs): pass
def unknown_endtag(self, tag): pass
def unknown_charref(self, ref): pass
def unknown_entityref(self, ref): pass
def unknown_starttag(self, tag, attrs):
pass
def unknown_endtag(self, tag):
pass
def unknown_charref(self, ref):
pass
def unknown_entityref(self, ref):
pass
class TestSGMLParser(SGMLParser):