mirror of
https://github.com/nmap/nmap.git
synced 2025-12-19 05:59:01 +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:
@@ -135,7 +135,6 @@ class BWTextView(BWScrolledWindow):
|
||||
|
||||
self.__create_widgets()
|
||||
|
||||
|
||||
def __create_widgets(self):
|
||||
"""
|
||||
"""
|
||||
@@ -144,25 +143,21 @@ class BWTextView(BWScrolledWindow):
|
||||
|
||||
self.add_with_viewport(self.__textview)
|
||||
|
||||
|
||||
def bw_set_auto_scroll(self, value):
|
||||
"""
|
||||
"""
|
||||
self.__auto_scroll = value
|
||||
|
||||
|
||||
def bw_set_editable(self, editable):
|
||||
"""
|
||||
"""
|
||||
self.__textview.set_editable(False)
|
||||
|
||||
|
||||
def bw_modify_font(self, font):
|
||||
"""
|
||||
"""
|
||||
self.__textview.modify_font(font)
|
||||
|
||||
|
||||
def bw_set_text(self, text):
|
||||
"""
|
||||
"""
|
||||
@@ -171,27 +166,23 @@ class BWTextView(BWScrolledWindow):
|
||||
if self.__auto_scroll:
|
||||
self.bw_set_scroll_down()
|
||||
|
||||
|
||||
def bw_get_text(self):
|
||||
"""
|
||||
"""
|
||||
return self.__textbuffer.get_text(self.__textbuffer.get_start_iter(),
|
||||
self.__textbuffer.get_end_iter())
|
||||
|
||||
|
||||
def bw_set_scroll_down(self):
|
||||
"""
|
||||
"""
|
||||
self.get_vadjustment().set_value(self.get_vadjustment().upper)
|
||||
|
||||
|
||||
def bw_get_textbuffer(self):
|
||||
"""
|
||||
"""
|
||||
return self.__textbuffer
|
||||
|
||||
|
||||
|
||||
class BWTextEditor(BWScrolledWindow):
|
||||
"""
|
||||
"""
|
||||
@@ -205,7 +196,6 @@ class BWTextEditor(BWScrolledWindow):
|
||||
|
||||
self.__create_widgets()
|
||||
|
||||
|
||||
def __create_widgets(self):
|
||||
"""
|
||||
"""
|
||||
@@ -225,33 +215,28 @@ class BWTextEditor(BWScrolledWindow):
|
||||
|
||||
self.add_with_viewport(self.__hbox)
|
||||
|
||||
|
||||
def __expose(self, widget, event):
|
||||
"""
|
||||
"""
|
||||
# code to fix a gtk issue that don't show text correctly
|
||||
self.__hbox.check_resize()
|
||||
|
||||
|
||||
def bw_set_auto_scroll(self, value):
|
||||
"""
|
||||
"""
|
||||
self.__auto_scroll = value
|
||||
|
||||
|
||||
def bw_set_editable(self, editable):
|
||||
"""
|
||||
"""
|
||||
self.__textview.set_editable(False)
|
||||
|
||||
|
||||
def bw_modify_font(self, font):
|
||||
"""
|
||||
"""
|
||||
self.__textview.modify_font(font)
|
||||
self.__lineview.modify_font(font)
|
||||
|
||||
|
||||
def bw_set_text(self, text):
|
||||
"""
|
||||
"""
|
||||
@@ -273,14 +258,12 @@ class BWTextEditor(BWScrolledWindow):
|
||||
self.__textbuffer.set_text("")
|
||||
self.__linebuffer.set_text("")
|
||||
|
||||
|
||||
def bw_get_text(self):
|
||||
"""
|
||||
"""
|
||||
return self.__textbuffer.get_text(self.__textbuffer.get_start_iter(),
|
||||
self.__textbuffer.get_end_iter())
|
||||
|
||||
|
||||
def bw_set_scroll_down(self):
|
||||
"""
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user