From 4731a59e62b09ee7224cf3fcb4b141a6e42cd87d Mon Sep 17 00:00:00 2001 From: Brent Huisman Date: Wed, 5 Dec 2018 14:28:34 +0100 Subject: [PATCH] v1.0.4: Gui mode is now shutdownable (threads dont keep running in the background anymore) --- README.md | 1 + par2deep/gui.py | 15 ++++++++++----- setup.py | 2 +- setup_cx.py | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ae1e933..cf8cc3e 100755 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Example `par2deep.ini`: ### Changelog + * 2018-12-05: v1.0.4: Gui mode is now shutdownable (threads dont keep running in the background anymore). * 2018-12-05: v1.0.3. Once again fixed imports. Should now work with local, pip-installed and bundled versions. Gui and cli now show filename during executing actions stage. * 2018-05-30: v1.0.2. GUI updates: file doubleclick now checkes if string is file, added tooltips to GUI settings, and treeview category headers have a bit for info (nb of files in category). CLI updates: same par2deep import check as GUI. * 2018-05-25: v1.0.1. Crossplatform doubleclick in treeview. Improved Windows par2 executable finding. New cx_Freeze installer script. Converted relative imports. diff --git a/par2deep/gui.py b/par2deep/gui.py index 1195365..eca18cb 100755 --- a/par2deep/gui.py +++ b/par2deep/gui.py @@ -9,6 +9,7 @@ except: from par2deep import * + class CreateToolTip(object): """ create a tooltip for a given widget. @@ -79,8 +80,8 @@ def __init__(self, master): #bottom bar shows actions self.new_window(self.topbar_frame(0), self.start_options_frame(), self.start_actions_frame()) return - - + + def startfile(self, fname): fname = os.path.normpath(fname) if os.path.isfile(fname): #otherwise its probably a category in the treeview @@ -190,7 +191,7 @@ def pickdir(): self.args["par_cmd"].pack(fill=X) self.args["par_cmd"].insert(0,self.p2d.args["par_cmd"]) CreateToolTip(self.args["par_cmd"],"Should be set automatically and correctly, but can be overriden.") - + Label(advset, text="Percentage of protection").pack(fill=X) self.args["percentage"] = IntVar() self.args["percentage"].set(self.p2d.args["percentage"]) @@ -289,6 +290,7 @@ def run(): #put p2d.len_all_err somewhere in label of final report self.cnt_stop = True thread = threading.Thread(target=run) + thread.daemon = True thread.start() def upd(): @@ -329,6 +331,7 @@ def run(): #put p2d.len_all_err somewhere in label of final report self.cnt_stop = True thread = threading.Thread(target=run) + thread.daemon = True thread.start() def upd(): @@ -372,6 +375,7 @@ def run(): } self.new_window(self.topbar_frame(1), self.scrollable_treeview_frame(dispdict), self.execute_actions_frame()) thread = threading.Thread(target=run) + thread.daemon = True thread.start() return @@ -399,6 +403,7 @@ def run(): self.new_window(self.topbar_frame(3), self.scrollable_treeview_frame(dispdict), self.repair_actions_frame()) self.cnt_stop = True thread = threading.Thread(target=run) + thread.daemon = True thread.start() def upd(): @@ -421,7 +426,7 @@ def scrollable_treeview_frame(self,nodes={}): ysb = Scrollbar(subframe, orient='vertical', command=tree.yview) ysb.pack(side="right", fill=Y, expand=False) - + def doubleclick_tree(event): self.startfile(tree.item(tree.selection()[0],"text")) return @@ -459,7 +464,7 @@ def main(): x = (ws/2) - (w/2) y = (hs/2) - (h/2) - # set the dimensions of the screen + # set the dimensions of the screen # and where it is placed root.geometry('%dx%d+%d+%d' % (w, h, x, y)) root.wm_title("par2deep") diff --git a/setup.py b/setup.py index 7861ef5..ba57c81 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #! /usr/bin/env python from setuptools import setup -VERSION = '1.0.3' +VERSION = '1.0.4' with open("README.md", "rb") as f: long_descr = f.read() diff --git a/setup_cx.py b/setup_cx.py index 885f932..fe6d94b 100755 --- a/setup_cx.py +++ b/setup_cx.py @@ -1,7 +1,7 @@ from cx_Freeze import setup, Executable import sys,os.path,glob -VERSION = '1.0.3' +VERSION = '1.0.4' NAME = 'par2deep' DESCRIPTION = "Produce, verify and repair par2 files recursively."