1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 05:01:29 +00:00

Merge #2088: Update Zenmap to Python 3 and PyGObject

Note: Ndiff build will be broken until subsequent changes are made.
Deprecation warnings will need to be addressed in future changes.
Closes #2088
This commit is contained in:
dmiller
2022-12-07 20:34:03 +00:00
parent e2e55660c3
commit 24b26317c7
104 changed files with 5381 additions and 4383 deletions

View File

@@ -1,5 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
# ***********************IMPORTANT NMAP LICENSE TERMS************************
# * *
@@ -58,7 +57,7 @@
# * *
# ***************************************************************************/
from ConfigParser import ConfigParser, DEFAULTSECT, NoOptionError, \
from configparser import ConfigParser, DEFAULTSECT, NoOptionError, \
NoSectionError
from zenmapCore.UmitLogging import log
@@ -74,7 +73,7 @@ class UmitConfigParser(ConfigParser):
if not self.has_section(section):
self.add_section(section)
ConfigParser.set(self, section, option, value)
ConfigParser.set(self, section, option, str(value))
self.save_changes()
def read(self, filename):
@@ -104,15 +103,13 @@ class UmitConfigParser(ConfigParser):
if self._defaults:
fp.write("[%s]\n" % DEFAULTSECT)
items = self._defaults.items()
items.sort()
items = sorted(self._defaults.items())
for (key, value) in items:
fp.write("%s = %s\n" % (key, str(value).replace('\n', '\n\t')))
fp.write("\n")
sects = self._sections.keys()
sects.sort()
sects = sorted(self._sections.keys())
for section in sects:
fp.write("[%s]\n" % section)