From 9954706a6398695a775c03cee89e4e22f8f2c5c6 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Sun, 9 Dec 2007 20:55:14 +0000 Subject: [PATCH] Create debian config --- d-fuzz.py | 69 +++++++++++++----- debian/README.Debian | 6 ++ debian/changelog | 6 ++ debian/compat | 1 + debian/control | 12 ++++ debian/copyright | 24 +++++++ debian/dirs | 2 + debian/docs | 1 + debian/manpage.1.ex | 59 ++++++++++++++++ debian/manpage.sgml.ex | 156 +++++++++++++++++++++++++++++++++++++++++ debian/manpage.xml.ex | 144 +++++++++++++++++++++++++++++++++++++ debian/rules | 7 ++ 12 files changed, 468 insertions(+), 19 deletions(-) create mode 100644 debian/README.Debian create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100644 debian/manpage.1.ex create mode 100644 debian/manpage.sgml.ex create mode 100644 debian/manpage.xml.ex create mode 100755 debian/rules diff --git a/d-fuzz.py b/d-fuzz.py index af750fc..2355344 100755 --- a/d-fuzz.py +++ b/d-fuzz.py @@ -20,7 +20,7 @@ import subprocess from shout import Shout from xmltodict import * from threading import Thread -import Queue +from Queue import Queue from mutagen.oggvorbis import OggVorbis version = '0.2' @@ -77,10 +77,12 @@ class DFuzz: print 'Number of stations : ' + str(nb_stations) # Create a Queue - q = Queue.Queue(0) - s = Stations(q) + q = Queue(0) + send = Stack() + recv = Stack() + s = Stations(q, send) station_timer = s.get_station_timer() - print str(station_timer) + print 'Station timer : ' + str(station_timer) station_buffer = s.get_buffer_size() s.start() @@ -99,7 +101,7 @@ class DFuzz: print 'Station %s: %s has %s channels' % (str(i+1), name, str(nb_channels)) channel_buffer = station_buffer * total_channel_number - print channel_buffer + print 'Channel buffer : ' + str(channel_buffer) for i in range(0,nb_stations): if isinstance(self.conf['d-fuzz']['station'], dict): @@ -110,22 +112,35 @@ class DFuzz: name = station['infos']['name'] nb_channels = int(station['infos']['channels']) for channel_id in range(0, nb_channels): - print channel_id #print channel_id - c = Channel(station, channel_id + 1, channel_buffer, q) + #print channel_id + c = Channel(station, channel_id + 1, channel_buffer, q, recv) c.start() + time.sleep(1) +class Widget: + pass +class Stack: + def __init__(self): + self.__stack = list() + def __len__(self): + return len(self.__stack) + def push(self, item): + self.__stack.append(item) + def pop(self): + return self.__stack.pop() class Stations(Thread): """D-Fuzz Station (Producer) thread""" - def __init__(self, station_q): + def __init__(self, station_q, send): Thread.__init__(self) self.station_q = station_q - self.buffer_size = 0xFFF - print self.buffer_size + self.send = send + self.buffer_size = 65536 + print 'Buffer size : ' + str(self.buffer_size) self.frequency = 44100 self.station_timer = float(int(self.buffer_size)) / self.frequency @@ -137,21 +152,27 @@ class Stations(Thread): def run(self): station_q = self.station_q - i=0 + send = self.send + #i=0 while 1 : #print currentThread(),"Produced One Item:",i + # time.sleep(self.station_timer) time.sleep(self.station_timer) - station_q.put(i,1) - i+=1 + item = Widget() + station_q.put(item) + send.push(item) + #station_q.put(i,1) + #i+=1 class Channel(Thread): """A channel shouting thread""" - def __init__(self, station, channel_id, channel_buffer, channel_q): + def __init__(self, station, channel_id, channel_buffer, channel_q, recv): Thread.__init__(self) self.channel_q = channel_q + self.recv = recv self.station = station self.main_command = 'cat' self.channel_id = channel_id @@ -184,12 +205,20 @@ class Channel(Thread): # s.audio_info = { 'key': 'val', ... } # (keys are shout.SHOUT_AI_BITRATE, shout.SHOUT_AI_SAMPLERATE, # shout.SHOUT_AI_CHANNELS, shout.SHOUT_AI_QUALITY) + self.formats = ['mp3', 'ogg', 'flac'] + + def get_file_extension(self, file): + file_split = file.split('.') + return file_split[len(file_split)-1] + def get_playlist(self): file_list = [] for root, dirs, files in os.walk(self.media_dir): for file in files: - file_list.append(root + os.sep + file) + extension = self.get_file_extension(file) + if extension in self.formats: + file_list.append(root + os.sep + file) return file_list def get_next_media_lin(self, playlist): @@ -244,9 +273,11 @@ class Channel(Thread): def run(self): #print "Using libshout version %s" % shout.version() #__chunk = 0 + recv = self.recv + channel_q = self.channel_q self.channel.open() print 'Opening ' + self.channel.name + '...' - time.sleep(0.1) + #time.sleep(0.1) # Playlist playlist = self.get_playlist() @@ -274,9 +305,9 @@ class Channel(Thread): for __chunk in stream: # Wait - time.sleep(self.timer) - # Get the queue - self.channel_q.get(1) + #time.sleep(self.timer) + recv.push(channel_q.get()) + #self.channel_q.get(1) self.channel.send(__chunk) self.channel.sync() diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..adbf3a6 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,6 @@ +d-fuzz for Debian +----------------- + + + + -- G. Pellerin Sun, 09 Dec 2007 21:50:43 +0100 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..d042228 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +d-fuzz (0.2-1) unstable; urgency=low + + * Initial release (Closes: #nnnn) + + -- G. Pellerin Sun, 09 Dec 2007 21:50:43 +0100 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..35eadcd --- /dev/null +++ b/debian/control @@ -0,0 +1,12 @@ +Source: d-fuzz +Section: sound +Priority: extra +Maintainer: Guillaume Pellerin +Build-Depends: cdbs, debhelper (>= 5) +Standards-Version: 3.7.2 + +Package: d-fuzz +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..2de597e --- /dev/null +++ b/debian/copyright @@ -0,0 +1,24 @@ +This package was debianized by G. Pellerin on +Sun, 09 Dec 2007 21:50:43 +0100. + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + + +The Debian packaging is (C) 2007, G. Pellerin and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..ca882bb --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e845566 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README diff --git a/debian/manpage.1.ex b/debian/manpage.1.ex new file mode 100644 index 0000000..68063ab --- /dev/null +++ b/debian/manpage.1.ex @@ -0,0 +1,59 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH D-FUZZ SECTION "décembre 9, 2007" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +d-fuzz \- program to do something +.SH SYNOPSIS +.B d-fuzz +.RI [ options ] " files" ... +.br +.B bar +.RI [ options ] " files" ... +.SH DESCRIPTION +This manual page documents briefly the +.B d-fuzz +and +.B bar +commands. +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBd-fuzz\fP is a program that... +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +For a complete description, see the Info files. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-v, \-\-version +Show version of program. +.SH SEE ALSO +.BR bar (1), +.BR baz (1). +.br +The programs are documented fully by +.IR "The Rise and Fall of a Fooish Bar" , +available via the Info system. +.SH AUTHOR +d-fuzz was written by . +.PP +This manual page was written by G. Pellerin , +for the Debian project (but may be used by others). diff --git a/debian/manpage.sgml.ex b/debian/manpage.sgml.ex new file mode 100644 index 0000000..fbd9a6b --- /dev/null +++ b/debian/manpage.sgml.ex @@ -0,0 +1,156 @@ + manpage.1'. You may view + the manual page with: `docbook-to-man manpage.sgml | nroff -man | + less'. A typical entry in a Makefile or Makefile.am is: + +manpage.1: manpage.sgml + docbook-to-man $< > $@ + + + The docbook-to-man binary is found in the docbook-to-man package. + Please remember that if you create the nroff version in one of the + debian/rules file targets (such as build), you will need to include + docbook-to-man in your Build-Depends control field. + + --> + + + FIRSTNAME"> + SURNAME"> + + décembre 9, 2007"> + + SECTION"> + yomguy@altern.org"> + + D-FUZZ"> + + + Debian"> + GNU"> + GPL"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2003 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + program to do something + + + + &dhpackage; + + + + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; and bar + commands. + + This manual page was written for the &debian; distribution + because the original program does not have a manual page. + Instead, it has documentation in the &gnu; + Info format; see below. + + &dhpackage; is a program that... + + + + OPTIONS + + These programs follow the usual &gnu; command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below. For a complete description, see the + Info files. + + + + + + + + Show summary of options. + + + + + + + + Show version of program. + + + + + + SEE ALSO + + bar (1), baz (1). + + The programs are documented fully by The Rise and + Fall of a Fooish Bar available via the + Info system. + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the &gnu; General Public License, Version 2 any + later version published by the Free Software Foundation. + + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. + + + +
+ + + + diff --git a/debian/manpage.xml.ex b/debian/manpage.xml.ex new file mode 100644 index 0000000..5b6cee7 --- /dev/null +++ b/debian/manpage.xml.ex @@ -0,0 +1,144 @@ + +.
will be generated. You may view the +manual page with: nroff -man .
| less'. A +typical entry in a Makefile or Makefile.am is: + +DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ +manpages/docbook.xsl +XP=xsltproc -''-nonet + +manpage.1: manpage.dbk + $(XP) $(DB2MAN) $< + +The xsltproc binary is found in the xsltproc package. The +XSL files are in docbook-xsl. Please remember that if you +create the nroff version in one of the debian/rules file +targets (such as build), you will need to include xsltproc +and docbook-xsl in your Build-Depends control field. + +--> + + + FIRSTNAME"> + SURNAME"> + + décembre 9, 2007"> + + SECTION"> + yomguy@altern.org"> + + D-FUZZ"> + + + Debian"> + GNU"> + GPL"> +]> + + + +
+ &dhemail; +
+ + 2007 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + program to do something + + + + &dhpackage; + + + + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; and bar + commands. + + This manual page was written for the &debian; distribution + because the original program does not have a manual page. + Instead, it has documentation in the &gnu; + Info format; see below. + + &dhpackage; is a program that... + + + + OPTIONS + + These programs follow the usual &gnu; command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below. For a complete description, see the + Info files. + + + + + + + + Show summary of options. + + + + + + + + Show version of program. + + + + + + SEE ALSO + + bar (1), baz (1). + + The programs are documented fully by The Rise and + Fall of a Fooish Bar available via the + Info system. + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the &gnu; General Public License, Version 2 any + later version published by the Free Software Foundation. + + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. + + + +
+ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..6fbdb3c --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/makefile.mk +include /usr/share/cdbs/1/class/python-distutils.mk + +# Add here any variable or target overrides you need. -- 2.39.5