aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup.py53
-rw-r--r--src/__init__.py0
-rw-r--r--src/__main__.py3
-rw-r--r--src/main.py29
-rw-r--r--src/presetmanager.py1
-rw-r--r--src/preview_thread.py1
-rw-r--r--src/video_thread.py1
7 files changed, 53 insertions, 35 deletions
diff --git a/setup.py b/setup.py
index fde3461..4ef6077 100644
--- a/setup.py
+++ b/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 + ) \ No newline at end of file
+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'
+ ],
+ }
+)
diff --git a/src/__init__.py b/src/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/__init__.py
diff --git a/src/__main__.py b/src/__main__.py
new file mode 100644
index 0000000..a68739e
--- /dev/null
+++ b/src/__main__.py
@@ -0,0 +1,3 @@
+from avpython.main import main
+
+main() \ No newline at end of file
diff --git a/src/main.py b/src/main.py
index 2216d2a..317237c 100644
--- a/src/main.py
+++ b/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()
diff --git a/src/presetmanager.py b/src/presetmanager.py
index 0028203..6e003a1 100644
--- a/src/presetmanager.py
+++ b/src/presetmanager.py
@@ -6,7 +6,6 @@ from PyQt5 import QtCore, QtWidgets
import string
import os
-import core
import toolkit
diff --git a/src/preview_thread.py b/src/preview_thread.py
index 4ffb7f6..6c33aff 100644
--- a/src/preview_thread.py
+++ b/src/preview_thread.py
@@ -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
diff --git a/src/video_thread.py b/src/video_thread.py
index 674765a..60db99f 100644
--- a/src/video_thread.py
+++ b/src/video_thread.py
@@ -18,7 +18,6 @@ from threading import Thread, Event
import time
import signal
-import core
from toolkit import openPipe
from frame import Checkerboard