trying to make setup.py work
This commit is contained in:
parent
bcb8f27c2e
commit
17c8a6703a
53
setup.py
53
setup.py
|
@ -1,19 +1,34 @@
|
|||
+from setuptools import setup, find_packages
|
||||
|
||||
-# Dependencies are automatically detected, but it might need +setup(name='audio_visualizer_python',
|
||||
-# fine tuning. + version='1.0',
|
||||
-buildOptions = dict(packages = [], excludes = [ + description='a little GUI tool to render visualization \
|
||||
- "apport", + videos of audio files',
|
||||
- "apt", + license='MIT',
|
||||
- "ctypes", + url='https://github.com/djfun/audio-visualizer-python',
|
||||
- "curses", + packages=find_packages(),
|
||||
- "distutils", + package_data={
|
||||
- "email", + 'src': ['*'],
|
||||
- "html", + },
|
||||
- "http", + install_requires=['pillow-simd', 'numpy', ''],
|
||||
- "json", + entry_points={
|
||||
- "xmlrpc", + 'gui_scripts': [
|
||||
- "nose" + 'audio-visualizer-python = avpython.main:main'
|
||||
- ], include_files = ["main.ui"]) + ]
|
||||
- + }
|
||||
-import sys + )
|
||||
from setuptools import setup
|
||||
import os
|
||||
|
||||
|
||||
def package_files(directory):
|
||||
paths = []
|
||||
for (path, directories, filenames) in os.walk(directory):
|
||||
for filename in filenames:
|
||||
paths.append(os.path.join('..', path, filename))
|
||||
return paths
|
||||
|
||||
|
||||
setup(
|
||||
name='audio_visualizer_python',
|
||||
version='2.0.0',
|
||||
description='A little GUI tool to create audio visualization " \
|
||||
"videos out of audio files',
|
||||
license='MIT',
|
||||
url='https://github.com/djfun/audio-visualizer-python',
|
||||
packages=[
|
||||
'avpython',
|
||||
'avpython.components'
|
||||
],
|
||||
package_dir={'avpython': 'src'},
|
||||
package_data={
|
||||
'avpython': package_files('src'),
|
||||
},
|
||||
install_requires=['olefile', 'Pillow-SIMD', 'PyQt5', 'numpy'],
|
||||
entry_points={
|
||||
'gui_scripts': [
|
||||
'avp = avpython.main:main'
|
||||
],
|
||||
}
|
||||
)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
from avpython.main import main
|
||||
|
||||
main()
|
29
src/main.py
29
src/main.py
|
@ -2,12 +2,18 @@ from PyQt5 import uic, QtWidgets
|
|||
import sys
|
||||
import os
|
||||
|
||||
import core
|
||||
import preview_thread
|
||||
import video_thread
|
||||
|
||||
def main():
|
||||
if getattr(sys, 'frozen', False):
|
||||
# frozen
|
||||
wd = os.path.dirname(sys.executable)
|
||||
else:
|
||||
# unfrozen
|
||||
wd = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
# make local imports work everywhere
|
||||
sys.path.append(wd)
|
||||
|
||||
if __name__ == "__main__":
|
||||
mode = 'GUI'
|
||||
if len(sys.argv) > 2:
|
||||
mode = 'commandline'
|
||||
|
@ -28,22 +34,15 @@ if __name__ == "__main__":
|
|||
# app.setOrganizationName("audio-visualizer")
|
||||
|
||||
if mode == 'commandline':
|
||||
from command import *
|
||||
from command import Command
|
||||
|
||||
main = Command()
|
||||
|
||||
elif mode == 'GUI':
|
||||
from mainwindow import *
|
||||
from mainwindow import MainWindow
|
||||
import atexit
|
||||
import signal
|
||||
|
||||
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 = QtWidgets.QDesktopWidget()
|
||||
|
@ -64,3 +63,7 @@ if __name__ == "__main__":
|
|||
|
||||
# applicable to both modes
|
||||
sys.exit(app.exec_())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
@ -6,7 +6,6 @@ from PyQt5 import QtCore, QtWidgets
|
|||
import string
|
||||
import os
|
||||
|
||||
import core
|
||||
import toolkit
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ from PyQt5 import QtCore, QtGui, uic
|
|||
from PyQt5.QtCore import pyqtSignal, pyqtSlot
|
||||
from PIL import Image
|
||||
from PIL.ImageQt import ImageQt
|
||||
import core
|
||||
from queue import Queue, Empty
|
||||
import os
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ from threading import Thread, Event
|
|||
import time
|
||||
import signal
|
||||
|
||||
import core
|
||||
from toolkit import openPipe
|
||||
from frame import Checkerboard
|
||||
|
||||
|
|
Reference in New Issue