From patchwork Mon Sep 19 18:01:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Bigonville X-Patchwork-Id: 9340295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 461E2601C2 for ; Mon, 19 Sep 2016 18:02:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39481295AF for ; Mon, 19 Sep 2016 18:02:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DC7929614; Mon, 19 Sep 2016 18:02:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from emsm-gh1-uea11.nsa.gov (smtp.nsa.gov [8.44.101.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3055D295AF for ; Mon, 19 Sep 2016 18:02:13 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.30,362,1470700800"; d="scan'208";a="19364784" IronPort-PHdr: =?us-ascii?q?9a23=3A9LGE8h/RVVvSwf9uRHKM819IXTAuvvDOBiVQ1KB9?= =?us-ascii?q?1O0cTK2v8tzYMVDF4r011RmSDNydu64P0rKO++C4ACpbsM7H6ChDOLV3FDY9wf?= =?us-ascii?q?0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5?= =?us-ascii?q?K6zPF5LIiIzvjqbpqsSVM1kD3WLlKfMqdVPt/F2X7pFXyaJZaY8JgiPTpXVJf+?= =?us-ascii?q?kEjUhJHnm02yjG28Gr4ZR4+D5Rsf9yv+RJUKH9YrhqBecAVGduDnoxrPHPmVGD?= =?us-ascii?q?CFLXpyhUbmJDiRdMAg7Y/DnmT5zxtW38reM71y6EbuPsSrVhfT2/9aptVFfCiS?= =?us-ascii?q?gAMSA49GXawph6ja1cpjqtqhZ+yoiSZ5uaYqktNpjBdM8XEDISFv1aUDZMV8bl?= =?us-ascii?q?N4Y=3D?= X-IPAS-Result: =?us-ascii?q?A2EACADMJuBX/wHyM5BdHAEFAQsBgykSAQEBAQEegVOjMQU?= =?us-ascii?q?BAgEBAQaXKSWBe4QKgVFMAQEBAQEBAQECAQJbJ4IyBAMTBXlbRAI3BgEBDCAMA?= =?us-ascii?q?gMJAhcIIQgIAwEtCwofCwUYBIgpAQMBsQOFMAEBBYdyHQiFbYk0EQE1M4UQmXS?= =?us-ascii?q?PUgqJfIVukF0CVIRscIVjeIEnAQEB?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 19 Sep 2016 18:02:11 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u8JI1MjG016948; Mon, 19 Sep 2016 14:01:31 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u8JI1Leg034465 for ; Mon, 19 Sep 2016 14:01:21 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u8JI1KYZ016946 for ; Mon, 19 Sep 2016 14:01:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AACwDMJuBX/2OteVtdHQYMgykSAQEBAQEegQxHozEJAQEGkyOEJodbTAECAQEBAQECXieFKAEBOC9tNIhLAwGxA4UwAQEFiA8IhW2KLoUQmXSPUgqPapBdAlSCMAyCMHCIAgEBAQ X-IPAS-Result: A1AACwDMJuBX/2OteVtdHQYMgykSAQEBAQEegQxHozEJAQEGkyOEJodbTAECAQEBAQECXieFKAEBOC9tNIhLAwGxA4UwAQEFiA8IhW2KLoUQmXSPUgqPapBdAlSCMAyCMHCIAgEBAQ X-IronPort-AV: E=Sophos;i="5.30,362,1470715200"; d="scan'208";a="5714595" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 19 Sep 2016 14:01:19 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AvEBvCRYznpZvucuK9ld7yDL/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpcq4bnLW6fgltlLVR4KTs6sC0LuP9fC8EjVYud7B6ClEK80UEUddyI?= =?us-ascii?q?0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0Iu?= =?us-ascii?q?frymUrDbg8n/7e2u4ZqbO1wO32vkJ+MuZ0zu9U2R7pBQ2to6bP5pi1PgmThhQ6?= =?us-ascii?q?xu32RmJFaezV7Xx/yb29pdyRlWoO8r7MVaUK/3LOwSRL1cCyk6YShuvJW4/UqL?= =?us-ascii?q?cQza/XYYU2MLgjJUEgPF61f8RZ63vSzk5cRn3yzPGcTrV70yRXyI7qhsTgHpjC?= =?us-ascii?q?MKf2oz8W7QjOR8gahaqRTnoAZwld2HKLqJPeZzK/uONegRQnBMC55c?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0EhCgB3J+BX/2OteVtdHQYMGAEBFgEBB?= =?us-ascii?q?QEBBAEBgmoSAQEBAQEegQxHozEFAQIBAQEGkyOEJoIAhVtMAQEBAQEBAQECAQJ?= =?us-ascii?q?bJ4IyGIEAW4EDAQE4L200iEsDAbB6hTABAQWIDgiFbYouhRCZdI9SCo9qkF0CV?= =?us-ascii?q?IIwDIIwcIgCAQEB?= X-IPAS-Result: =?us-ascii?q?A0EhCgB3J+BX/2OteVtdHQYMGAEBFgEBBQEBBAEBgmoSAQE?= =?us-ascii?q?BAQEegQxHozEFAQIBAQEGkyOEJoIAhVtMAQEBAQEBAQECAQJbJ4IyGIEAW4EDA?= =?us-ascii?q?QE4L200iEsDAbB6hTABAQWIDgiFbYouhRCZdI9SCo9qkF0CVIIwDIIwcIgCAQE?= =?us-ascii?q?B?= X-IronPort-AV: E=Sophos;i="5.30,362,1470700800"; d="scan'208";a="17732891" Received: from anor.bigon.be ([91.121.173.99]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2016 18:01:18 +0000 Received: from anor.bigon.be (localhost.localdomain [127.0.0.1]) by anor.bigon.be (Postfix) with ESMTP id A01661A1A8 for ; Mon, 19 Sep 2016 20:01:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bigon.be; h= x-mailer:message-id:date:date:subject:subject:from:from:received :received:received; s=key1; t=1474308074; x=1476122475; bh=lnRdC h1Bows606tKFzywzpH2RRKxLmxUGH3EEis0Urs=; b=s38tTyHp2FycMPAh9/uL2 zWMJI0Lj4XREIwaQ/CdyQ6xTBUkaCbjgwoVoZf+FftQf97Hqb3gYrv6yiHzLTHzq 3WmGUmkLV6ZbTKFfy3TU89sYV/7rLQKkHrU729Xyaj1tMdNB1URs3q+6zR04mcX6 LERzkCaEsBKnf5+Jscf65s= X-Virus-Scanned: Debian amavisd-new at bigon.be Received: from anor.bigon.be ([127.0.0.1]) by anor.bigon.be (anor.bigon.be [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eMTXbhneeYbF for ; Mon, 19 Sep 2016 20:01:14 +0200 (CEST) Received: from fornost.bigon.be (unknown [IPv6:2a02:a03f:d9:8b00:faa3:456b:4d88:6dc7]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bigon) by anor.bigon.be (Postfix) with ESMTPSA id 72BCB1A06E for ; Mon, 19 Sep 2016 20:01:14 +0200 (CEST) Received: from bigon (uid 1000) (envelope-from bigon@bigon.be) id 3fd60 by fornost.bigon.be (DragonFly Mail Agent v0.11); Mon, 19 Sep 2016 20:01:13 +0200 From: Laurent Bigonville To: selinux@tycho.nsa.gov Subject: [PATCH v2] sandbox: Use GObject introspection binding instead of pygtk2 Date: Mon, 19 Sep 2016 20:01:13 +0200 Message-Id: <20160919180113.5525-1-bigon@debian.org> X-Mailer: git-send-email 2.9.3 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: Petr Lautrbach sandbox command is also now using GTK 3.0 This patch comes from Fedora patch set Signed-off-by: Laurent Bigonville --- policycoreutils/sandbox/sandbox | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/policycoreutils/sandbox/sandbox b/policycoreutils/sandbox/sandbox index 9f200d5..726ba9b 100644 --- a/policycoreutils/sandbox/sandbox +++ b/policycoreutils/sandbox/sandbox @@ -111,16 +111,18 @@ def copyfile(file, srcdir, dest): def savefile(new, orig, X_ind): copy = False if(X_ind): - import gtk - dlg = gtk.MessageDialog(None, 0, gtk.MESSAGE_INFO, - gtk.BUTTONS_YES_NO, + import gi + gi.require_version('Gtk', '3.0') + from gi.repository import Gtk + dlg = Gtk.MessageDialog(None, 0, Gtk.MessageType.INFO, + Gtk.ButtonsType.YES_NO, _("Do you want to save changes to '%s' (Y/N): ") % orig) dlg.set_title(_("Sandbox Message")) - dlg.set_position(gtk.WIN_POS_MOUSE) + dlg.set_position(Gtk.WindowPosition.MOUSE) dlg.show_all() rc = dlg.run() dlg.destroy() - if rc == gtk.RESPONSE_YES: + if rc == Gtk.ResponseType.YES: copy = True else: try: @@ -452,8 +454,10 @@ sandbox [-h] [-l level ] [-[X|M] [-H homedir] [-T tempdir]] [-I includefile ] [- if self.__options.dpi: dpi = self.__options.dpi else: - import gtk - dpi = str(gtk.settings_get_default().props.gtk_xft_dpi / 1024) + import gi + gi.require_version('Gtk', '3.0') + from gi.repository import Gtk + dpi = str(Gtk.Settings.get_default().props.gtk_xft_dpi / 1024) xmodmapfile = self.__homedir + "/.xmodmap" xd = open(xmodmapfile, "w")