mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 09:49:05 +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:
@@ -134,12 +134,14 @@ import gobject
|
||||
|
||||
from gtkutils import gobject_register
|
||||
|
||||
|
||||
class HIGSpinnerImages:
|
||||
def __init__(self):
|
||||
"""This class holds list of GDK Pixbuffers.
|
||||
|
||||
- static_pixbufs is used for multiple static pixbuffers
|
||||
- self.animated_pixbufs is used for the pixbuffers that make up the animation
|
||||
- self.animated_pixbufs is used for the pixbuffers that make up the
|
||||
animation
|
||||
"""
|
||||
|
||||
dprint('HIGSpinnerImages::__init__')
|
||||
@@ -182,7 +184,7 @@ class HIGSpinnerImages:
|
||||
|
||||
dprint('HIGSpinnerImages::set_rest_pixbuf')
|
||||
|
||||
if not self.static_pixbufs.has_key(name):
|
||||
if name not in self.static_pixbufs:
|
||||
raise StaticPixbufNotFound
|
||||
|
||||
# self.rest_pixbuf holds the *real* pixbuf, not it's name
|
||||
@@ -322,6 +324,7 @@ class HIGSpinnerCache:
|
||||
self.spinner_images.static_pixbufs[key_name].save(path_name,
|
||||
image_format)
|
||||
|
||||
|
||||
class HIGSpinner(gtk.EventBox):
|
||||
"""Simple spinner, such as the one found in webbrowsers and file managers.
|
||||
|
||||
@@ -331,8 +334,8 @@ class HIGSpinner(gtk.EventBox):
|
||||
* height, the height that will be set for the images
|
||||
"""
|
||||
|
||||
__gsignals__ = { 'expose-event' : 'override',
|
||||
'size-request' : 'override' }
|
||||
__gsignals__ = {'expose-event': 'override',
|
||||
'size-request': 'override'}
|
||||
|
||||
def __init__(self):
|
||||
gtk.EventBox.__init__(self)
|
||||
@@ -384,8 +387,8 @@ class HIGSpinner(gtk.EventBox):
|
||||
if self.timer_task == 0:
|
||||
self.current_pixbuf = self.cache.spinner_images.rest_pixbuf
|
||||
else:
|
||||
self.current_pixbuf = self.cache.spinner_images.animated_pixbufs\
|
||||
[self.animated_pixbuf_index]
|
||||
self.current_pixbuf = self.cache.spinner_images.animated_pixbufs[
|
||||
self.animated_pixbuf_index]
|
||||
|
||||
def start(self):
|
||||
"""Starts the animation"""
|
||||
@@ -401,11 +404,11 @@ class HIGSpinner(gtk.EventBox):
|
||||
self.timer_task = 0
|
||||
self.queue_draw()
|
||||
|
||||
|
||||
def stop(self):
|
||||
"""Stops the animation
|
||||
|
||||
Do the same stuff as pause, but returns the animation to the beggining."""
|
||||
Do the same stuff as pause, but returns the animation to the
|
||||
beginning."""
|
||||
self.pause()
|
||||
self.animated_pixbuf_index = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user