aboutsummaryrefslogtreecommitdiffstats
path: root/lvc/windows/autoupdate.py
diff options
context:
space:
mode:
authorJesús Eduardo <heckyel@hyperbola.info>2018-01-17 12:53:01 -0500
committerJesús Eduardo <heckyel@hyperbola.info>2018-01-17 12:53:01 -0500
commit256202825029dd167bc704efaf8e187c2005965f (patch)
treed0d56f7b8616155aafeda797eaefd01559dc4a66 /lvc/windows/autoupdate.py
parentaab64d15fcba12f7dbdddb60500fc79237f5fe0e (diff)
downloadlibrevideoconverter-256202825029dd167bc704efaf8e187c2005965f.tar.lz
librevideoconverter-256202825029dd167bc704efaf8e187c2005965f.tar.xz
librevideoconverter-256202825029dd167bc704efaf8e187c2005965f.zip
pep8 en lvc/windows/autoupdate.py
Diffstat (limited to 'lvc/windows/autoupdate.py')
-rw-r--r--lvc/windows/autoupdate.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lvc/windows/autoupdate.py b/lvc/windows/autoupdate.py
index f6d47c8..834a45f 100644
--- a/lvc/windows/autoupdate.py
+++ b/lvc/windows/autoupdate.py
@@ -37,14 +37,17 @@ winsparkle = ctypes.cdll.WinSparkle
APPCAST_URL = 'http://miro-updates.participatoryculture.org/lvc-appcast.xml'
+
def startup():
enable_automatic_checks()
winsparkle.win_sparkle_set_appcast_url(APPCAST_URL)
winsparkle.win_sparkle_init()
+
def shutdown():
winsparkle.win_sparkle_cleanup()
+
def enable_automatic_checks():
# We should be able to use win_sparkle_set_automatic_check_for_updates,
# but that's only available after version 0.4 and the current release
@@ -53,6 +56,7 @@ def enable_automatic_checks():
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
@@ -65,6 +69,7 @@ def open_winsparkle_key():
return open_or_create_key(lvc, "WinSparkle",
write_access=True)
+
def open_or_create_key(key, subkey, write_access=False):
if write_access:
sam = winreg.KEY_READ | winreg.KEY_WRITE
@@ -79,6 +84,7 @@ def open_or_create_key(key, subkey, write_access=False):
else:
raise
+
def check_for_updates_set(winsparkle_key):
try:
winreg.QueryValueEx(winsparkle_key, "CheckForUpdates")