diff options
Diffstat (limited to 'mvc/windows/autoupdate.py')
-rw-r--r-- | mvc/windows/autoupdate.py | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/mvc/windows/autoupdate.py b/mvc/windows/autoupdate.py index 8cb5f0a..6264912 100644 --- a/mvc/windows/autoupdate.py +++ b/mvc/windows/autoupdate.py @@ -1,6 +1,6 @@ # @Base: Miro - an RSS based video player application -# Copyright (C) 2012 -# Participatory Culture Foundation +# Copyright (C) 2017 +# Jesus E. # # 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 @@ -50,8 +50,8 @@ def enable_automatic_checks(): # but that's only available after version 0.4 and the current release # version is 0.4 with open_winsparkle_key() as winsparkle_key: - if not check_for_updates_set(winsparkle_key): - set_default_check_for_updates(winsparkle_key) + if not check_for_updates_set(winsparkle_key): + set_default_check_for_updates(winsparkle_key) def open_winsparkle_key(): """Open the MVC WinSparkle registry key @@ -59,37 +59,37 @@ def open_winsparkle_key(): If any components are not created yet, we will try to create them """ with open_or_create_key(winreg.HKEY_CURRENT_USER, "Software") as software: - with open_or_create_key(software, - "Participatory Culture Foundation") as pcf: - with open_or_create_key(pcf, "Libre Video Converter") as mvc: - return open_or_create_key(mvc, "WinSparkle", - write_access=True) + with open_or_create_key(software, + "Participatory Culture Foundation") as pcf: + with open_or_create_key(pcf, "Libre Video Converter") as mvc: + return open_or_create_key(mvc, "WinSparkle", + write_access=True) def open_or_create_key(key, subkey, write_access=False): if write_access: - sam = winreg.KEY_READ | winreg.KEY_WRITE + sam = winreg.KEY_READ | winreg.KEY_WRITE else: - sam = winreg.KEY_READ + sam = winreg.KEY_READ try: - return winreg.OpenKey(key, subkey, 0, sam) + return winreg.OpenKey(key, subkey, 0, sam) except OSError, e: - if e.errno == 2: - # Not Found error. We should create the key - return winreg.CreateKey(key, subkey) - else: - raise + if e.errno == 2: + # Not Found error. We should create the key + return winreg.CreateKey(key, subkey) + else: + raise def check_for_updates_set(winsparkle_key): try: - winreg.QueryValueEx(winsparkle_key, "CheckForUpdates") - except OSError, e: - if e.errno == 2: - # not found error. - return False - else: - raise - else: - return True + winreg.QueryValueEx(winsparkle_key, "CheckForUpdates") + except OSError, e: + if e.errno == 2: + # not found error. + return False + else: + raise + else: + return True def set_default_check_for_updates(winsparkle_key): |