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:
@@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# ***********************IMPORTANT NMAP LICENSE TERMS************************
|
||||
# * *
|
||||
@@ -58,7 +57,11 @@
|
||||
# * *
|
||||
# ***************************************************************************/
|
||||
|
||||
import gtk
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk
|
||||
|
||||
from zenmapGUI.higwidgets.higboxes import HIGVBox, HIGHBox,\
|
||||
hig_box_space_holder
|
||||
from zenmapGUI.higwidgets.higtables import HIGTable
|
||||
@@ -86,7 +89,7 @@ class ScanRunDetailsPage(HIGVBox):
|
||||
self.debug_label = HIGEntryLabel(_('Debug level:'))
|
||||
self.info_debug_label = HIGEntryLabel(na)
|
||||
|
||||
self.command_expander = gtk.Expander(
|
||||
self.command_expander = Gtk.Expander.new(
|
||||
"<b>" + _("Command Info") + "</b>")
|
||||
self.command_expander.set_use_markup(True)
|
||||
|
||||
@@ -140,7 +143,7 @@ class ScanRunDetailsPage(HIGVBox):
|
||||
self.closed_label = HIGEntryLabel(_('Closed ports:'))
|
||||
self.info_closed_label = HIGEntryLabel(na)
|
||||
|
||||
self.general_expander = gtk.Expander(
|
||||
self.general_expander = Gtk.Expander.new(
|
||||
"<b>" + _("General Info") + "</b>")
|
||||
self.general_expander.set_use_markup(True)
|
||||
|
||||
@@ -202,7 +205,7 @@ class ScanRunDetailsPage(HIGVBox):
|
||||
self.info_closed_label.set_text(str(scan.get_closed_ports()))
|
||||
|
||||
for scaninfo in scan.get_scaninfo():
|
||||
exp = gtk.Expander('<b>%s - %s</b>' % (
|
||||
exp = Gtk.Expander.new('<b>%s - %s</b>' % (
|
||||
_('Scan Info'), scaninfo['type'].capitalize()))
|
||||
exp.set_use_markup(True)
|
||||
|
||||
@@ -241,7 +244,7 @@ class ScanRunDetailsPage(HIGVBox):
|
||||
def make_services_display(self, services):
|
||||
"""Return a widget displaying a list of services like
|
||||
1-1027,1029-1033,1040,1043,1050,1058-1059,1067-1068,1076,1080"""
|
||||
combo = gtk.combo_box_new_text()
|
||||
combo = Gtk.ComboBoxText()
|
||||
|
||||
for i in services.split(","):
|
||||
combo.append_text(i)
|
||||
@@ -256,8 +259,8 @@ if __name__ == "__main__":
|
||||
parsed = NmapParser()
|
||||
parsed.parse_file(filename)
|
||||
run_details = ScanRunDetailsPage(parsed)
|
||||
window = gtk.Window()
|
||||
window = Gtk.Window()
|
||||
window.add(run_details)
|
||||
window.connect("delete-event", lambda *args: gtk.main_quit())
|
||||
window.connect("delete-event", lambda *args: Gtk.main_quit())
|
||||
window.show_all()
|
||||
gtk.main()
|
||||
Gtk.main()
|
||||
|
||||
Reference in New Issue
Block a user