1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 21:21:31 +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,10 @@
# * *
# ***************************************************************************/
import gtk
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class ScansListStoreEntry(object):
@@ -66,7 +68,7 @@ class ScansListStoreEntry(object):
otherwise represented by very different classes."""
# Possible states for the scan to be in.
UNINITIALIZED, RUNNING, FINISHED, FAILED, CANCELED = range(5)
UNINITIALIZED, RUNNING, FINISHED, FAILED, CANCELED = list(range(5))
def __init__(self):
self.state = self.UNINITIALIZED
@@ -101,11 +103,11 @@ class ScansListStoreEntry(object):
canceled = property(lambda self: self.state == self.CANCELED)
class ScansListStore(gtk.ListStore):
"""This is a specialization of a gtk.ListStore that holds running,
class ScansListStore(Gtk.ListStore):
"""This is a specialization of a Gtk.ListStore that holds running,
completed, and failed scans."""
def __init__(self):
gtk.ListStore.__init__(self, object)
Gtk.ListStore.__init__(self, object)
def add_running_scan(self, command):
"""Add a running NmapCommand object to the list of scans."""