aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2019-02-27 10:20:34 -0700
committerMelody Horn <melody@boringcactus.com>2019-02-27 10:20:34 -0700
commita035e906cbe4a80bcf27e8c1b3aac322a6520414 (patch)
treef5f04f977cf6d3b852aaff6bc27deed45d47140d
parentac2eecf3965e8ca270cc9b9abf3d0210d70f49d1 (diff)
downloadvidslice-a035e906cbe4a80bcf27e8c1b3aac322a6520414.tar.gz
vidslice-a035e906cbe4a80bcf27e8c1b3aac322a6520414.zip
automatically check for updates
-rw-r--r--requirements.txt1
-rw-r--r--setup.py4
-rw-r--r--vidslice.py19
3 files changed, 22 insertions, 2 deletions
diff --git a/requirements.txt b/requirements.txt
index 3e4d57b..16a7ca2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
wxPython==4.0.4
cx_Freeze
+agithub
diff --git a/setup.py b/setup.py
index a65edaa..8e63656 100644
--- a/setup.py
+++ b/setup.py
@@ -6,6 +6,8 @@ buildOptions = dict(packages=[], excludes=[])
import sys
+from vidslice import VERSION
+
base = 'Win32GUI' if sys.platform == 'win32' else None
executables = [
@@ -13,7 +15,7 @@ executables = [
]
setup(name='vidslice',
- version='1.1',
+ version=VERSION,
description='',
options=dict(build_exe=buildOptions),
executables=executables)
diff --git a/vidslice.py b/vidslice.py
index b9dcae9..b9213e8 100644
--- a/vidslice.py
+++ b/vidslice.py
@@ -3,11 +3,27 @@ import sys
import wx
import wx.adv
+from agithub.GitHub import GitHub
from options import OptionsPanel
from output import OutputPanel
from sources import SourcesPanel, update_ytdl
+VERSION = "1.2"
+
+
+def check_update(parent):
+ client = GitHub()
+ status, data = client.repos.boringcactus.vidslice.releases.latest.get()
+ if status == 200:
+ newest_version = data['tag_name'].lstrip('v')
+ if VERSION != newest_version:
+ answer = wx.MessageBox("vidslice update available. download?", "Update", wx.YES_NO, parent)
+ if answer == wx.YES:
+ import webbrowser
+
+ webbrowser.open("https://github.com/boringcactus/vidslice/releases/latest")
+
def has_ffmpeg():
try:
@@ -109,7 +125,7 @@ class VidsliceFrame(wx.Frame):
"""Display an About Dialog"""
info = wx.adv.AboutDialogInfo()
info.SetName("vidslice")
- info.SetVersion("1.1")
+ info.SetVersion(VERSION)
info.SetDescription("video manipulator wrapping youtube-dl and ffmpeg")
info.SetWebSite("https://github.com/boringcactus/vidslice")
@@ -130,4 +146,5 @@ if __name__ == '__main__':
frm = VidsliceFrame(None, title='vidslice')
app.SetTopWindow(frm)
frm.Show()
+ check_update(frm)
app.MainLoop()