mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +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:
parent
9210a7f1fa
commit
5c662fffdc
100 changed files with 2287 additions and 1814 deletions
|
|
@ -135,6 +135,7 @@ hildon = None
|
|||
|
||||
if is_maemo():
|
||||
import hildon
|
||||
|
||||
class BaseSearchWindow(hildon.Window):
|
||||
def __init__(self):
|
||||
hildon.Window.__init__(self)
|
||||
|
|
@ -151,6 +152,7 @@ else:
|
|||
def _pack_widgets(self):
|
||||
self.vbox.set_border_width(4)
|
||||
|
||||
|
||||
class SearchWindow(BaseSearchWindow, object):
|
||||
def __init__(self, load_method, append_method):
|
||||
BaseSearchWindow.__init__(self)
|
||||
|
|
@ -200,7 +202,8 @@ class SearchWindow(BaseSearchWindow, object):
|
|||
|
||||
def _connect_widgets(self):
|
||||
# Double click on result, opens it
|
||||
self.search_gui.result_view.connect("row-activated", self.open_selected)
|
||||
self.search_gui.result_view.connect(
|
||||
"row-activated", self.open_selected)
|
||||
|
||||
self.btn_open.connect("clicked", self.open_selected)
|
||||
self.btn_append.connect("clicked", self.append_selected)
|
||||
|
|
@ -214,14 +217,16 @@ class SearchWindow(BaseSearchWindow, object):
|
|||
def set_label_text(self, text):
|
||||
self.bottom_label.set_label(text)
|
||||
|
||||
def open_selected(self, widget=None, path=None, view_column=None, extra=None):
|
||||
def open_selected(self, widget=None, path=None, view_column=None,
|
||||
extra=None):
|
||||
# Open selected results
|
||||
self.load_method(self.results)
|
||||
|
||||
# Close Search Window
|
||||
self.close()
|
||||
|
||||
def append_selected(self, widget=None, path=None, view_column=None, extra=None):
|
||||
def append_selected(self, widget=None, path=None, view_column=None,
|
||||
extra=None):
|
||||
# Append selected results
|
||||
self.append_method(self.results)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue