sya

split youtube audio tracks, with an optional pyqt gui
git clone git://src.gearsix.net/sya
Log | Files | Refs | Atom | README

commit 28deb2d1793bf4b6564457851ee27eaa479020d2
parent 0ea1d9aea88fbfa6d8998c4ec86459e0b7bb247c
Author: gearsix <gearsix@tuta.io>
Date:   Tue,  6 Dec 2022 23:31:50 +0000

bugfix: removed setText calls causing cursor to jump to end of linedit

It turned out it was uncessary anyway, also moved `generate_tracklist`
above classes with the rest of the functions

Diffstat:
Msya-pyqt.py | 21++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/sya-pyqt.py b/sya-pyqt.py @@ -64,6 +64,15 @@ def new_filepicker(parent, fn_select, fn_update, default_value='', icon=''): return layout, lineedit +def generate_tracklist(url, tracklist): + fd, fpath = tempfile.mkstemp() + with open(fd, 'w') as f: + f.write(url) + f.write('\n') + f.writelines(tracklist) + return fpath + + class SyaGuiThread(qtcore.QThread): def __init__(self, fn, fn_args=None): super().__init__() @@ -196,7 +205,6 @@ class SyaGuiOptions(qtwidg.QWidget): # callbacks def set_url(self, text): self.values['url'] = text - self.url.setText(text) self.update_ok() def set_tracklist(self): @@ -213,7 +221,6 @@ class SyaGuiOptions(qtwidg.QWidget): def set_output(self, text): self.values['output'] = text - self.output.setText(text) self.update_ok() def set_format(self, option): @@ -302,15 +309,6 @@ class SyaGuiLogger(qtwidg.QWidget): self.textbox.ensureCursorVisible() -def generate_tracklist(url, tracklist): - fd, fpath = tempfile.mkstemp() - with open(fd, 'w') as f: - f.write(url) - f.write('\n') - f.writelines(tracklist) - return fpath - - class SyaGui(qtwidg.QMainWindow): def __init__(self, fn_sya, fn_sya_args): super().__init__() @@ -387,6 +385,7 @@ class SyaGui(qtwidg.QMainWindow): self.running += 1 self.main_t.start() + if __name__ == '__main__': app = qtwidg.QApplication(sys.argv)