Updated to conform to PEP-8, based on suggestions from SublimeLinter.
This commit is contained in:
parent
634e514a6c
commit
24112ed67b
@ -23,6 +23,7 @@ except:
|
|||||||
print >>sys.stderr, "Missing Python VTE bindings."
|
print >>sys.stderr, "Missing Python VTE bindings."
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
### Config Dialog ###
|
### Config Dialog ###
|
||||||
class CruSSHConf:
|
class CruSSHConf:
|
||||||
### State Vars ###
|
### State Vars ###
|
||||||
@ -109,6 +110,7 @@ class CruSSHConf:
|
|||||||
|
|
||||||
self.initGUI(save_func)
|
self.initGUI(save_func)
|
||||||
|
|
||||||
|
|
||||||
### CruSSH! ###
|
### CruSSH! ###
|
||||||
class CruSSH:
|
class CruSSH:
|
||||||
### Config Vars ###
|
### Config Vars ###
|
||||||
@ -145,7 +147,7 @@ class CruSSH:
|
|||||||
if len(hosts) > 0:
|
if len(hosts) > 0:
|
||||||
host = hosts.pop()
|
host = hosts.pop()
|
||||||
self.Terminals[host].set_size(self.Config["min-width"], self.Config["min-height"])
|
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):
|
def reflow(self, force=False):
|
||||||
# reconfigure before updating rows and columns
|
# reconfigure before updating rows and columns
|
||||||
@ -162,7 +164,7 @@ class CruSSH:
|
|||||||
cols = 1
|
cols = 1
|
||||||
elif cols > num_terms:
|
elif cols > num_terms:
|
||||||
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:
|
if rows < 1:
|
||||||
rows = 1
|
rows = 1
|
||||||
if (self.LayoutTable.props.n_columns != cols) or (self.LayoutTable.props.n_rows != rows) or force:
|
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):
|
def initGUI(self):
|
||||||
theme = gtk.icon_theme_get_default()
|
theme = gtk.icon_theme_get_default()
|
||||||
icon_list = []
|
|
||||||
if theme.has_icon("terminal"):
|
if theme.has_icon("terminal"):
|
||||||
icon = theme.lookup_icon("terminal", 128, flags=gtk.ICON_LOOKUP_USE_BUILTIN)
|
icon = theme.lookup_icon("terminal", 128, flags=gtk.ICON_LOOKUP_USE_BUILTIN)
|
||||||
if icon is not None:
|
if icon is not None:
|
||||||
@ -217,6 +218,7 @@ class CruSSH:
|
|||||||
EditMenu = gtk.Menu()
|
EditMenu = gtk.Menu()
|
||||||
EditItem.set_submenu(EditMenu)
|
EditItem.set_submenu(EditMenu)
|
||||||
PrefsItem = gtk.MenuItem(label="Preferences")
|
PrefsItem = gtk.MenuItem(label="Preferences")
|
||||||
|
|
||||||
def save_func(new_config):
|
def save_func(new_config):
|
||||||
self.Config = new_config
|
self.Config = new_config
|
||||||
self.reflow(force=True)
|
self.reflow(force=True)
|
||||||
@ -246,6 +248,7 @@ class CruSSH:
|
|||||||
# don't display chars while typing.
|
# don't display chars while typing.
|
||||||
self.EntryBox.set_visibility(False)
|
self.EntryBox.set_visibility(False)
|
||||||
self.EntryBox.set_invisible_char(' ')
|
self.EntryBox.set_invisible_char(' ')
|
||||||
|
|
||||||
# forward key events to all terminals
|
# forward key events to all terminals
|
||||||
def feed_input(widget, event):
|
def feed_input(widget, event):
|
||||||
if event.type in [gtk.gdk.KEY_PRESS, gtk.gdk.KEY_RELEASE]:
|
if event.type in [gtk.gdk.KEY_PRESS, gtk.gdk.KEY_RELEASE]:
|
||||||
|
Loading…
Reference in New Issue
Block a user