1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 12:41: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************************
# * *
@@ -75,7 +74,7 @@ NAME_PY = os.path.join("zenmapCore", "Name.py")
def update_date(base_dir):
name_file = os.path.join(base_dir, NAME_PY)
print ">>> Updating %s" % name_file
print(">>> Updating %s" % name_file)
nf = open(name_file, "r")
ncontent = nf.read()
nf.close()
@@ -89,22 +88,22 @@ def update_date(base_dir):
def update_version(base_dir, version):
print ">>> Updating %s" % os.path.join(base_dir, VERSION)
print(">>> Updating %s" % os.path.join(base_dir, VERSION))
vf = open(os.path.join(base_dir, VERSION), "wb")
print >> vf, version
print(version, file=vf)
vf.close()
print ">>> Updating %s" % os.path.join(base_dir, VERSION_PY)
print(">>> Updating %s" % os.path.join(base_dir, VERSION_PY))
vf = open(os.path.join(base_dir, VERSION_PY), "w")
print >> vf, "VERSION = \"%s\"" % version
print("VERSION = \"%s\"" % version, file=vf)
vf.close()
if __name__ == "__main__":
if len(sys.argv) != 2:
print >> sys.stderr, "Usage: %s <version>" % sys.argv[0]
print("Usage: %s <version>" % sys.argv[0], file=sys.stderr)
sys.exit(1)
version = sys.argv[1]
print ">>> Updating version number to \"%s\"" % version
print(">>> Updating version number to \"%s\"" % version)
update_version(".", version)
update_date(".")