mirror of
https://github.com/nmap/nmap.git
synced 2026-01-06 14:39:03 +00:00
Spellcheck on all Python files
This commit is contained in:
@@ -257,7 +257,7 @@ class NetworkInventory(object):
|
||||
#remove ports which are no longer up
|
||||
if old_date < new_date:
|
||||
for defunct_port in old_list:
|
||||
#Check if defunt_port is in ports and that the protocol matches
|
||||
#Check if defunct_port is in ports and that the protocol matches
|
||||
port_number = int(defunct_port['portid'])
|
||||
if port_number in ports:
|
||||
if defunct_port['protocol'] in ports[port_number]:
|
||||
@@ -664,7 +664,7 @@ class FilteredNetworkInventoryTest(unittest.TestCase):
|
||||
|
||||
class PortChangeTest(unittest.TestCase):
|
||||
def test_port(self):
|
||||
"""Verify that the port status (open/filtered/closed) is diplayed """ \
|
||||
"""Verify that the port status (open/filtered/closed) is displayed """ \
|
||||
"""correctly when the port status changes in newer scans"""
|
||||
from zenmapCore.NmapParser import NmapParser
|
||||
inv = NetworkInventory()
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
class option:
|
||||
"""A single option, part of a pool of potential options. It's just a name
|
||||
and a flag saying if the option takes no argument, if an agument is
|
||||
and a flag saying if the option takes no argument, if an argument is
|
||||
optional, or if an argument is required."""
|
||||
NO_ARGUMENT = 0
|
||||
REQUIRED_ARGUMENT = 1
|
||||
|
||||
@@ -907,7 +907,7 @@ class NmapParserSAX(ParserBasics, ContentHandler):
|
||||
|
||||
def _parsing(self, attrs, unique_names, other_names):
|
||||
# Returns a dict with the attributes of a given tag with the
|
||||
# atributes names as keys and their respective values
|
||||
# attributes names as keys and their respective values
|
||||
dic = {}
|
||||
for at in unique_names:
|
||||
dic[at] = unique(attrs.get(at, ""))
|
||||
@@ -1262,7 +1262,7 @@ class NmapParserSAX(ParserBasics, ContentHandler):
|
||||
writer.endElement("uptime")
|
||||
|
||||
#####################
|
||||
# Sequences elementes
|
||||
# Sequences elements
|
||||
## TCP Sequence element
|
||||
# Cannot use dict() here, because of the 'class' attribute.
|
||||
writer.startElement("tcpsequence",
|
||||
|
||||
@@ -130,17 +130,17 @@ class RecentScans(object):
|
||||
self.temp_list = []
|
||||
|
||||
try:
|
||||
self.recents_scans_file = Path.recent_scans
|
||||
self.recent_scans_file = Path.recent_scans
|
||||
except:
|
||||
self.recents_scans_file = False
|
||||
self.recent_scans_file = False
|
||||
|
||||
if self.recents_scans_file and \
|
||||
(access(self.recents_scans_file, R_OK and W_OK) or \
|
||||
access(dirname(self.recents_scans_file), R_OK and W_OK)):
|
||||
if self.recent_scans_file and \
|
||||
(access(self.recent_scans_file, R_OK and W_OK) or \
|
||||
access(dirname(self.recent_scans_file), R_OK and W_OK)):
|
||||
self.using_file = True
|
||||
|
||||
# Recovering saved targets
|
||||
recent_file = open(self.recents_scans_file, "r")
|
||||
recent_file = open(self.recent_scans_file, "r")
|
||||
self.temp_list = [t for t in recent_file.read().split(";") \
|
||||
if t != "" and t != "\n"]
|
||||
recent_file.close()
|
||||
@@ -149,7 +149,7 @@ class RecentScans(object):
|
||||
|
||||
def save(self):
|
||||
if self.using_file:
|
||||
recent_file = open(self.recents_scans_file, "w")
|
||||
recent_file = open(self.recent_scans_file, "w")
|
||||
recent_file.write(";".join(self.temp_list))
|
||||
recent_file.close()
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ if isinstance(umitdb, str):
|
||||
fs_enc = "UTF-8"
|
||||
umitdb = umitdb.decode(fs_enc)
|
||||
|
||||
# pyslite 2.4.0 doesn't handle a unicode database name, though earlier and
|
||||
# pysqlite 2.4.0 doesn't handle a unicode database name, though earlier and
|
||||
# later versions do. Encode to UTF-8 as pysqlite would do internally anyway.
|
||||
umitdb = umitdb.encode("UTF-8")
|
||||
|
||||
@@ -183,7 +183,7 @@ connection = sqlite.connect(umitdb)
|
||||
|
||||
# By default pysqlite will raise an OperationalError when trying to return a
|
||||
# TEXT data type that is not UTF-8 (it always tries to decode text in order to
|
||||
# return a unicdoe object). We store XML in the database, which may have a
|
||||
# return a unicode object). We store XML in the database, which may have a
|
||||
# different encoding, so instruct pysqlite to return a plain str for TEXT data
|
||||
# types, and not to attempt any decoding.
|
||||
try:
|
||||
@@ -292,7 +292,7 @@ class UmitDB(object):
|
||||
|
||||
def cleanup(self, save_time):
|
||||
log.debug(">>> Cleaning up data base.")
|
||||
log.debug(">>> Removing results olders than %s seconds" % save_time)
|
||||
log.debug(">>> Removing results older than %s seconds" % save_time)
|
||||
self.cursor.execute("SELECT scans_id FROM scans WHERE date < ?",
|
||||
(time() - save_time,))
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ used more than once to get even more verbosity"))
|
||||
|
||||
def get_target(self):
|
||||
"""Returns a string with the target specified, or False if this option
|
||||
wass not called by the user"""
|
||||
was not called by the user"""
|
||||
return self.options.target
|
||||
|
||||
def get_open_results(self):
|
||||
|
||||
Reference in New Issue
Block a user