-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split code, proper ffmpeg path setup on windows
- Loading branch information
1 parent
264136a
commit 42132f0
Showing
22 changed files
with
924 additions
and
833 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
|
||
import sys | ||
from PyQt5.QtWidgets import QApplication | ||
from gui.mainui import MainWindow | ||
from gui.minidialog import MiniDialog | ||
from runtimedata import get_logger | ||
|
||
if __name__ == '__main__': | ||
logger = get_logger('__init__') | ||
logger.info('Starting application in \n3\n2\n1') | ||
app = QApplication(sys.argv) | ||
_dialog = MiniDialog() | ||
window = MainWindow(_dialog) | ||
app.exec_() | ||
logger.info('Good bye ..') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
@echo off | ||
echo "========= OnTheSpot Windows Build Script ===========" | ||
echo " => Cleaning up !" | ||
echo ========= OnTheSpot Windows Build Script =========== | ||
echo =^> Cleaning up !" | ||
rmdir build /s /q | ||
rmdir dist /s /q | ||
rmdir __pycache__ /s /q | ||
rmdir venvwin /s /q | ||
if exist dist\onthespot_win.exe ( | ||
del /F /Q /A dist\onthespot_win.exe | ||
) | ||
echo " => Creating virtual env." | ||
echo =^> Creating virtual env. | ||
python.exe -m venv venvwin | ||
echo " => Switching to virtual env." | ||
echo " => Now run phase 2 script 'build_winC2.bat' " | ||
echo =^> Switching to virtual env. | ||
echo =^> Now run phase 2 script 'build_winC2.bat' | ||
venvwin\Scripts\activate.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
@echo off | ||
echo => Installing 'pyinstaller' via pip... | ||
echo =^> Installing 'pyinstaller' via pip... | ||
pip install --upgrade pip | ||
pip install wheel | ||
pip install pyinstaller | ||
echo => Installing dependencies pip... | ||
echo =^> Installing dependencies pip... | ||
pip install winsdk | ||
pip install simpleaudio | ||
pip install -r requirements.txt | ||
if exist ffbin_win\ffmpeg.exe ( | ||
echo " => Found 'ffbin_win' directory and ffmpeg binary.. Using ffmpeg binary append mode " | ||
pyinstaller --onefile --noconfirm --hidden-import simpleaudio --add-binary="ffbin_win/*.exe;bin/ffmpeg" --add-data="ui/*.ui;ui" --paths="." --name="onthespot_win" onthespot.py | ||
echo =^> Found 'ffbin_win' directory and ffmpeg binary.. Using ffmpeg binary append mode | ||
pyinstaller --onefile --noconfirm --hidden-import simpleaudio --add-binary="ffbin_win/*.exe;bin/ffmpeg" --add-data="gui/qtui/*.ui;gui/qtui" --paths="." --name="onthespot_win" __init__.py | ||
) else ( | ||
echo => Building to use ffmpeg binary from system... | ||
pyinstaller --onefile --noconfirm --hidden-import simpleaudio --add-data="ui/*.ui;ui" --paths="." --name="onthespot_win" onthespot.py | ||
echo =^> Building to use ffmpeg binary from system... | ||
pyinstaller --onefile --noconfirm --hidden-import simpleaudio --add-data="gui/qtui/*.ui;gui/qtui" --paths="." --name="onthespot_win" __init__.py | ||
) | ||
echo => Cleaning.. | ||
echo =^> Cleaning.. | ||
del /F /Q /A onthespot_win.spec | ||
rmdir build /s /q | ||
rmdir __pycache__ /s /q | ||
echo => Done | ||
echo =^> Done |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import os | ||
from PyQt5.QtWidgets import QHBoxLayout, QWidget | ||
from runtimedata import downloaded_data, cancel_list, failed_downloads, downloads_status, download_queue | ||
from showinfm import show_in_file_manager | ||
|
||
|
||
class DownloadActionsButtons(QWidget): | ||
def __init__(self, dl_id, pbar, cancel_btn, remove_btn, locate_btn, parent=None): | ||
super(DownloadActionsButtons, self).__init__(parent) | ||
self.__id = dl_id | ||
self.cancel_btn = cancel_btn | ||
self.remove_btn = remove_btn | ||
self.locate_btn = locate_btn | ||
layout = QHBoxLayout() | ||
layout.setContentsMargins(0, 0, 0, 0) | ||
layout.setSpacing(0) | ||
cancel_btn.clicked.connect(self.cancel_item) | ||
remove_btn.clicked.connect(self.retry_item) | ||
locate_btn.clicked.connect(self.locate_file) | ||
layout.addWidget(pbar) | ||
layout.addWidget(cancel_btn) | ||
layout.addWidget(remove_btn) | ||
layout.addWidget(locate_btn) | ||
self.setLayout(layout) | ||
|
||
def locate_file(self): | ||
if self.__id in downloaded_data: | ||
if downloaded_data[self.__id].get('media_path', None): | ||
show_in_file_manager(os.path.abspath(downloaded_data[self.__id]['media_path'])) | ||
|
||
def cancel_item(self): | ||
cancel_list[self.__id] = {} | ||
self.cancel_btn.hide() | ||
|
||
def retry_item(self): | ||
if self.__id in failed_downloads: | ||
downloads_status[self.__id]["status_label"].setText("Waiting") | ||
self.remove_btn.hide() | ||
download_queue.put(failed_downloads[self.__id]) | ||
self.cancel_btn.show() |
Oops, something went wrong.