From c4f7fb4a20b42b91ac116b2034f19e747f187379 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 31 May 2011 13:14:40 +0000 Subject: [PATCH] reorganize the python package, get a real setup --- INSTALL => INSTALL.rst | 0 COPYING => LICENSE | 0 README => README.rst | 0 deefuzzer/__init__.py | 1 + {tools => deefuzzer/tools}/PyRSS2Gen.py | 0 {tools => deefuzzer/tools}/__init__.py | 0 .../tools}/get_access_token.py | 0 {tools => deefuzzer/tools}/logger.py | 0 {tools => deefuzzer/tools}/mp3.py | 0 {tools => deefuzzer/tools}/ogg.py | 0 {tools => deefuzzer/tools}/osc.py | 0 .../tools}/osc_jingles_start.py | 0 .../tools}/osc_jingles_stop.py | 0 {tools => deefuzzer/tools}/osc_player_fast.py | 0 {tools => deefuzzer/tools}/osc_player_next.py | 0 {tools => deefuzzer/tools}/osc_player_slow.py | 0 .../tools}/osc_record_start.py | 0 {tools => deefuzzer/tools}/osc_record_stop.py | 0 {tools => deefuzzer/tools}/osc_relay_start.py | 0 {tools => deefuzzer/tools}/osc_relay_stop.py | 0 .../tools}/osc_twitter_start.py | 0 .../tools}/osc_twitter_stop.py | 0 {tools => deefuzzer/tools}/player.py | 0 {tools => deefuzzer/tools}/recorder.py | 0 {tools => deefuzzer/tools}/relay.py | 0 {tools => deefuzzer/tools}/station.py | 0 {tools => deefuzzer/tools}/tools.py | 0 {tools => deefuzzer/tools}/twitt.py | 0 {tools => deefuzzer/tools}/xmltodict.py | 0 {tools => deefuzzer/tools}/xmltodict2.py | 0 install.py | 71 ------------------- deefuzzer.py => scripts/deefuzzer | 5 +- setup.py | 45 ++++++++++++ 33 files changed, 49 insertions(+), 73 deletions(-) rename INSTALL => INSTALL.rst (100%) rename COPYING => LICENSE (100%) rename README => README.rst (100%) create mode 100644 deefuzzer/__init__.py rename {tools => deefuzzer/tools}/PyRSS2Gen.py (100%) rename {tools => deefuzzer/tools}/__init__.py (100%) rename {tools => deefuzzer/tools}/get_access_token.py (100%) rename {tools => deefuzzer/tools}/logger.py (100%) rename {tools => deefuzzer/tools}/mp3.py (100%) rename {tools => deefuzzer/tools}/ogg.py (100%) rename {tools => deefuzzer/tools}/osc.py (100%) rename {tools => deefuzzer/tools}/osc_jingles_start.py (100%) rename {tools => deefuzzer/tools}/osc_jingles_stop.py (100%) rename {tools => deefuzzer/tools}/osc_player_fast.py (100%) rename {tools => deefuzzer/tools}/osc_player_next.py (100%) rename {tools => deefuzzer/tools}/osc_player_slow.py (100%) rename {tools => deefuzzer/tools}/osc_record_start.py (100%) rename {tools => deefuzzer/tools}/osc_record_stop.py (100%) rename {tools => deefuzzer/tools}/osc_relay_start.py (100%) rename {tools => deefuzzer/tools}/osc_relay_stop.py (100%) rename {tools => deefuzzer/tools}/osc_twitter_start.py (100%) rename {tools => deefuzzer/tools}/osc_twitter_stop.py (100%) rename {tools => deefuzzer/tools}/player.py (100%) rename {tools => deefuzzer/tools}/recorder.py (100%) rename {tools => deefuzzer/tools}/relay.py (100%) rename {tools => deefuzzer/tools}/station.py (100%) rename {tools => deefuzzer/tools}/tools.py (100%) rename {tools => deefuzzer/tools}/twitt.py (100%) rename {tools => deefuzzer/tools}/xmltodict.py (100%) rename {tools => deefuzzer/tools}/xmltodict2.py (100%) delete mode 100644 install.py rename deefuzzer.py => scripts/deefuzzer (98%) create mode 100644 setup.py diff --git a/INSTALL b/INSTALL.rst similarity index 100% rename from INSTALL rename to INSTALL.rst diff --git a/COPYING b/LICENSE similarity index 100% rename from COPYING rename to LICENSE diff --git a/README b/README.rst similarity index 100% rename from README rename to README.rst diff --git a/deefuzzer/__init__.py b/deefuzzer/__init__.py new file mode 100644 index 0000000..3777607 --- /dev/null +++ b/deefuzzer/__init__.py @@ -0,0 +1 @@ +from tools import * diff --git a/tools/PyRSS2Gen.py b/deefuzzer/tools/PyRSS2Gen.py similarity index 100% rename from tools/PyRSS2Gen.py rename to deefuzzer/tools/PyRSS2Gen.py diff --git a/tools/__init__.py b/deefuzzer/tools/__init__.py similarity index 100% rename from tools/__init__.py rename to deefuzzer/tools/__init__.py diff --git a/tools/get_access_token.py b/deefuzzer/tools/get_access_token.py similarity index 100% rename from tools/get_access_token.py rename to deefuzzer/tools/get_access_token.py diff --git a/tools/logger.py b/deefuzzer/tools/logger.py similarity index 100% rename from tools/logger.py rename to deefuzzer/tools/logger.py diff --git a/tools/mp3.py b/deefuzzer/tools/mp3.py similarity index 100% rename from tools/mp3.py rename to deefuzzer/tools/mp3.py diff --git a/tools/ogg.py b/deefuzzer/tools/ogg.py similarity index 100% rename from tools/ogg.py rename to deefuzzer/tools/ogg.py diff --git a/tools/osc.py b/deefuzzer/tools/osc.py similarity index 100% rename from tools/osc.py rename to deefuzzer/tools/osc.py diff --git a/tools/osc_jingles_start.py b/deefuzzer/tools/osc_jingles_start.py similarity index 100% rename from tools/osc_jingles_start.py rename to deefuzzer/tools/osc_jingles_start.py diff --git a/tools/osc_jingles_stop.py b/deefuzzer/tools/osc_jingles_stop.py similarity index 100% rename from tools/osc_jingles_stop.py rename to deefuzzer/tools/osc_jingles_stop.py diff --git a/tools/osc_player_fast.py b/deefuzzer/tools/osc_player_fast.py similarity index 100% rename from tools/osc_player_fast.py rename to deefuzzer/tools/osc_player_fast.py diff --git a/tools/osc_player_next.py b/deefuzzer/tools/osc_player_next.py similarity index 100% rename from tools/osc_player_next.py rename to deefuzzer/tools/osc_player_next.py diff --git a/tools/osc_player_slow.py b/deefuzzer/tools/osc_player_slow.py similarity index 100% rename from tools/osc_player_slow.py rename to deefuzzer/tools/osc_player_slow.py diff --git a/tools/osc_record_start.py b/deefuzzer/tools/osc_record_start.py similarity index 100% rename from tools/osc_record_start.py rename to deefuzzer/tools/osc_record_start.py diff --git a/tools/osc_record_stop.py b/deefuzzer/tools/osc_record_stop.py similarity index 100% rename from tools/osc_record_stop.py rename to deefuzzer/tools/osc_record_stop.py diff --git a/tools/osc_relay_start.py b/deefuzzer/tools/osc_relay_start.py similarity index 100% rename from tools/osc_relay_start.py rename to deefuzzer/tools/osc_relay_start.py diff --git a/tools/osc_relay_stop.py b/deefuzzer/tools/osc_relay_stop.py similarity index 100% rename from tools/osc_relay_stop.py rename to deefuzzer/tools/osc_relay_stop.py diff --git a/tools/osc_twitter_start.py b/deefuzzer/tools/osc_twitter_start.py similarity index 100% rename from tools/osc_twitter_start.py rename to deefuzzer/tools/osc_twitter_start.py diff --git a/tools/osc_twitter_stop.py b/deefuzzer/tools/osc_twitter_stop.py similarity index 100% rename from tools/osc_twitter_stop.py rename to deefuzzer/tools/osc_twitter_stop.py diff --git a/tools/player.py b/deefuzzer/tools/player.py similarity index 100% rename from tools/player.py rename to deefuzzer/tools/player.py diff --git a/tools/recorder.py b/deefuzzer/tools/recorder.py similarity index 100% rename from tools/recorder.py rename to deefuzzer/tools/recorder.py diff --git a/tools/relay.py b/deefuzzer/tools/relay.py similarity index 100% rename from tools/relay.py rename to deefuzzer/tools/relay.py diff --git a/tools/station.py b/deefuzzer/tools/station.py similarity index 100% rename from tools/station.py rename to deefuzzer/tools/station.py diff --git a/tools/tools.py b/deefuzzer/tools/tools.py similarity index 100% rename from tools/tools.py rename to deefuzzer/tools/tools.py diff --git a/tools/twitt.py b/deefuzzer/tools/twitt.py similarity index 100% rename from tools/twitt.py rename to deefuzzer/tools/twitt.py diff --git a/tools/xmltodict.py b/deefuzzer/tools/xmltodict.py similarity index 100% rename from tools/xmltodict.py rename to deefuzzer/tools/xmltodict.py diff --git a/tools/xmltodict2.py b/deefuzzer/tools/xmltodict2.py similarity index 100% rename from tools/xmltodict2.py rename to deefuzzer/tools/xmltodict2.py diff --git a/install.py b/install.py deleted file mode 100644 index a49f2ba..0000000 --- a/install.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright Guillaume Pellerin (2006-2009) - -# - -# This software is a computer program whose purpose is to stream audio -# and video data through icecast2 servers. - -# This software is governed by the CeCILL license under French law and -# abiding by the rules of distribution of free software. You can use, -# modify and/ or redistribute the software under the terms of the CeCILL -# license as circulated by CEA, CNRS and INRIA at the following URL -# "http://www.cecill.info". - -# As a counterpart to the access to the source code and rights to copy, -# modify and redistribute granted by the license, users are provided only -# with a limited warranty and the software's author, the holder of the -# economic rights, and the successive licensors have only limited -# liability. - -# In this respect, the user's attention is drawn to the risks associated -# with loading, using, modifying and/or developing or reproducing the -# software by the user in light of its specific status of free software, -# that may mean that it is complicated to manipulate, and that also -# therefore means that it is reserved for developers and experienced -# professionals having in-depth computer knowledge. Users are therefore -# encouraged to load and test the software's suitability as regards their -# requirements in conditions enabling the security of their systems and/or -# data to be ensured and, more generally, to use and operate it in the -# same conditions as regards security. - -# The fact that you are presently reading this means that you have had -# knowledge of the CeCILL license and that you accept its terms. - -# Author: Guillaume Pellerin - -# ONLY FOR LINUX / UNIX - -import os, sys -import platform - -if len(sys.argv) == 1: - install_dir = '/usr/share/deefuzzer/' -elif len(sys.argv) > 2: - sys.exit('Give just one directory to install the DeeFuzzer, or none.') -else: - install_dir = sys.argv[1] - -if not os.path.exists(install_dir): - os.mkdir(install_dir) - -os.system('cp -ra ./* '+install_dir+os.sep) - -# Install shout-python -os.chdir('shout-python') -os.system('python setup.py install') -os.chdir('..') - -os.system('easy_install tinyurl') - -if os.path.exists('/usr/bin/deefuzzer'): - os.system('rm -r /usr/bin/deefuzzer') - -os.system('ln -s '+install_dir+os.sep+'deefuzzer.py '+'/usr/bin/deefuzzer') - -print """ - DeeFuzzer installation successfull ! - """ - diff --git a/deefuzzer.py b/scripts/deefuzzer similarity index 98% rename from deefuzzer.py rename to scripts/deefuzzer index ee84231..247732d 100755 --- a/deefuzzer.py +++ b/scripts/deefuzzer @@ -43,9 +43,10 @@ import Queue import datetime import platform from threading import Thread -from tools import * +import deefuzzer +from deefuzzer import * -version = '0.5.1' +version = '0.5.2' year = datetime.datetime.now().strftime("%Y") platform_system = platform.system() diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..de5b465 --- /dev/null +++ b/setup.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +'''The setup and build script for the python-twitter library.''' + +import os + +__author__ = 'yomguy@parisson.com' +__version__ = '0.5.2' + + +# The base package metadata to be used by both distutils and setuptools +METADATA = dict( + name = "DeeFuzzer", + version = __version__, + py_modules = ['deefuzzer'], + description='an easy and instant media streaming tool', + author='Guillaume Pellerin', + author_email='yomguy@parisson.com', + license='Gnu Public License V2', + url='http://svn.parisson.org/deefuzzer', + keywords='audio wideo streaming broadcast shout', + install_requires = ['setuptools','tinyurl'], + packages=['deefuzzer'], + include_package_data = True, + scripts=['scripts/deefuzzer'], + classifiers = ['Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Multimedia :: Sound/Audio', 'Topic :: Multimedia :: Sound/Audio :: Players',], +) + + +def Main(): + # Use setuptools if available, otherwise fallback and use distutils + try: + import setuptools + setuptools.setup(**METADATA) + except ImportError: + import distutils.core + distutils.core.setup(**METADATA) + + +if __name__ == '__main__': + os.chdir('shout-python') + os.system('python setup.py install') + os.chdir('..') + Main() -- 2.39.5