Blame SOURCES/port-to-python2.patch

fafad5
From 1bda0910b4d8b05dfa94732d4bb0795621d4970f Mon Sep 17 00:00:00 2001
044818
From: Carlos Soriano <csoriano@redhat.com>
044818
Date: Thu, 14 Jun 2018 11:51:06 +0200
fafad5
Subject: [PATCH 2/3] general: Port to python2
044818
044818
RHEL 7.6 doesn't have python3...
044818
---
044818
 gnome-tweak-tool-lid-inhibitor                |  2 +-
044818
 gnome-tweaks                                  |  2 +-
044818
 gtweak/app.py                                 |  1 +
044818
 gtweak/egowrapper.py                          |  1 +
044818
 gtweak/gsettings.py                           |  1 +
044818
 gtweak/gshellwrapper.py                       |  3 ++-
044818
 gtweak/gtksettings.py                         | 13 +++++++++++--
044818
 gtweak/tweakmodel.py                          |  5 +++--
044818
 gtweak/tweaks/tweak_group_appearance.py       |  1 +
044818
 gtweak/tweaks/tweak_group_desktop.py          |  1 +
044818
 gtweak/tweaks/tweak_group_font.py             |  1 +
044818
 gtweak/tweaks/tweak_group_keymouse.py         |  1 +
044818
 gtweak/tweaks/tweak_group_power.py            |  1 +
044818
 gtweak/tweaks/tweak_group_shell_extensions.py |  5 +++--
044818
 gtweak/tweaks/tweak_group_sound.py            |  1 +
044818
 gtweak/tweaks/tweak_group_startup.py          |  5 ++++-
044818
 gtweak/tweaks/tweak_group_test.py             |  3 +++
044818
 gtweak/tweaks/tweak_group_top_bar.py          |  3 ++-
044818
 gtweak/tweaks/tweak_group_windows.py          |  1 +
044818
 gtweak/tweaks/tweak_group_workspaces.py       |  3 ++-
fafad5
 gtweak/tweaks/tweak_group_xkb.py              |  5 +++--
044818
 gtweak/tweaks/tweak_wacom.py                  |  9 +++++----
044818
 gtweak/tweakview.py                           |  5 +++--
044818
 gtweak/utils.py                               | 11 ++++++++---
044818
 gtweak/widgets.py                             |  1 +
044818
 meson-postinstall.py                          |  4 ++--
044818
 meson.build                                   |  3 +--
fafad5
 27 files changed, 65 insertions(+), 27 deletions(-)
044818
044818
diff --git a/gnome-tweak-tool-lid-inhibitor b/gnome-tweak-tool-lid-inhibitor
044818
index f9d18db..499e9eb 100755
044818
--- a/gnome-tweak-tool-lid-inhibitor
044818
+++ b/gnome-tweak-tool-lid-inhibitor
044818
@@ -1,4 +1,4 @@
044818
-#!/usr/bin/env python3
044818
+#!/usr/bin/env python
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
 
044818
diff --git a/gnome-tweaks b/gnome-tweaks
044818
index 596d8ab..038bb9d 100755
044818
--- a/gnome-tweaks
044818
+++ b/gnome-tweaks
044818
@@ -1,4 +1,4 @@
044818
-#!/usr/bin/env python3
044818
+#!/usr/bin/env python
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
 
044818
diff --git a/gtweak/app.py b/gtweak/app.py
044818
index bc5b5f4..03dc99d 100644
044818
--- a/gtweak/app.py
044818
+++ b/gtweak/app.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/egowrapper.py b/gtweak/egowrapper.py
044818
index 7a60f71..11caee3 100644
044818
--- a/gtweak/egowrapper.py
044818
+++ b/gtweak/egowrapper.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/gsettings.py b/gtweak/gsettings.py
044818
index e0116e9..96d58e3 100644
044818
--- a/gtweak/gsettings.py
044818
+++ b/gtweak/gsettings.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/gshellwrapper.py b/gtweak/gshellwrapper.py
044818
index 0e4a49b..d654f88 100644
044818
--- a/gtweak/gshellwrapper.py
044818
+++ b/gtweak/gshellwrapper.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
@@ -164,7 +165,7 @@ class GnomeShellFactory:
044818
         try:
044818
             proxy = _ShellProxy()
044818
             settings = GSettingsSetting("org.gnome.shell")
044818
-            v = list(map(int, proxy.version.split(".")))
044818
+            v = map(int, proxy.version.split("."))
044818
 
044818
             if v >= [3, 5, 0]:
044818
                 self.shell = GnomeShell36(proxy, settings)
044818
diff --git a/gtweak/gtksettings.py b/gtweak/gtksettings.py
044818
index ce09842..8d557b2 100644
044818
--- a/gtweak/gtksettings.py
044818
+++ b/gtweak/gtksettings.py
044818
@@ -1,9 +1,11 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2012 Cosimo Cecchi
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
 
044818
 import os.path
044818
 import logging
044818
+import errno
044818
 
044818
 from gi.repository import GLib
044818
 
044818
@@ -18,7 +20,14 @@ class GtkSettingsManager:
044818
         self._path = os.path.join(GLib.get_user_config_dir(),
044818
                                   "gtk-" + version,
044818
                                   "settings.ini")
044818
-        os.makedirs(os.path.dirname(self._path), exist_ok=True)
044818
+        try:
044818
+            os.makedirs(os.path.dirname(self._path))
044818
+        except OSError, e:
044818
+            if e.errno is not errno.EEXIST:
044818
+                raise
044818
+        except:
044818
+            raise
044818
+
044818
 
044818
     def _get_keyfile(self):
044818
         keyfile = None
044818
@@ -47,4 +56,4 @@ class GtkSettingsManager:
044818
             data = keyfile.to_data()
044818
             GLib.file_set_contents(self._path, data[0].encode())
044818
         except:
044818
-            raise
044818
+            raise
044818
\ No newline at end of file
044818
diff --git a/gtweak/tweakmodel.py b/gtweak/tweakmodel.py
044818
index 2e9fb16..f8a9c18 100644
044818
--- a/gtweak/tweakmodel.py
044818
+++ b/gtweak/tweakmodel.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
@@ -66,7 +67,7 @@ class TweakGroup(object):
044818
 
044818
 class TweakModel(Gtk.ListStore):
044818
     (COLUMN_NAME,
044818
-     COLUMN_TWEAK) = list(range(2))
044818
+     COLUMN_TWEAK) = range(2)
044818
 
044818
     def __init__(self):
044818
         super(TweakModel, self).__init__(str, object)
044818
@@ -140,4 +141,4 @@ class TweakModel(Gtk.ListStore):
044818
         return tweaks, groups
044818
 
044818
     def get_tweakgroup_iter(self, name):
044818
-        return self._tweak_group_iters[name]
044818
+        return self._tweak_group_iters[name]
044818
\ No newline at end of file
044818
diff --git a/gtweak/tweaks/tweak_group_appearance.py b/gtweak/tweaks/tweak_group_appearance.py
044818
index ff78735..e8b40a7 100644
044818
--- a/gtweak/tweaks/tweak_group_appearance.py
044818
+++ b/gtweak/tweaks/tweak_group_appearance.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/tweaks/tweak_group_desktop.py b/gtweak/tweaks/tweak_group_desktop.py
044818
index f55c696..d7239bd 100644
044818
--- a/gtweak/tweaks/tweak_group_desktop.py
044818
+++ b/gtweak/tweaks/tweak_group_desktop.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/tweaks/tweak_group_font.py b/gtweak/tweaks/tweak_group_font.py
044818
index 43f4d09..89986b6 100644
044818
--- a/gtweak/tweaks/tweak_group_font.py
044818
+++ b/gtweak/tweaks/tweak_group_font.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/tweaks/tweak_group_keymouse.py b/gtweak/tweaks/tweak_group_keymouse.py
044818
index 577d5cc..9553566 100644
044818
--- a/gtweak/tweaks/tweak_group_keymouse.py
044818
+++ b/gtweak/tweaks/tweak_group_keymouse.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/tweaks/tweak_group_power.py b/gtweak/tweaks/tweak_group_power.py
044818
index 305877f..b6c82c5 100644
044818
--- a/gtweak/tweaks/tweak_group_power.py
044818
+++ b/gtweak/tweaks/tweak_group_power.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/tweaks/tweak_group_shell_extensions.py b/gtweak/tweaks/tweak_group_shell_extensions.py
044818
index 8ef4bf8..82c754b 100644
044818
--- a/gtweak/tweaks/tweak_group_shell_extensions.py
044818
+++ b/gtweak/tweaks/tweak_group_shell_extensions.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
 
044818
@@ -219,7 +220,7 @@ class ShellExtensionTweakGroup(ListBoxTweakGroup):
044818
             ego = ExtensionsDotGnomeDotOrg(version)
044818
             try:
044818
                 #add a tweak for each installed extension
044818
-                extensions = sorted(list(shell.list_extensions().values()), key=itemgetter("name"))
044818
+                extensions = sorted(shell.list_extensions().values(), key=itemgetter("name"))
044818
                 for extension in extensions:
044818
                     try:
044818
                         extension_widget = _ShellExtensionTweak(shell, extension, size_group=sg)
044818
@@ -280,4 +281,4 @@ class ShellExtensionTweakGroup(ListBoxTweakGroup):
044818
 
044818
 TWEAK_GROUPS = [
044818
         ShellExtensionTweakGroup(),
044818
-]
044818
+]
044818
\ No newline at end of file
044818
diff --git a/gtweak/tweaks/tweak_group_sound.py b/gtweak/tweaks/tweak_group_sound.py
044818
index 78705ef..cd35f58 100644
044818
--- a/gtweak/tweaks/tweak_group_sound.py
044818
+++ b/gtweak/tweaks/tweak_group_sound.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2017 Canonical
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/tweaks/tweak_group_startup.py b/gtweak/tweaks/tweak_group_startup.py
044818
index 05f7022..ba1288c 100644
044818
--- a/gtweak/tweaks/tweak_group_startup.py
044818
+++ b/gtweak/tweaks/tweak_group_startup.py
044818
@@ -1,7 +1,10 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
 
044818
+from __future__ import print_function
044818
+
044818
 import os.path
044818
 import subprocess
044818
 import logging
044818
@@ -339,7 +342,7 @@ class AutostartListBoxTweakGroup(ListBoxTweakGroup):
044818
                     str(os.getuid()),'-o','cmd'],
044818
                     stdout=subprocess.PIPE)
044818
         out = cmd.communicate()[0]
044818
-        for l in out.decode('utf8').split('\n'):
044818
+        for l in out.split('\n'):
044818
             exe = l.split(' ')[0]
044818
             if exe and exe[0] != '[': #kernel process
044818
                 exes.append( os.path.basename(exe) )
044818
diff --git a/gtweak/tweaks/tweak_group_test.py b/gtweak/tweaks/tweak_group_test.py
044818
index f056111..004815b 100644
044818
--- a/gtweak/tweaks/tweak_group_test.py
044818
+++ b/gtweak/tweaks/tweak_group_test.py
044818
@@ -1,7 +1,10 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
 
044818
+from __future__ import print_function
044818
+
044818
 from gi.repository import Gtk, Gdk
044818
 
044818
 from gtweak.tweakmodel import Tweak
044818
diff --git a/gtweak/tweaks/tweak_group_top_bar.py b/gtweak/tweaks/tweak_group_top_bar.py
044818
index 0979720..05a3d31 100644
044818
--- a/gtweak/tweaks/tweak_group_top_bar.py
044818
+++ b/gtweak/tweaks/tweak_group_top_bar.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
@@ -10,7 +11,7 @@ from gtweak.utils import XSettingsOverrides
044818
 _shell = GnomeShellFactory().get_shell()
044818
 _shell_loaded = _shell is not None
044818
 
044818
-class ApplicationMenuTweak(GetterSetterSwitchTweak):
044818
+class ApplicationMenuTweak(GetterSetterSwitchTweak,  _GSettingsTweak):
044818
     def __init__(self, **options):
044818
         self._xsettings = XSettingsOverrides()
044818
         name = _("Application Menu")
044818
diff --git a/gtweak/tweaks/tweak_group_windows.py b/gtweak/tweaks/tweak_group_windows.py
044818
index 3ac8964..0743689 100644
044818
--- a/gtweak/tweaks/tweak_group_windows.py
044818
+++ b/gtweak/tweaks/tweak_group_windows.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/gtweak/tweaks/tweak_group_workspaces.py b/gtweak/tweaks/tweak_group_workspaces.py
044818
index 1805861..dd28b4c 100644
044818
--- a/gtweak/tweaks/tweak_group_workspaces.py
044818
+++ b/gtweak/tweaks/tweak_group_workspaces.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
@@ -89,7 +90,7 @@ class StaticWorkspaceTweak(Gtk.ListBox, _GSettingsTweak):
044818
             self.check1.hide()
044818
             self.check2.show()
044818
 
044818
-class PrimaryWorkspaceTweak(Gtk.ListBox, Tweak):
044818
+class PrimaryWorkspaceTweak(Gtk.ListBox,  _GSettingsTweak):
044818
 
044818
     def __init__(self, **options):
044818
         name = _("Workspaces")
044818
diff --git a/gtweak/tweaks/tweak_group_xkb.py b/gtweak/tweaks/tweak_group_xkb.py
fafad5
index 9cb3670..659b08a 100644
044818
--- a/gtweak/tweaks/tweak_group_xkb.py
044818
+++ b/gtweak/tweaks/tweak_group_xkb.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2012 Red Hat, Inc.
044818
 # Authors:
044818
 #       Rui Matos
044818
@@ -117,7 +118,7 @@ class _XkbOption(Gtk.Expander, Tweak):
044818
                 if w:
044818
                     _set_active(w, True)
044818
         else:
044818
-            for w in list(self._widgets.values()):
044818
+            for w in self._widgets.values():
044818
                 if w._val in self._values:
044818
                     _set_active(w, True)
044818
                 else:
fafad5
@@ -134,7 +135,7 @@ class _XkbOption(Gtk.Expander, Tweak):
fafad5
         elif active and not w._val in self._values and w._val:
fafad5
             self._parent_settings.setting_add_to_list(TypingTweakGroup.XKB_GSETTINGS_NAME, w._val)
fafad5
 
fafad5
-class TypingTweakGroup(Gtk.Box):
fafad5
+class TypingTweakGroup(Gtk.Box, TweakGroup):
fafad5
 
fafad5
     XKB_GSETTINGS_SCHEMA = "org.gnome.desktop.input-sources"
fafad5
     XKB_GSETTINGS_NAME = "xkb-options"
044818
diff --git a/gtweak/tweaks/tweak_wacom.py b/gtweak/tweaks/tweak_wacom.py
044818
index ed227ca..2e89246 100644
044818
--- a/gtweak/tweaks/tweak_wacom.py
044818
+++ b/gtweak/tweaks/tweak_wacom.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2013 Red Hat, Inc.
044818
 # Author: Joaquim Rocha <jrocha@redhat.com>
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
@@ -6,7 +7,7 @@
044818
 from gtweak.tweakmodel import TweakGroup
044818
 from gtweak.widgets import GSettingsSwitchTweak
044818
 import subprocess
044818
-import configparser
044818
+import ConfigParser
044818
 import io
044818
 
044818
 def N_(x): return x
044818
@@ -88,10 +89,10 @@ class WacomConfigs(object):
044818
                 match_id = config.get(DEVICE_SECTION, DEVICE_MATCH_LINE)
044818
                 # Use a dict to discard possible repeated devices
044818
                 configs_dict[match_id] = config
044818
-        return list(configs_dict.values())
044818
+        return configs_dict.values()
044818
 
044818
     def _text_to_config(self, text):
044818
-        config = configparser.RawConfigParser(allow_no_value=True)
044818
+        config = ConfigParser.RawConfigParser(allow_no_value=True)
044818
         config.readfp(io.BytesIO(text))
044818
         return config
044818
 
044818
@@ -108,4 +109,4 @@ class WacomSwitchTweak(GSettingsSwitchTweak):
044818
                                       **options)
044818
 wg = WacomGroup()
044818
 if wg.tweaks:
044818
-    TWEAK_GROUPS = (wg,)
044818
+    TWEAK_GROUPS = (wg,)
044818
\ No newline at end of file
044818
diff --git a/gtweak/tweakview.py b/gtweak/tweakview.py
044818
index a130fea..6c640ba 100644
044818
--- a/gtweak/tweakview.py
044818
+++ b/gtweak/tweakview.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
@@ -157,7 +158,7 @@ class Window(Gtk.ApplicationWindow):
044818
             row.add(lbl)
044818
             return row
044818
 
044818
-        groups = list(self._model._tweak_group_names.keys())
044818
+        groups = self._model._tweak_group_names.keys()
044818
         groups = sorted(groups)
044818
 
044818
         for g in groups:
044818
@@ -263,4 +264,4 @@ class Window(Gtk.ApplicationWindow):
044818
             if t in tweaks:
044818
                 t.show_all()
044818
             else:
044818
-                t.hide()
044818
+                t.hide()
044818
\ No newline at end of file
044818
diff --git a/gtweak/utils.py b/gtweak/utils.py
044818
index 6f0c25c..258acf4 100644
044818
--- a/gtweak/utils.py
044818
+++ b/gtweak/utils.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
@@ -161,7 +162,11 @@ class AutostartFile:
044818
             self._extra_exec_args = "\n"
044818
 
044818
         user_autostart_dir = os.path.join(GLib.get_user_config_dir(), "autostart")
044818
-        os.makedirs(user_autostart_dir, exist_ok=True)
044818
+        if not os.path.isdir(user_autostart_dir):
044818
+            try:
044818
+                os.makedirs(user_autostart_dir)
044818
+            except:
044818
+                logging.critical("Could not create autostart dir: %s" % user_autostart_dir)
044818
 
044818
         self._user_autostart_file = os.path.join(user_autostart_dir, self._autostart_desktop_filename)
044818
 
044818
@@ -269,7 +274,7 @@ class XSettingsOverrides:
044818
 
044818
     def _dup_variant_as_dict(self):
044818
         items = {}
044818
-        for k in list(self._variant.keys()):
044818
+        for k in self._variant.keys():
044818
             try:
044818
                 #variant override doesnt support .items()
044818
                 v = self._variant[k]
044818
@@ -352,4 +357,4 @@ class LogoutNotification:
044818
                        '/org/gnome/SessionManager',
044818
                        'org.gnome.SessionManager',
044818
                        None)
044818
-        proxy.Logout('(u)', 0)
044818
+        proxy.Logout('(u)', 0)
044818
\ No newline at end of file
044818
diff --git a/gtweak/widgets.py b/gtweak/widgets.py
044818
index 3d48a51..11cd557 100644
044818
--- a/gtweak/widgets.py
044818
+++ b/gtweak/widgets.py
044818
@@ -1,3 +1,4 @@
044818
+# -*- coding: utf-8 -*-
044818
 # Copyright (c) 2011 John Stowers
044818
 # SPDX-License-Identifier: GPL-3.0+
044818
 # License-Filename: LICENSES/GPL-3.0
044818
diff --git a/meson-postinstall.py b/meson-postinstall.py
044818
index 115d8e0..3b41cc4 100755
044818
--- a/meson-postinstall.py
044818
+++ b/meson-postinstall.py
044818
@@ -1,4 +1,4 @@
044818
-#!/usr/bin/env python3
044818
+#!/usr/bin/env python
044818
 
044818
 import sysconfig
044818
 from compileall import compile_dir
044818
@@ -16,4 +16,4 @@ if not destdir:
044818
 
044818
 print('Compiling python bytecode...')
044818
 moduledir = sysconfig.get_path('purelib', vars={'base': str(prefix)})
044818
-compile_dir(destdir + path.join(moduledir, 'gtweak'), optimize=2)
044818
+compile_dir(destdir + path.join(moduledir, 'gtweak'))
044818
diff --git a/meson.build b/meson.build
044818
index 4d24fa5..f5ea92d 100644
044818
--- a/meson.build
044818
+++ b/meson.build
044818
@@ -5,7 +5,6 @@ project('gnome-tweaks',
044818
 
044818
 gnome = import('gnome')
044818
 i18n = import('i18n')
044818
-python3 = import('python3')
044818
 
044818
 prefix = get_option('prefix')
044818
 
044818
@@ -13,7 +12,7 @@ bindir = join_paths(prefix, get_option('bindir'))
044818
 datadir = join_paths(prefix, get_option('datadir'))
044818
 libexecdir = join_paths(prefix, get_option('libexecdir'))
044818
 localedir = join_paths(prefix, get_option('localedir'))
044818
-pythondir = join_paths(prefix, python3.sysconfig_path('purelib'))
044818
+pythondir = join_paths(prefix, '/usr/lib/python2.7/site-packages')
044818
 
044818
 pkgdatadir = join_paths(datadir, meson.project_name())
044818
 
fafad5
-- 
fafad5
2.17.0
044818