commit
492dbeadc1
13
crussh.py
13
crussh.py
@ -31,7 +31,7 @@ class CruSSHConf:
|
||||
### Signal Hooks ###
|
||||
def save_hook(self, discard, save_func):
|
||||
self.MainWin.destroy()
|
||||
if save_func != None:
|
||||
if save_func is not None:
|
||||
save_func(self.Config)
|
||||
|
||||
def font_hook(self, fontbutton):
|
||||
@ -87,7 +87,7 @@ class CruSSHConf:
|
||||
|
||||
# we'll wire up a supplied save_func that takes the Config dict as an argument.
|
||||
def __init__(self, config=None, save_func=None):
|
||||
if config != None:
|
||||
if config is not None:
|
||||
self.Config = config
|
||||
|
||||
self.initGUI(save_func)
|
||||
@ -170,7 +170,7 @@ class CruSSH:
|
||||
icon_list = []
|
||||
if theme.has_icon("terminal"):
|
||||
icon = theme.lookup_icon("terminal", 128, flags=gtk.ICON_LOOKUP_USE_BUILTIN)
|
||||
if icon != None:
|
||||
if icon is not None:
|
||||
gtk.window_set_default_icon(icon.load_icon())
|
||||
self.MainWin.set_title("crussh: " + ' '.join(self.Terminals.keys()))
|
||||
self.MainWin.set_role(role="crussh_main_win")
|
||||
@ -277,12 +277,15 @@ if __name__ == "__main__":
|
||||
import argparse
|
||||
|
||||
### Parse CLI Args ###
|
||||
parser = argparse.ArgumentParser(description="Connect to multiple servers in parallel.", usage="%(prog)s [OPTIONS] HOST [HOST ...]")
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Connect to multiple servers in parallel.",
|
||||
usage="%(prog)s [OPTIONS] [--] HOST [HOST ...]",
|
||||
epilog="* NOTE: You can pass options to ssh if you add '--' before your list of hosts")
|
||||
(args, hosts) = parser.parse_known_args()
|
||||
|
||||
if len(hosts) == 0:
|
||||
parser.print_usage()
|
||||
sys.exit(1)
|
||||
parser.exit(2)
|
||||
|
||||
if "--" in hosts:
|
||||
offset = hosts.index("--") + 1
|
||||
|
Loading…
Reference in New Issue
Block a user