cx_freeze Path Updates
This commit is contained in:
parent
60d62599f7
commit
8c9914850e
6
core.py
6
core.py
|
@ -22,7 +22,13 @@ class Core():
|
|||
self.dataDir = QDesktopServices.storageLocation(
|
||||
QDesktopServices.DataLocation)
|
||||
self.presetDir = os.path.join(self.dataDir, 'presets')
|
||||
if getattr(sys, 'frozen', False):
|
||||
# frozen
|
||||
self.wd = os.path.dirname(sys.executable)
|
||||
else:
|
||||
# unfrozen
|
||||
self.wd = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
self.loadEncoderOptions()
|
||||
self.videoFormats = Core.appendUppercase([
|
||||
'*.mp4',
|
||||
|
|
11
main.py
11
main.py
|
@ -52,8 +52,15 @@ if __name__ == "__main__":
|
|||
app = QtGui.QApplication(sys.argv)
|
||||
app.setApplicationName("audio-visualizer")
|
||||
app.setOrganizationName("audio-visualizer")
|
||||
window = uic.loadUi(os.path.join(
|
||||
os.path.dirname(os.path.realpath(__file__)), "mainwindow.ui"))
|
||||
|
||||
if getattr(sys, 'frozen', False):
|
||||
# frozen
|
||||
wd = os.path.dirname(sys.executable)
|
||||
else:
|
||||
# unfrozen
|
||||
wd = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
window = uic.loadUi(os.path.join(wd, "mainwindow.ui"))
|
||||
# window.adjustSize()
|
||||
desc = QtGui.QDesktopWidget()
|
||||
dpi = desc.physicalDpiX()
|
||||
|
|
|
@ -63,9 +63,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||
LoadDefaultSettings(self)
|
||||
self.presetManager = PresetManager(
|
||||
uic.loadUi(
|
||||
os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
||||
'presetmanager.ui')),
|
||||
self)
|
||||
os.path.join(self.core.wd, 'presetmanager.ui')), self)
|
||||
|
||||
if not os.path.exists(self.dataDir):
|
||||
os.makedirs(self.dataDir)
|
||||
|
@ -143,7 +141,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||
window.spinBox_aBitrate.valueChanged.connect(self.updateCodecSettings)
|
||||
|
||||
self.previewWindow = PreviewWindow(self, os.path.join(
|
||||
os.path.dirname(os.path.realpath(__file__)), "background.png"))
|
||||
self.core.wd, "background.png"))
|
||||
window.verticalLayout_previewWrapper.addWidget(self.previewWindow)
|
||||
|
||||
# Make component buttons
|
||||
|
|
|
@ -23,7 +23,7 @@ class Worker(QtCore.QObject):
|
|||
self.stackedWidget = parent.window.stackedWidget
|
||||
self.background = Image.new("RGBA", (1920, 1080), (0, 0, 0, 0))
|
||||
self.background.paste(Image.open(os.path.join(
|
||||
os.path.dirname(os.path.realpath(__file__)), "background.png")))
|
||||
self.core.wd, "background.png")))
|
||||
|
||||
@pyqtSlot(str, list)
|
||||
def createPreviewImage(self, components):
|
||||
|
|
39
setup.py
39
setup.py
|
@ -1,30 +1,51 @@
|
|||
from cx_Freeze import setup, Executable
|
||||
import sys
|
||||
|
||||
# Dependencies are automatically detected, but it might need
|
||||
# fine tuning.
|
||||
buildOptions = dict(packages = [], excludes = [
|
||||
|
||||
buildOptions = dict(
|
||||
packages=[],
|
||||
excludes=[
|
||||
"apport",
|
||||
"apt",
|
||||
"ctypes",
|
||||
"curses",
|
||||
"distutils",
|
||||
"email",
|
||||
"html",
|
||||
"http",
|
||||
"json",
|
||||
"xmlrpc",
|
||||
"nose"
|
||||
], include_files = ["main.ui"])
|
||||
],
|
||||
include_files=[
|
||||
"mainwindow.ui",
|
||||
"presetmanager.ui",
|
||||
"background.png",
|
||||
"encoder-options.json",
|
||||
"components/"
|
||||
],
|
||||
includes=[
|
||||
'numpy.core._methods',
|
||||
'numpy.lib.format'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
import sys
|
||||
base = 'Win32GUI' if sys.platform == 'win32' else None
|
||||
|
||||
executables = [
|
||||
Executable('main.py', base=base, targetName = 'audio-visualizer-python')
|
||||
Executable(
|
||||
'main.py',
|
||||
base=base,
|
||||
targetName='audio-visualizer-python'
|
||||
)
|
||||
]
|
||||
|
||||
setup(name='audio-visualizer-python',
|
||||
|
||||
setup(
|
||||
name='audio-visualizer-python',
|
||||
version='1.0',
|
||||
description = 'a little GUI tool to render visualization videos of audio files',
|
||||
description='GUI tool to render visualization videos of audio files',
|
||||
options=dict(build_exe=buildOptions),
|
||||
executables = executables)
|
||||
executables=executables
|
||||
)
|
||||
|
|
|
@ -69,7 +69,7 @@ class Worker(QtCore.QObject):
|
|||
def previewDispatch(self):
|
||||
background = Image.new("RGBA", (1920, 1080), (0, 0, 0, 0))
|
||||
background.paste(Image.open(os.path.join(
|
||||
os.path.dirname(os.path.realpath(__file__)), "background.png")))
|
||||
self.core.wd, "background.png")))
|
||||
background = background.resize((self.width, self.height))
|
||||
|
||||
while not self.stopped:
|
||||
|
|
Reference in New Issue