Updated to conform to PEP-8, based on suggestions from SublimeLinter.

This commit is contained in:
Graeme Humphries 2012-03-22 16:41:39 -07:00
parent 634e514a6c
commit 24112ed67b

View File

@ -23,6 +23,7 @@ except:
print >>sys.stderr, "Missing Python VTE bindings."
sys.exit(1)
### Config Dialog ###
class CruSSHConf:
### State Vars ###
@ -109,6 +110,7 @@ class CruSSHConf:
self.initGUI(save_func)
### CruSSH! ###
class CruSSH:
### Config Vars ###
@ -145,7 +147,7 @@ class CruSSH:
if len(hosts) > 0:
host = hosts.pop()
self.Terminals[host].set_size(self.Config["min-width"], self.Config["min-height"])
self.LayoutTable.attach(self.Terminals[host], col, col+1, row, row+1)
self.LayoutTable.attach(self.Terminals[host], col, col + 1, row, row + 1)
def reflow(self, force=False):
# reconfigure before updating rows and columns
@ -162,7 +164,7 @@ class CruSSH:
cols = 1
elif cols > num_terms:
cols = num_terms
rows = int(math.ceil(num_terms/float(cols)))
rows = int(math.ceil(num_terms / float(cols)))
if rows < 1:
rows = 1
if (self.LayoutTable.props.n_columns != cols) or (self.LayoutTable.props.n_rows != rows) or force:
@ -191,7 +193,6 @@ class CruSSH:
def initGUI(self):
theme = gtk.icon_theme_get_default()
icon_list = []
if theme.has_icon("terminal"):
icon = theme.lookup_icon("terminal", 128, flags=gtk.ICON_LOOKUP_USE_BUILTIN)
if icon is not None:
@ -217,6 +218,7 @@ class CruSSH:
EditMenu = gtk.Menu()
EditItem.set_submenu(EditMenu)
PrefsItem = gtk.MenuItem(label="Preferences")
def save_func(new_config):
self.Config = new_config
self.reflow(force=True)
@ -246,6 +248,7 @@ class CruSSH:
# don't display chars while typing.
self.EntryBox.set_visibility(False)
self.EntryBox.set_invisible_char(' ')
# forward key events to all terminals
def feed_input(widget, event):
if event.type in [gtk.gdk.KEY_PRESS, gtk.gdk.KEY_RELEASE]: