
---
 gtweak/app.py                                 |  2 +-
 gtweak/egowrapper.py                          |  6 +++---
 gtweak/gsettings.py                           | 18 +++++++++---------
 gtweak/gshellwrapper.py                       |  8 ++++----
 gtweak/tweakmodel.py                          |  2 +-
 gtweak/tweaks/tweak_group_interface.py        |  6 +++---
 gtweak/tweaks/tweak_group_shell.py            |  2 +-
 gtweak/tweaks/tweak_group_shell_extensions.py |  4 ++--
 gtweak/tweaks/tweak_group_startup.py          |  2 +-
 gtweak/tweaks/tweak_group_test.py             |  1 -
 gtweak/tweaks/tweak_wacom.py                  |  4 ++--
 gtweak/utils.py                               |  2 +-
 gtweak/widgets.py                             |  2 +-
 13 files changed, 29 insertions(+), 30 deletions(-)

diff --git a/gtweak/app.py b/gtweak/app.py
index 18ab1ed..ef1f263 100644
--- a/gtweak/app.py
+++ b/gtweak/app.py
@@ -82,7 +82,7 @@ class GnomeTweakTool(Gtk.Application):
         dialog.destroy()
             
     def help_cb(self, action, parameter):
-        print "This does nothing. It is only a demonstration."
+        print ("This does nothing. It is only a demonstration.")
 
     def disable_cb(self, action, parameter):
         ds = DisableExtension()
diff --git a/gtweak/egowrapper.py b/gtweak/egowrapper.py
index 24930e2..7e13424 100644
--- a/gtweak/egowrapper.py
+++ b/gtweak/egowrapper.py
@@ -42,7 +42,7 @@ class ExtensionsDotGnomeDotOrg(GObject.GObject):
         if msg.status_code == 200:
             #server returns a list of extensions which may contain duplicates, dont know
             resp = json.loads(msg.response_body.data)
-            print resp
+            print (resp)
             for e in resp["extensions"]:
                 self._extensions[e["uuid"]] = e
             self.emit("got-extensions", self._extensions)
@@ -74,7 +74,7 @@ class ExtensionsDotGnomeDotOrg(GObject.GObject):
 
     def query_extension_info(self, extension_uuid):
         if extension_uuid in self._extensions:
-            print "CACHED"
+            print ("CACHED")
             self.emit("got-extension-info", self._extensions[extension_uuid])
             return
 
@@ -95,7 +95,7 @@ if __name__ == "__main__":
     from gi.repository import Gtk, GLib
 
     def _got_ext(ego, extensions):
-        print "="*80
+        print ("="*80)
         pprint.pprint(extensions.values())
 
     def _got_ext_info(ego, extension):
diff --git a/gtweak/gsettings.py b/gtweak/gsettings.py
index 8815131..dc25de4 100644
--- a/gtweak/gsettings.py
+++ b/gtweak/gsettings.py
@@ -40,7 +40,7 @@ class _GSettingsSchema:
 
         schema_path = os.path.join(schema_dir, schema_filename)
         if not os.path.exists(schema_path):
-            logging.critical("Could not find schema %s" % schema_path)
+            logging.critical("Could not find schema {}".format(schema_path))
             assert(False)
 
         self._schema_name = schema_name
@@ -58,7 +58,7 @@ class _GSettingsSchema:
                     global_translation = gettext.NullTranslations()
             except IOError:
                 global_translation = None
-                logging.debug("No translated schema for %s (domain: %s)" % (schema_name, global_gettext_domain))
+                logging.debug("No translated schema for {} (domain: {})".format(schema_name, global_gettext_domain))
             for schema in dom.getElementsByTagName("schema"):
                 gettext_domain = schema.getAttribute('gettext-domain')
                 try:
@@ -68,7 +68,7 @@ class _GSettingsSchema:
                         translation = global_translation
                 except IOError:
                     translation = None
-                    logging.debug("Schema not translated %s (domain: %s)" % (schema_name, gettext_domain))
+                    logging.debug("Schema not translated {} (domain: {})".format(schema_name, gettext_domain))
                 if schema_name == schema.getAttribute("id"):
                     for key in schema.getElementsByTagName("key"):
                         name = key.getAttribute("name")
@@ -78,7 +78,7 @@ class _GSettingsSchema:
                             summary = key.getElementsByTagName("summary")[0].childNodes[0].data
                         except:
                             summary = ""
-                            logging.info("Schema missing summary %s (key %s)" % (os.path.basename(schema_path),name))
+                            logging.info("Schema missing summary {} (key {})".format(os.path.basename(schema_path),name))
                         try:
                             description = key.getElementsByTagName("description")[0].childNodes[0].data
                         except:
@@ -91,10 +91,10 @@ class _GSettingsSchema:
                         )
 
         except:
-            logging.critical("Error parsing schema %s (%s)" % (schema_name, schema_path), exc_info=True)
+            logging.critical("Error parsing schema {} ({})".format(schema_name, schema_path), exc_info=True)
 
     def __repr__(self):
-        return "<gtweak.gsettings._GSettingsSchema: %s>" % self._schema_name
+        return "<gtweak.gsettings._GSettingsSchema: {}>".format( self._schema_name)
 
 class GSettingsFakeSetting:
     def __init__(self):
@@ -138,7 +138,7 @@ class GSettingsSetting(Gio.Settings):
 
         if schema_name not in _SCHEMA_CACHE:
             _SCHEMA_CACHE[schema_name] = _GSettingsSchema(schema_name, schema_dir=schema_dir, **options)
-            logging.debug("Caching gsettings: %s" % _SCHEMA_CACHE[schema_name])
+            logging.debug("Caching gsettings: {}".format(_SCHEMA_CACHE[schema_name]))
 
         self._schema = _SCHEMA_CACHE[schema_name]
 
@@ -146,7 +146,7 @@ class GSettingsSetting(Gio.Settings):
             self.connect("changed", self._on_changed)
 
     def _on_changed(self, settings, key_name):
-        print "Change: %s %s -> %s" % (self.props.schema, key_name, self[key_name])
+        print("Change: {} {} -> {}".format(self.props.schema, key_name, self[key_name]))
 
     def _setting_check_is_list(self, key):
         variant = Gio.Settings.get_value(self, key)
@@ -193,7 +193,7 @@ if __name__ == "__main__":
 
     key = "draw-background"
     s = GSettingsSetting("org.gnome.desktop.background")
-    print s.schema_get_summary(key), s.schema_get_description(key)
+    print ("{} {}".format(s.schema_get_summary(key), s.schema_get_description(key)))
 
     key = "disabled-extensions"
     s = GSettingsSetting("org.gnome.shell")
diff --git a/gtweak/gshellwrapper.py b/gtweak/gshellwrapper.py
index ca7e7c0..884e284 100644
--- a/gtweak/gshellwrapper.py
+++ b/gtweak/gshellwrapper.py
@@ -172,7 +172,7 @@ class GnomeShellFactory:
         try:
             proxy = _ShellProxy()
             settings = GSettingsSetting("org.gnome.shell")
-            v = map(int,proxy.version.split("."))
+            v = list(map(int,proxy.version.split(".")))
 
             if v >= [3,5,0]:
                 self.shell = GnomeShell36(proxy, settings)
@@ -198,7 +198,7 @@ if __name__ == "__main__":
     logging.basicConfig(format="%(levelname)-8s: %(message)s", level=logging.DEBUG)
 
     s = GnomeShellFactory().get_shell()
-    print "Shell Version: %s" % s.version
-    print s.list_extensions()
+    print("Shell Version: {}".format(s.version))
+    print(s.list_extensions())
 
-    print s == GnomeShellFactory().get_shell()
+    print(s == GnomeShellFactory().get_shell())
diff --git a/gtweak/tweakmodel.py b/gtweak/tweakmodel.py
index cddecf8..907e26e 100644
--- a/gtweak/tweakmodel.py
+++ b/gtweak/tweakmodel.py
@@ -87,7 +87,7 @@ class TweakGroup(object):
 
 class TweakModel(Gtk.ListStore):
     (COLUMN_NAME,
-     COLUMN_TWEAK) = range(2)
+     COLUMN_TWEAK) = list(range(2))
 
     def __init__(self):
         super(TweakModel, self).__init__(str, object)
diff --git a/gtweak/tweaks/tweak_group_interface.py b/gtweak/tweaks/tweak_group_interface.py
index 6103432..f5bfae8 100644
--- a/gtweak/tweaks/tweak_group_interface.py
+++ b/gtweak/tweaks/tweak_group_interface.py
@@ -141,18 +141,18 @@ class ShellThemeTweak(Gtk.Box, Tweak):
                         name = self._settings.get_string(ShellThemeTweak.THEME_GSETTINGS_NAME)
 
                         ext = extensions[ShellThemeTweak.THEME_EXT_NAME]
-                        logging.debug("Shell user-theme extension\n%s" % pprint.pformat(ext))
+                        logging.debug("Shell user-theme extension\n{}".format(pprint.pformat(ext)))
 
                         error = None
                     except:
                         logging.warning(
-                            "Could not find user-theme extension in %s" % ','.join(extensions.keys()),
+                            "Could not find user-theme extension in {}".format(','.join(extensions.keys())),
                             exc_info=True)
                         error = _("Shell user-theme extension incorrectly installed")
 
                 else:
                     error = _("Shell user-theme extension not enabled")
-            except Exception, e:
+            except Exception as e:
                 logging.warning("Could not list shell extensions", exc_info=True)
                 error = _("Could not list shell extensions")
 
diff --git a/gtweak/tweaks/tweak_group_shell.py b/gtweak/tweaks/tweak_group_shell.py
index 9f3674a..a0016bd 100644
--- a/gtweak/tweaks/tweak_group_shell.py
+++ b/gtweak/tweaks/tweak_group_shell.py
@@ -46,7 +46,7 @@ class StaticWorkspaceTweak(Gtk.Box, _GSettingsTweak):
         Gtk.Box.__init__(self, orientation=Gtk.Orientation.HORIZONTAL)
         _GSettingsTweak.__init__(self, name, "org.gnome.mutter", "dynamic-workspaces", **options)
 
-        default = self.STATUS.keys()[self.STATUS.values().index(self.settings[self.key_name])]
+        default = list(self.STATUS.keys())[list(self.STATUS.values()).index(self.settings[self.key_name])]
         key_options = [("dynamic", _("Dynamic")), ("static", _("Static"))]
 
         self.combo = build_combo_box_text(default, *key_options)
diff --git a/gtweak/tweaks/tweak_group_shell_extensions.py b/gtweak/tweaks/tweak_group_shell_extensions.py
index ba82bf7..b2129aa 100644
--- a/gtweak/tweaks/tweak_group_shell_extensions.py
+++ b/gtweak/tweaks/tweak_group_shell_extensions.py
@@ -167,7 +167,7 @@ class _ShellExtensionTweak(Gtk.ListBoxRow, Tweak):
 
     def error_handler(self, proxy_object, result, user_data):
         user_data.set_label(_("Error"))
-        print result
+        print(result)
 
     def add_update_button(self, uuid):
         self.deleteButton.hide()
@@ -281,7 +281,7 @@ class ShellExtensionTweakGroup(ListBoxTweakGroup):
             ego = ExtensionsDotGnomeDotOrg(version)
             try:
                 #add a tweak for each installed extension
-                extensions = sorted(shell.list_extensions().values(), key=itemgetter("name"))
+                extensions = sorted(list(shell.list_extensions().values()), key=itemgetter("name"))
                 for extension in extensions:
                     try:
                         extension_widget = _ShellExtensionTweak(shell, extension, size_group=sg)
diff --git a/gtweak/tweaks/tweak_group_startup.py b/gtweak/tweaks/tweak_group_startup.py
index aef9cd0..37a506f 100644
--- a/gtweak/tweaks/tweak_group_startup.py
+++ b/gtweak/tweaks/tweak_group_startup.py
@@ -14,7 +14,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with gnome-tweak-tool.  If not, see <http://www.gnu.org/licenses/>.
-from __future__ import print_function
+
 
 import os.path
 import subprocess
diff --git a/gtweak/tweaks/tweak_group_test.py b/gtweak/tweaks/tweak_group_test.py
index 54d4afa..85df801 100644
--- a/gtweak/tweaks/tweak_group_test.py
+++ b/gtweak/tweaks/tweak_group_test.py
@@ -16,7 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with gnome-tweak-tool.  If not, see <http://www.gnu.org/licenses/>.
 
-from __future__ import print_function
 
 from gi.repository import Gtk, Gdk
 
diff --git a/gtweak/tweaks/tweak_wacom.py b/gtweak/tweaks/tweak_wacom.py
index 72ac36e..52259bc 100644
--- a/gtweak/tweaks/tweak_wacom.py
+++ b/gtweak/tweaks/tweak_wacom.py
@@ -19,7 +19,7 @@
 from gtweak.tweakmodel import TweakGroup
 from gtweak.widgets import GSettingsSwitchTweak
 import subprocess
-import ConfigParser
+import configParser
 import io
 
 def N_(x): return x
@@ -104,7 +104,7 @@ class WacomConfigs(object):
         return configs_dict.values()
 
     def _text_to_config(self, text):
-        config = ConfigParser.RawConfigParser(allow_no_value=True)
+        config = configParser.RawConfigParser(allow_no_value=True)
         config.readfp(io.BytesIO(text))
         return config
 
diff --git a/gtweak/utils.py b/gtweak/utils.py
index 3d20425..c3907c8 100644
--- a/gtweak/utils.py
+++ b/gtweak/utils.py
@@ -244,7 +244,7 @@ class XSettingsOverrides:
 
     def _dup_variant_as_dict(self):
         items = {}
-        for k in self._variant.keys():
+        for k in list(self._variant.keys()):
             try:
                 #variant override doesnt support .items()
                 v = self._variant[k]
diff --git a/gtweak/widgets.py b/gtweak/widgets.py
index fb016fe..8cef494 100644
--- a/gtweak/widgets.py
+++ b/gtweak/widgets.py
@@ -160,7 +160,7 @@ class _GSettingsTweak(Tweak):
                 name,
                 options.get("description",self.settings.schema_get_description(key_name)),
                 **options)
-        except GSettingsMissingError, e:
+        except GSettingsMissingError as e:
             self.settings = GSettingsFakeSetting()
             Tweak.__init__(self,"","")
             self.loaded = False
-- 
2.1.3


From 250164c6dd21f0e859d5b6bb4319506f36d7b41a Mon Sep 17 00:00:00 2001
From: alex <devkral@web.de>
Date: Sun, 16 Nov 2014 20:59:21 +0100
Subject: [PATCH 2/2] explicitly specify python version

---
 gnome-tweak-tool | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnome-tweak-tool b/gnome-tweak-tool
index a47fa5c..99d2a7a 100755
--- a/gnome-tweak-tool
+++ b/gnome-tweak-tool
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-- 
2.1.3

