Use package structure
This commit is contained in:
parent
d707588926
commit
a841bb4293
11
main.py
Normal file
11
main.py
Normal file
@ -0,0 +1,11 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
|
||||
from PySide6.QtWidgets import QApplication
|
||||
from openfm_qt import MainWindow
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QApplication(sys.argv)
|
||||
widget = MainWindow()
|
||||
widget.show()
|
||||
sys.exit(app.exec())
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"files": ["mainwindow.py","form.ui"]
|
||||
"files": ["form.ui","openfm_qt/mainwindow.py","openfm_qt/__init__.py","main.py"]
|
||||
}
|
||||
|
6
openfm_qt/__init__.py
Normal file
6
openfm_qt/__init__.py
Normal file
@ -0,0 +1,6 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
|
||||
API_URL = "https://open.fm/radio/api/v2/ofm/stations_slug.json"
|
||||
DEFAULT_VOLUME = 70
|
||||
|
||||
from .mainwindow import MainWindow
|
@ -1,8 +1,7 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
import sys
|
||||
|
||||
from PySide6.QtCore import QUrl
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QMessageBox, QStyle
|
||||
from PySide6.QtWidgets import QMainWindow, QMessageBox, QStyle
|
||||
from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput
|
||||
|
||||
# Important:
|
||||
@ -12,9 +11,7 @@ from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput
|
||||
from ui_form import Ui_MainWindow
|
||||
import json
|
||||
import requests
|
||||
|
||||
API_URL = "https://open.fm/radio/api/v2/ofm/stations_slug.json"
|
||||
DEFAULT_VOLUME = 70
|
||||
from . import API_URL, DEFAULT_VOLUME
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
@ -128,10 +125,3 @@ class MainWindow(QMainWindow):
|
||||
pass
|
||||
|
||||
self.ui.playbackToolButton.setIcon(icon)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QApplication(sys.argv)
|
||||
widget = MainWindow()
|
||||
widget.show()
|
||||
sys.exit(app.exec())
|
Loading…
x
Reference in New Issue
Block a user