]> git.parisson.com Git - deefuzzer.git/commitdiff
Create debian config
authorGuillaume Pellerin <yomguy@parisson.com>
Sun, 9 Dec 2007 20:55:14 +0000 (20:55 +0000)
committerGuillaume Pellerin <yomguy@parisson.com>
Sun, 9 Dec 2007 20:55:14 +0000 (20:55 +0000)
12 files changed:
d-fuzz.py
debian/README.Debian [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dirs [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/manpage.1.ex [new file with mode: 0644]
debian/manpage.sgml.ex [new file with mode: 0644]
debian/manpage.xml.ex [new file with mode: 0644]
debian/rules [new file with mode: 0755]

index af750fce703e1f9dc923e501260d000b59cb284c..235534404f816d05cba07fdb5f4751a99ddbef15 100755 (executable)
--- 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 (file)
index 0000000..adbf3a6
--- /dev/null
@@ -0,0 +1,6 @@
+d-fuzz for Debian
+-----------------
+
+<possible notes regarding this package - if none, delete this file>
+
+ -- G. Pellerin <yomguy@altern.org>  Sun, 09 Dec 2007 21:50:43 +0100
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..d042228
--- /dev/null
@@ -0,0 +1,6 @@
+d-fuzz (0.2-1) unstable; urgency=low
+
+  * Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>
+
+ -- G. Pellerin <yomguy@altern.org>  Sun, 09 Dec 2007 21:50:43 +0100
+
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..35eadcd
--- /dev/null
@@ -0,0 +1,12 @@
+Source: d-fuzz
+Section: sound
+Priority: extra
+Maintainer: Guillaume Pellerin <yomguy@altern.org>
+Build-Depends: cdbs, debhelper (>= 5)
+Standards-Version: 3.7.2
+
+Package: d-fuzz
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..2de597e
--- /dev/null
@@ -0,0 +1,24 @@
+This package was debianized by G. Pellerin <yomguy@altern.org> on
+Sun, 09 Dec 2007 21:50:43 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s): 
+
+    <put author's name and email here>
+    <likewise for another author>
+
+Copyright: 
+
+    <Copyright (C) YYYY Name OfAuthor>
+    <likewise for another author>
+
+License:
+
+    <Put the license of the package here indented by 4 spaces>
+
+The Debian packaging is (C) 2007, G. Pellerin <yomguy@altern.org> 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 (file)
index 0000000..ca882bb
--- /dev/null
@@ -0,0 +1,2 @@
+usr/bin
+usr/sbin
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..e845566
--- /dev/null
@@ -0,0 +1 @@
+README
diff --git a/debian/manpage.1.ex b/debian/manpage.1.ex
new file mode 100644 (file)
index 0000000..68063ab
--- /dev/null
@@ -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 <n>    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<whatever>\fP and
+.\" \fI<whatever>\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 <upstream author>.
+.PP
+This manual page was written by G. Pellerin <yomguy@altern.org>,
+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 (file)
index 0000000..fbd9a6b
--- /dev/null
@@ -0,0 +1,156 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+     page: `docbook-to-man manpage.sgml > 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.
+
+  -->
+
+  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+  <!ENTITY dhfirstname "<firstname>FIRSTNAME</firstname>">
+  <!ENTITY dhsurname   "<surname>SURNAME</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>décembre  9, 2007</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>SECTION</manvolnum>">
+  <!ENTITY dhemail     "<email>yomguy@altern.org</email>">
+  <!ENTITY dhusername  "G. Pellerin">
+  <!ENTITY dhucpackage "<refentrytitle>D-FUZZ</refentrytitle>">
+  <!ENTITY dhpackage   "d-fuzz">
+
+  <!ENTITY debian      "<productname>Debian</productname>">
+  <!ENTITY gnu         "<acronym>GNU</acronym>">
+  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &dhemail;
+    </address>
+    <author>
+      &dhfirstname;
+      &dhsurname;
+    </author>
+    <copyright>
+      <year>2003</year>
+      <holder>&dhusername;</holder>
+    </copyright>
+    &dhdate;
+  </refentryinfo>
+  <refmeta>
+    &dhucpackage;
+
+    &dhsection;
+  </refmeta>
+  <refnamediv>
+    <refname>&dhpackage;</refname>
+
+    <refpurpose>program to do something</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+
+      <arg><option>-e <replaceable>this</replaceable></option></arg>
+
+      <arg><option>--example <replaceable>that</replaceable></option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+  <refsect1>
+    <title>DESCRIPTION</title>
+
+    <para>This manual page documents briefly the
+      <command>&dhpackage;</command> and <command>bar</command>
+      commands.</para>
+
+    <para>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;
+      <application>Info</application> format; see below.</para>
+
+    <para><command>&dhpackage;</command> is a program that...</para>
+
+  </refsect1>
+  <refsect1>
+    <title>OPTIONS</title>
+
+    <para>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
+      <application>Info</application> files.</para>
+
+    <variablelist>
+      <varlistentry>
+        <term><option>-h</option>
+          <option>--help</option>
+        </term>
+        <listitem>
+          <para>Show summary of options.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-v</option>
+          <option>--version</option>
+        </term>
+        <listitem>
+          <para>Show version of program.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+  <refsect1>
+    <title>SEE ALSO</title>
+
+    <para>bar (1), baz (1).</para>
+
+    <para>The programs are documented fully by <citetitle>The Rise and
+      Fall of a Fooish Bar</citetitle> available via the
+      <application>Info</application> system.</para>
+  </refsect1>
+  <refsect1>
+    <title>AUTHOR</title>
+
+    <para>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.
+    </para>
+       <para>
+         On Debian systems, the complete text of the GNU General Public
+         License can be found in /usr/share/common-licenses/GPL.
+       </para>
+
+  </refsect1>
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
+
+
diff --git a/debian/manpage.xml.ex b/debian/manpage.xml.ex
new file mode 100644 (file)
index 0000000..5b6cee7
--- /dev/null
@@ -0,0 +1,144 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!--
+
+Process this file with an XSLT processor: `xsltproc \
+-''-nonet /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\
+manpages/docbook.xsl manpage.dbk'.  A manual page
+<package>.<section> will be generated.  You may view the
+manual page with: nroff -man <package>.<section> | 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.
+
+-->
+
+  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+  <!ENTITY dhfirstname "<firstname>FIRSTNAME</firstname>">
+  <!ENTITY dhsurname   "<surname>SURNAME</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>décembre  9, 2007</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>SECTION</manvolnum>">
+  <!ENTITY dhemail     "<email>yomguy@altern.org</email>">
+  <!ENTITY dhusername  "G. Pellerin">
+  <!ENTITY dhucpackage "<refentrytitle>D-FUZZ</refentrytitle>">
+  <!ENTITY dhpackage   "d-fuzz">
+
+  <!ENTITY debian      "<productname>Debian</productname>">
+  <!ENTITY gnu         "<acronym>GNU</acronym>">
+  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &dhemail;
+    </address>
+    <copyright>
+      <year>2007</year>
+      <holder>&dhusername;</holder>
+    </copyright>
+    &dhdate;
+  </refentryinfo>
+  <refmeta>
+    &dhucpackage;
+
+    &dhsection;
+  </refmeta>
+  <refnamediv>
+    <refname>&dhpackage;</refname>
+
+    <refpurpose>program to do something</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+
+      <arg><option>-e <replaceable>this</replaceable></option></arg>
+
+      <arg><option>--example <replaceable>that</replaceable></option></arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+  <refsect1>
+    <title>DESCRIPTION</title>
+
+    <para>This manual page documents briefly the
+      <command>&dhpackage;</command> and <command>bar</command>
+      commands.</para>
+
+    <para>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;
+      <application>Info</application> format; see below.</para>
+
+    <para><command>&dhpackage;</command> is a program that...</para>
+
+  </refsect1>
+  <refsect1>
+    <title>OPTIONS</title>
+
+    <para>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
+      <application>Info</application> files.</para>
+
+    <variablelist>
+      <varlistentry>
+        <term><option>-h</option>
+          <option>--help</option>
+        </term>
+        <listitem>
+          <para>Show summary of options.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>-v</option>
+          <option>--version</option>
+        </term>
+        <listitem>
+          <para>Show version of program.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </refsect1>
+  <refsect1>
+    <title>SEE ALSO</title>
+
+    <para>bar (1), baz (1).</para>
+
+    <para>The programs are documented fully by <citetitle>The Rise and
+      Fall of a Fooish Bar</citetitle> available via the
+      <application>Info</application> system.</para>
+  </refsect1>
+  <refsect1>
+    <title>AUTHOR</title>
+
+    <para>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.
+    </para>
+       <para>
+         On Debian systems, the complete text of the GNU General Public
+         License can be found in /usr/share/common-licenses/GPL.
+       </para>
+
+  </refsect1>
+</refentry>
+
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..6fbdb3c
--- /dev/null
@@ -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.