1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-19 22:19:02 +00:00

Apply PEP 8 style guidance to zenmap

Using the pep8 tool (https://pypi.python.org/pypi/pep8), fixed the
following style issues:

Count   Issue
11      E201 whitespace after '['
8       E203 whitespace before ','
41      E211 whitespace before '('
11      E221 multiple spaces before operator
61      E225 missing whitespace around operator
237     E231 missing whitespace after ':'
91      E251 no spaces around keyword / parameter equals
19      E261 at least two spaces before inline comment
41      E301 expected 1 blank line, found 0
200     E302 expected 2 blank lines, found 1
356     E303 too many blank lines (2)
563     E501 line too long (106 characters)
39      E701 multiple statements on one line (colon)
13      E702 multiple statements on one line (semicolon)
4       W291 trailing whitespace
2       W293 blank line contains whitespace
8       W391 blank line at end of file
21      W601 .has_key() is deprecated, use 'in'
2       W602 deprecated form of raising exception

The remaining issues are long lines due to very deep data structures. I
chose not to alter them, as it would involve backslash-continuation
where whitespace is not permitted:

./zenmapGUI/ScanInterface.py:323:80: E501 line too long (90 characters)
./zenmapGUI/ScanInterface.py:456:80: E501 line too long (84 characters)
./zenmapGUI/ScanInterface.py:464:80: E501 line too long (84 characters)
./zenmapGUI/ScanInterface.py:472:80: E501 line too long (122 characters)
./zenmapGUI/ScanInterface.py:479:80: E501 line too long (122 characters)
./zenmapGUI/ScanInterface.py:920:80: E501 line too long (94 characters)
./zenmapGUI/ScanInterface.py:923:80: E501 line too long (93 characters)
./zenmapGUI/MainWindow.py:575:80: E501 line too long (99 characters)
./zenmapGUI/MainWindow.py:906:80: E501 line too long (99 characters)
This commit is contained in:
dmiller
2014-01-08 19:50:22 +00:00
parent 9210a7f1fa
commit 5c662fffdc
100 changed files with 2287 additions and 1814 deletions

View File

@@ -136,7 +136,6 @@ HIDE = False
REFRESH_RATE = 500
class ToolsMenu(gtk.Menu):
"""
"""
@@ -149,7 +148,6 @@ class ToolsMenu(gtk.Menu):
self.__create_items()
def __create_items(self):
"""
"""
@@ -163,7 +161,6 @@ class ToolsMenu(gtk.Menu):
self.__hosts.show_all()
def __hosts_viewer_callback(self, widget):
"""
"""
@@ -171,20 +168,17 @@ class ToolsMenu(gtk.Menu):
window.show_all()
window.set_keep_above(True)
def enable_dependents(self):
"""
"""
self.__hosts.set_sensitive(True)
def disable_dependents(self):
"""
"""
self.__hosts.set_sensitive(False)
class Toolbar(gtk.HBox):
"""
"""
@@ -213,7 +207,6 @@ class Toolbar(gtk.HBox):
self.__create_widgets()
def __create_widgets(self):
"""
"""
@@ -233,7 +226,8 @@ class Toolbar(gtk.HBox):
self.__hosts_button = BWStockButton(gtk.STOCK_INDEX, _("Hosts Viewer"))
self.__hosts_button.connect("clicked", self.__hosts_viewer_callback)
self.__control = BWToggleStockButton(gtk.STOCK_PROPERTIES, _("Controls"))
self.__control = BWToggleStockButton(
gtk.STOCK_PROPERTIES, _("Controls"))
self.__control.connect('clicked', self.__control_callback)
self.__control.set_active(False)
@@ -273,7 +267,6 @@ class Toolbar(gtk.HBox):
self.pack_start(self.__control, False)
self.pack_end(self.__save_button, False)
def disable_controls(self):
"""
"""
@@ -282,7 +275,6 @@ class Toolbar(gtk.HBox):
self.__hosts_button.set_sensitive(False)
#self.__tools_menu.disable_dependents()
def enable_controls(self):
"""
"""
@@ -291,13 +283,11 @@ class Toolbar(gtk.HBox):
self.__hosts_button.set_sensitive(True)
#self.__tools_menu.enable_dependents()
def __tools_callback(self, widget):
"""
"""
self.__tools_menu.popup(None, None, None, 1, 0)
def __hosts_viewer_callback(self, widget):
"""
"""
@@ -305,7 +295,6 @@ class Toolbar(gtk.HBox):
window.show_all()
window.set_keep_above(True)
def __save_image_callback(self, widget):
"""
"""
@@ -330,7 +319,6 @@ class Toolbar(gtk.HBox):
self.__save_chooser.hide()
def __control_callback(self, widget=None):
"""
"""
@@ -340,7 +328,6 @@ class Toolbar(gtk.HBox):
else:
self.__control_widget.hide()
def __fisheye_callback(self, widget=None):
"""
"""
@@ -356,14 +343,12 @@ class Toolbar(gtk.HBox):
self.__fisheye_widget.deactive_fisheye()
self.__fisheye_widget.hide()
def __about_callback(self, widget):
"""
"""
self.__about_dialog = AboutDialog()
self.__about_dialog.show_all()
def __fullscreen_callback(self, widget=None):
"""
"""
@@ -372,4 +357,3 @@ class Toolbar(gtk.HBox):
else:
self.__window.unfullscreen()