[gnome-tweak-tool/gnome-3-10] fix extension update checks for 3.10
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool/gnome-3-10] fix extension update checks for 3.10
- Date: Sat, 5 Oct 2013 18:37:34 +0000 (UTC)
commit c8abc8d8f23b74a0c5e5fd01da9e1a1efb6c43ee
Author: John Stowers <john stowers gmail com>
Date: Sat Oct 5 20:28:50 2013 +0200
fix extension update checks for 3.10
gtweak/tweaks/tweak_group_shell_extensions.py | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_shell_extensions.py b/gtweak/tweaks/tweak_group_shell_extensions.py
index 237917d..58018ce 100644
--- a/gtweak/tweaks/tweak_group_shell_extensions.py
+++ b/gtweak/tweaks/tweak_group_shell_extensions.py
@@ -18,6 +18,17 @@ from gtweak.utils import DisableExtension
def N_(x): return x
+def _fix_shell_version_for_ego(version):
+ #extensions.gnome.org uses a weird versioning system,
+ #3.10.0 is 3.10, 3.10.0.x (x is ignored)
+ #drop the pico? release
+ version = '.'.join(version.split('.')[0:3])
+ if version[-1] == '0':
+ #if it is .0, drop that too
+ return '.'.join(version.split('.')[0:2])
+ else:
+ return version
+
class _ShellExtensionTweak(Gtk.ListBoxRow, Tweak):
def __init__(self, shell, ext, **options):
@@ -305,14 +316,15 @@ class ShellExtensionTweakGroup(ListBoxTweakGroup):
if uuid == extension["uuid"]:
resp = resp['shell_version_map']
shell = GnomeShellFactory().get_shell()
- version = shell.version[0:3]
+ version = _fix_shell_version_for_ego(shell.version)
try:
resp = resp[version]
if int(resp["version"]) > extension["version"]:
widget.add_update_button(uuid)
except KeyError:
- print "Older/Unknown Version"
+ logging.info("e.g.o no updates for %s (shell version %s extension version %s)" % (
+ uuid,version,extension["version"]))
def _list_header_func(self, row, before, user_data):
if before and not row.get_header():
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]