def row_activated_cb(self, treeview, path, column): tree_sel = self.treeView.get_selection() (tm, ti) = tree_sel.get_selected() try: username, host, port = get_by_name_settings(tm.get_value(ti, 0)) self.hide_me() cmd = '%s@%s -p %s' % (username, host, port) subprocess.Popen(args=["mate-terminal", "--command=ssh %s" % cmd]) except TypeError: pass
def __init__(self, name, settings): super(EditSsh, self).__init__(settings) self.settings = settings self.oldname = name self.edit = True username, host, port = get_by_name_settings(name) self.server_name.set_text(name) self.username.set_text(username) self.host.set_text(host) self.port.set_text(port)