diff options
| author | tassaron | 2017-07-15 18:59:22 -0400 |
|---|---|---|
| committer | tassaron | 2017-07-15 18:59:22 -0400 |
| commit | 17c8a6703a8093d31c6772ba3b8d9ee01adaa0da (patch) | |
| tree | d2e723dc61566a7a25cd3788966d55fec322ae9e | |
| parent | bcb8f27c2e4434d2296dcd66bf279b76ee0d0a4f (diff) | |
trying to make setup.py work
| -rw-r--r-- | setup.py | 53 | ||||
| -rw-r--r-- | src/__init__.py | 0 | ||||
| -rw-r--r-- | src/__main__.py | 3 | ||||
| -rw-r--r-- | src/main.py | 29 | ||||
| -rw-r--r-- | src/presetmanager.py | 1 | ||||
| -rw-r--r-- | src/preview_thread.py | 1 | ||||
| -rw-r--r-- | src/video_thread.py | 1 |
7 files changed, 53 insertions, 35 deletions
@@ -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 |
