Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 57dbbef

Browse files
committed
Minor style updates
1 parent 6bcf998 commit 57dbbef

7 files changed

Lines changed: 26 additions & 18 deletions

File tree

lib/core/common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3646,7 +3646,6 @@ def createGithubIssue(errMsg, excMsg):
36463646
except:
36473647
pass
36483648

3649-
36503649
data = {"title": "Unhandled exception (#%s)" % key, "body": "```%s\n```\n```\n%s```" % (errMsg, excMsg)}
36513650
req = _urllib.request.Request(url="https://api.github.com/repos/sqlmapproject/sqlmap/issues", data=getBytes(json.dumps(data)), headers={HTTP_HEADER.AUTHORIZATION: "token %s" % decodeBase64(GITHUB_REPORT_OAUTH_TOKEN, binary=False), HTTP_HEADER.USER_AGENT: fetchRandomAgent()})
36523651

lib/core/compat.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,30 +198,39 @@ def round(x, d=0):
198198

199199
p = 10 ** d
200200
if x > 0:
201-
return float(math.floor((x * p) + 0.5))/p
201+
return float(math.floor((x * p) + 0.5)) / p
202202
else:
203-
return float(math.ceil((x * p) - 0.5))/p
203+
return float(math.ceil((x * p) - 0.5)) / p
204204

205205
def cmp_to_key(mycmp):
206206
"""Convert a cmp= function into a key= function"""
207207
class K(object):
208208
__slots__ = ['obj']
209+
209210
def __init__(self, obj, *args):
210211
self.obj = obj
212+
211213
def __lt__(self, other):
212214
return mycmp(self.obj, other.obj) < 0
215+
213216
def __gt__(self, other):
214217
return mycmp(self.obj, other.obj) > 0
218+
215219
def __eq__(self, other):
216220
return mycmp(self.obj, other.obj) == 0
221+
217222
def __le__(self, other):
218223
return mycmp(self.obj, other.obj) <= 0
224+
219225
def __ge__(self, other):
220226
return mycmp(self.obj, other.obj) >= 0
227+
221228
def __ne__(self, other):
222229
return mycmp(self.obj, other.obj) != 0
230+
223231
def __hash__(self):
224232
raise TypeError('hash not implemented')
233+
225234
return K
226235

227236
# Note: patch for Python 2.6

lib/core/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ def pympTempLeakPatch(tempDir):
7878
import multiprocessing.util
7979
multiprocessing.util.get_temp_dir = lambda: tempDir
8080
except:
81-
pass
81+
pass

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty import six
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.5.71"
21+
VERSION = "1.3.5.72"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/utils/sgmllib.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def goahead(self, end):
174174
k = self.parse_pi(i)
175175
if k < 0:
176176
break
177-
i = i+k
177+
i = i + k
178178
continue
179179
if rawdata.startswith("<!", i):
180180
# This is some sort of declaration; in "HTML as
@@ -195,16 +195,16 @@ def goahead(self, end):
195195
name = match.group(1)
196196
self.handle_charref(name)
197197
i = match.end(0)
198-
if rawdata[i-1] != ';':
199-
i = i-1
198+
if rawdata[i - 1] != ';':
199+
i = i - 1
200200
continue
201201
match = entityref.match(rawdata, i)
202202
if match:
203203
name = match.group(1)
204204
self.handle_entityref(name)
205205
i = match.end(0)
206-
if rawdata[i-1] != ';':
207-
i = i-1
206+
if rawdata[i - 1] != ';':
207+
i = i - 1
208208
continue
209209
else:
210210
self.error('neither < nor & ??')
@@ -233,15 +233,15 @@ def goahead(self, end):
233233
# Internal -- parse processing instr, return length or -1 if not terminated
234234
def parse_pi(self, i):
235235
rawdata = self.rawdata
236-
if rawdata[i:i+2] != '<?':
236+
if rawdata[i:i + 2] != '<?':
237237
self.error('unexpected call to parse_pi()')
238-
match = piclose.search(rawdata, i+2)
238+
match = piclose.search(rawdata, i + 2)
239239
if not match:
240240
return -1
241241
j = match.start(0)
242-
self.handle_pi(rawdata[i+2: j])
242+
self.handle_pi(rawdata[i + 2: j])
243243
j = match.end(0)
244-
return j-i
244+
return j - i
245245

246246
def get_starttag_text(self):
247247
return self.__starttag_text
@@ -276,7 +276,7 @@ def parse_starttag(self, i):
276276
j = match.start(0)
277277
# Now parse the data between i + 1 and j into a tag and attrs
278278
attrs = []
279-
if rawdata[i:i+2] == '<>':
279+
if rawdata[i:i + 2] == '<>':
280280
# SGML shorthand: <> == <last open tag seen>
281281
k = j
282282
tag = self.lasttag
@@ -327,7 +327,7 @@ def parse_endtag(self, i):
327327
if not match:
328328
return -1
329329
j = match.start(0)
330-
tag = rawdata[i+2:j].strip().lower()
330+
tag = rawdata[i + 2:j].strip().lower()
331331
if rawdata[j] == '>':
332332
j = j + 1
333333
self.finish_endtag(tag)

plugins/dbms/firebird/syntax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def escape(expression, quote=True):
2525
"""
2626

2727
def escaper(value):
28-
return "||".join("ASCII_CHAR(%d)" %_ for _ in getOrds(value))
28+
return "||".join("ASCII_CHAR(%d)" % _ for _ in getOrds(value))
2929

3030
retVal = expression
3131

plugins/dbms/sybase/syntax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1#!/usr/bin/env python
1+
#!/usr/bin/env python
22

33
"""
44
Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)

0 commit comments

Comments
 (0)