From patchwork Sun Sep 18 15:46:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Bigonville X-Patchwork-Id: 9337949 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 C6743601C2 for ; Sun, 18 Sep 2016 15:47:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8EC628AA2 for ; Sun, 18 Sep 2016 15:47:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC56B28AAD; Sun, 18 Sep 2016 15:47:49 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (emsm-gh1-uea10.nsa.gov [8.44.101.8]) (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 A5AC828AA2 for ; Sun, 18 Sep 2016 15:47:48 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.30,357,1470700800"; d="scan'208";a="17699989" IronPort-PHdr: =?us-ascii?q?9a23=3AT8mSABa7g69I8/7LIxVXOdb/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpcu/bnLW6fgltlLVR4KTs6sC0LuP9fC5Ej1YqdbZ6TZZIcQKD0dEwe?= =?us-ascii?q?wt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEt?= =?us-ascii?q?fre9JIfegoyN2vyo/NWLOkMT1WP7Meo5fU3+7V2I8JJH2c06cud54yCKi0MAQ/?= =?us-ascii?q?5Ry2JsKADbtDfHzeD0wqRe9T9Nsekq7c9KXPayVa05SbtFEGZuaDhtt4XWrx2L?= =?us-ascii?q?cS+jrjtZCz1XwVJ0BF3e4RX7WIrhmjfrvep6ni+BNIv5Sq5ndy6l6vJPQQLyhS?= =?us-ascii?q?EbfxQ4/2bRlM10iK8T9BigqBt564LZaoCcMrx5ZKyLLoBSfnZIQssED38JOYi7?= =?us-ascii?q?dYZaSrNZMA=3D=3D?= X-IPAS-Result: =?us-ascii?q?A2HXCQCHtt5X/wHyM5BdHAEBBAEBCgEBGAEFAQsBgn0SAQE?= =?us-ascii?q?BAQEegVOjLQUBAQEBAQEGlyklgXuECoE1TAEBAQEBAQEBAgECWyeCMgQDEwV5W?= =?us-ascii?q?0QCNwYBAQwgDAIDCQIXCCEICAMBLQsKHwsFGASIKQEDAbUXhTABAQWHWh0IhW2?= =?us-ascii?q?JNBEBNTOFEJl0j1IKiXyFbAKQXQJUgnKBenCEO3iBJwEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP; 18 Sep 2016 15:47:46 +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 u8IFkrRt030141; Sun, 18 Sep 2016 11:47:05 -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 u8IFkq6e019374 for ; Sun, 18 Sep 2016 11:46:52 -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 u8IFkp70030139 for ; Sun, 18 Sep 2016 11:46:51 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1BDCwDTtd5X/2OteVtdHBgNgxcSAQEBAQEegQxHoy0FAQEBAQEBBpMjhCaHP0wBAgEBAQEBAl4nhSgBATgvbTSISwMBtRaFMAEBBYd3CIVtii6FEJl0j1IKj2gCkF0CVIIwDIIwcIZaAQEB X-IPAS-Result: A1BDCwDTtd5X/2OteVtdHBgNgxcSAQEBAQEegQxHoy0FAQEBAQEBBpMjhCaHP0wBAgEBAQEBAl4nhSgBATgvbTSISwMBtRaFMAEBBYd3CIVtii6FEJl0j1IKj2gCkF0CVIIwDIIwcIZaAQEB X-IronPort-AV: E=Sophos;i="5.30,357,1470715200"; d="scan'208";a="5712275" 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; 18 Sep 2016 11:46:47 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3A6yOl0xXm/zb4tziZ5hUNX5jR2+XV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYZhKHt8tkgFKBZ4jH8fUM07OQ6PG5HzxZqsfZ+DBaKdoXBkdD0Z?= =?us-ascii?q?1X1yUbQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYn?= =?us-ascii?q?br+tQt2asc272qiI9oHJZE0Q3XzmMOo0fEz9/F2Z9pFPx9AzcuBpklqBi0ALUt?= =?us-ascii?q?we/XlvK1OXkkS0zeaL17knzR5tvek8/dVLS6TwcvdwZ7VZCDM7LzJ9v5Wz5lGQ?= =?us-ascii?q?BTeIs2ARVmQQjwpgHxnO7Ba8WIz49CT9qLlTwi6faOn/UKo5XyjqxaZkTxn2iS?= =?us-ascii?q?MDOnZt+mDYjcpYgK9RoRun4RtlzNiHM8muKPNic/aFLpshTm1bU5MJWg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0GcDACHtt5X/2OteVtdHBgNBQEBARUBA?= =?us-ascii?q?QEGAQMBAQGCahIBAQEBAR6BDEejLQUBAQEBAQEGkyOEJoIAhT9MAQEBAQEBAQE?= =?us-ascii?q?CAQJbJ4IyGIEAW4EDAQE4L200iEsDAbUXhTABAQWHdwiFbYouhRCZdI9SCo9oA?= =?us-ascii?q?pBdAlSCMAyCMHCGWgEBAQ?= X-IPAS-Result: =?us-ascii?q?A0GcDACHtt5X/2OteVtdHBgNBQEBARUBAQEGAQMBAQGCahI?= =?us-ascii?q?BAQEBAR6BDEejLQUBAQEBAQEGkyOEJoIAhT9MAQEBAQEBAQECAQJbJ4IyGIEAW?= =?us-ascii?q?4EDAQE4L200iEsDAbUXhTABAQWHdwiFbYouhRCZdI9SCo9oApBdAlSCMAyCMHC?= =?us-ascii?q?GWgEBAQ?= X-IronPort-AV: E=Sophos;i="5.30,357,1470700800"; d="scan'208";a="17699982" Received: from anor.bigon.be ([91.121.173.99]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2016 15:46:16 +0000 Received: from anor.bigon.be (localhost.localdomain [127.0.0.1]) by anor.bigon.be (Postfix) with ESMTP id 6BC4F1A1A8 for ; Sun, 18 Sep 2016 17:46:14 +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=1474213570; x=1476027971; bh=qK14V nOKZWAK0PBHnkA6K3JuExdRvpt9DcOTmYbPPKI=; b=tkGBqeaobObKDIT6U7y5v MsAtO/rHBM/uxhShAACr8xUgbg9xgqzuhreGpfQZAwDhUkry0zgOlOFgUN4vzewy hjMBYf7db+h+O/ggCLM/32t4QqEhAnAPOOfkQF2WQJDNCJ69/RqpSHgAxCmzL+Tz Ojq0hfSRtFgep4Tt7hJL2s= 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 Vawm5HxFbQ89 for ; Sun, 18 Sep 2016 17:46:10 +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 B588A1A06E for ; Sun, 18 Sep 2016 17:46:10 +0200 (CEST) Received: from bigon (uid 1000) (envelope-from bigon@bigon.be) id 3fdc1 by fornost.bigon.be (DragonFly Mail Agent v0.11); Sun, 18 Sep 2016 17:46:09 +0200 From: Laurent Bigonville To: selinux@tycho.nsa.gov Subject: [PATCH] sandbox: Use GObject introspection binding instead of pygtk2 Date: Sun, 18 Sep 2016 17:46:09 +0200 Message-Id: <20160918154609.8168-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: Laurent Bigonville sandbox command is also now using GTK 3.0 This patch comes from Fedora patch set --- 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")