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

Skip to content

Commit 00e5582

Browse files
committed
Minor style update
1 parent 8b3e17e commit 00e5582

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

lib/core/progress.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ class ProgressBar(object):
1717
def __init__(self, minValue=0, maxValue=10, totalWidth=None):
1818
self._progBar = "[]"
1919
self._oldProgBar = ""
20-
self.__min = int(minValue)
21-
self.__max = int(maxValue)
22-
self.__span = self.__max - self.__min
23-
self.__width = totalWidth if totalWidth else conf.progressWidth
24-
self.__amount = 0
20+
self._min = int(minValue)
21+
self._max = int(maxValue)
22+
self._span = self._max - self._min
23+
self._width = totalWidth if totalWidth else conf.progressWidth
24+
self._amount = 0
2525
self.update()
2626

2727
def _convertSeconds(self, value):
@@ -36,21 +36,21 @@ def update(self, newAmount=0):
3636
This method updates the progress bar
3737
"""
3838

39-
if newAmount < self.__min:
40-
newAmount = self.__min
41-
elif newAmount > self.__max:
42-
newAmount = self.__max
39+
if newAmount < self._min:
40+
newAmount = self._min
41+
elif newAmount > self._max:
42+
newAmount = self._max
4343

44-
self.__amount = newAmount
44+
self._amount = newAmount
4545

4646
# Figure out the new percent done, round to an integer
47-
diffFromMin = float(self.__amount - self.__min)
48-
percentDone = (diffFromMin / float(self.__span)) * 100.0
47+
diffFromMin = float(self._amount - self._min)
48+
percentDone = (diffFromMin / float(self._span)) * 100.0
4949
percentDone = round(percentDone)
5050
percentDone = int(percentDone)
5151

5252
# Figure out how many hash bars the percentage should be
53-
allFull = self.__width - 2
53+
allFull = self._width - 2
5454
numHashes = (percentDone / 100.0) * allFull
5555
numHashes = int(round(numHashes))
5656

@@ -75,11 +75,11 @@ def draw(self, eta=0):
7575
if self._progBar != self._oldProgBar:
7676
self._oldProgBar = self._progBar
7777

78-
if eta and self.__amount < self.__max:
79-
dataToStdout("\r%s %d/%d ETA %s" % (self._progBar, self.__amount, self.__max, self._convertSeconds(int(eta))))
78+
if eta and self._amount < self._max:
79+
dataToStdout("\r%s %d/%d ETA %s" % (self._progBar, self._amount, self._max, self._convertSeconds(int(eta))))
8080
else:
81-
blank = " " * (80 - len("\r%s %d/%d" % (self._progBar, self.__amount, self.__max)))
82-
dataToStdout("\r%s %d/%d%s" % (self._progBar, self.__amount, self.__max, blank))
81+
blank = " " * (80 - len("\r%s %d/%d" % (self._progBar, self._amount, self._max)))
82+
dataToStdout("\r%s %d/%d%s" % (self._progBar, self._amount, self._max, blank))
8383

8484
def __str__(self):
8585
"""

lib/takeover/xp_cmdshell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ def xpCmdshellForgeCmd(self, cmd, insertIntoTable=None):
161161
# Obfuscate the command to execute, also useful to bypass filters
162162
# on single-quotes
163163
self._randStr = randomStr(lowercase=True)
164-
self.__cmd = "0x%s" % hexencode(cmd)
164+
self._cmd = "0x%s" % hexencode(cmd)
165165
self._forgedCmd = "DECLARE @%s VARCHAR(8000);" % self._randStr
166-
self._forgedCmd += "SET @%s=%s;" % (self._randStr, self.__cmd)
166+
self._forgedCmd += "SET @%s=%s;" % (self._randStr, self._cmd)
167167

168168
# Insert the command standard output into a support table,
169169
# 'sqlmapoutput', except when DBMS credentials are provided because

0 commit comments

Comments
 (0)