[med-svn] [SCM] praat branch, master, updated. debian/5.3.14-1-45-geb6df89

Rafael Laboissiere rafael at laboissiere.net
Mon Apr 22 20:29:27 UTC 2013


The following commit has been merged in the master branch:
commit d357f27f1ae0111daa159fbf25452516deba758b
Author: Rafael Laboissiere <rafael at laboissiere.net>
Date:   Mon Apr 22 18:15:23 2013 +0200

    debian/praat-open-files: New script for opening sound files with praat

diff --git a/debian/control b/debian/control
index 2ac3590..6129210 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,7 @@ Vcs-Browser: http://git.debian.org/?p=debian-med/praat.git
 
 Package: praat
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, oss-compat
+Depends: ${shlibs:Depends}, ${misc:Depends}, oss-compat, python
 Recommends: xfonts-75dpi | xfonts-75dpi-transcoded
  | xfonts-100dpi | xfonts-100dpi-transcoded
 Description: program for speech analysis and synthesis
diff --git a/debian/install.in b/debian/install.in
index 90ade97..127c165 100644
--- a/debian/install.in
+++ b/debian/install.in
@@ -1,5 +1,6 @@
 praat			@BINDIR@
 sendpraat		@BINDIR@
+debian/praat-open-files	@BINDIR@
 debian/praat.xpm	@PIXDIR@
 debian/praat.svg	@SVGDIR@
 debian/praat.desktop    @APPDIR@
diff --git a/debian/praat-open-files b/debian/praat-open-files
new file mode 100644
index 0000000..dd2c3f9
--- /dev/null
+++ b/debian/praat-open-files
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+
+### Copyright (C) 2013  Rafael Laboissiere
+###
+### This program is free software; you can redistribute it and/or modify it
+### under the terms of the GNU General Public License as published by the
+### Free Software Foundation; either version 3 of the License, or (at your
+### option) any later version.
+###
+### This program is distributed in the hope that it will be useful, but
+### WITHOUT ANY WARRANTY; without even the implied warranty of
+### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+### General Public License for more details.
+###
+### You should have received a copy of the GNU General Public License along
+### with this program; if not, see <http://www.gnu.org/licenses/>.
+
+import argparse
+import os
+import subprocess
+import time
+
+parser = argparse.ArgumentParser (description = 'Open sound files with Praat')
+parser.add_argument ('--new', action = 'store_true',
+                     help = 'Launch a new instance of praat for viewing the files')
+wait_default = 3
+parser.add_argument ('--wait', type = int, default = wait_default,
+                     help = 'time, in sec, to wait for the new instance of praat'
+                            + ' to be launched (default = %d)' % wait_default)
+parser.add_argument ('files', metavar = 'file', type = str, nargs = '+',
+                     help = 'sound file to be opened')
+
+args = parser.parse_args ()
+
+command = ['sendpraat', 'praat']
+for f in args.files:
+    command.append ('Read from file... %s' % os.path.abspath (f))
+    command.append ('Edit')
+
+if len (command) > 2:
+    if args.new:
+        subprocess.Popen (['praat'])
+        time.sleep (args.wait)
+    subprocess.Popen (command)
diff --git a/debian/praat-open-files.dbk b/debian/praat-open-files.dbk
new file mode 100644
index 0000000..7af9c94
--- /dev/null
+++ b/debian/praat-open-files.dbk
@@ -0,0 +1,164 @@
+<?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>Rafael</firstname>">
+  <!ENTITY dhsurname   "<surname>Laboissiere</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>April 22, 2013</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
+  <!ENTITY dhemail     "<email>rafael at laboissiere.net</email>">
+  <!ENTITY dhusername  "Rafael Laboissiere">
+  <!ENTITY dhucpackage "<refentrytitle>PRAAT-OPEN-FILES</refentrytitle>">
+  <!ENTITY dhpackage   "praat-open-files">
+
+  <!ENTITY debian      "Debian">
+  <!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;
+    <refmiscinfo class="manual">User Commands</refmiscinfo>
+    <refmiscinfo class="source">Praat</refmiscinfo>
+  </refmeta>
+  <refnamediv>
+    <refname>&dhpackage;</refname>
+
+    <refpurpose>Open sound files with Praat</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+      <arg choice="opt">--new
+        <replaceable class="parameter"></replaceable>
+      </arg>
+      <arg choice="opt">--wait=<replaceable class="parameter">secs</replaceable>
+      </arg>
+      <arg choice="req" rep="repeat">
+        <replaceable class="parameter">file</replaceable>
+      </arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>DESCRIPTION</title>
+
+    <para>The <command>&dhpackage;</command> command allows opening of
+    sound files with <command>praat</command> from the command line.  Any
+    file type recognized by Praat (WAV, FLAC, MP3, etc) can be given as
+    arguments.</para>
+
+  </refsect1>
+
+  <refsect1>
+    <title>OPTIONS</title>
+
+    <variablelist>
+      <varlistentry>
+        <term>--new</term>
+        <listitem>
+          <para>
+            Launch a new instance of <command>praat</command> for viewing
+            and editing the sound files.  By default,
+            <command>praat-open-files</command> try to open the files in an
+            running <command>praat</command> program, and fails if ther is none.
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>--wait=<replaceable class="parameter">secs</replaceable></term>
+        <listitem>
+          <para>
+            By default, when the --new option is used,
+            <command>praat-open-files</command> waits for 3 seconds before
+            sending commands to the newly launched instance of
+            <command>praat</command>.  If <command>praat</command> takes
+            longer to be launched on your system, specify another value
+            with the --wait option.
+          </para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+
+  </refsect1>
+
+  <refsect1>
+    <title>EXAMPLES</title>
+
+    <programlisting>praat-open-files file.wav relative/path/file.flac /absolute/path/file.mp3</programlisting>
+    
+    <para>Open the three specified files with individual View & Edit
+    windows for each one on a running instance of
+    <command>praat</command>.</para>
+    
+    <programlisting>praat-open-files --new file.wav</programlisting>
+
+    <para>Open file.wav in a new instance of <command>praat</command>. </para>
+    
+    <programlisting>praat-open-files --new --wait=5 file.wav</programlisting>
+
+    <para>Open file.wav in a new instance of <command>praat</command>,
+    waiting 5 seconds before sending the request to open the file.</para>
+    
+  </refsect1>
+
+  <refsect1>
+    <title>AUTHOR</title>
+    <para>&dhusername; <&dhemail;></para>
+
+  </refsect1>
+
+  <refsect1>
+
+    <title>SEE ALSO</title>
+
+    <para>For further information, see the Praat website
+    (http://www.praat.org).</para>
+
+  </refsect1>
+
+</refentry>
diff --git a/debian/praat.manpages b/debian/praat.manpages
index 67b1ffa..acf9c69 100644
--- a/debian/praat.manpages
+++ b/debian/praat.manpages
@@ -1,2 +1,3 @@
 praat.1
 sendpraat.1
+praat-open-files.1
diff --git a/debian/rules b/debian/rules
index 2516a6d..ca89bf4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -27,9 +27,9 @@ clean:
 	dh clean
 	# Fix the lacking cleaning command for the main/ directory
 	[ ! -f makefile.defs ] || make -C main clean
-	rm -f makefile.defs $(DEBDIR)/praat.dirs		\
-		 $(DEBDIR)/praat.install $(DEBDIR)/praat.menu	\
-		 sendpraat praat.1 sendpraat.1
+	rm -f makefile.defs $(DEBDIR)/praat.dirs			\
+		 $(DEBDIR)/praat.install $(DEBDIR)/praat.menu		\
+		 sendpraat praat.1 sendpraat.1 praat-open-files.1
 
 override_dh_auto_configure:
 	# Generate the debhelper files
@@ -55,7 +55,7 @@ sendpraat: sys/sendpraat.c
 		-Wl,--as-needed -std=gnu99 -DSTAND_ALONE -DUNIX	\
 		-o sendpraat sys/sendpraat.c
 
-override_dh_auto_build: sendpraat praat.1 sendpraat.1
+override_dh_auto_build: sendpraat praat.1 sendpraat.1 praat-open-files.1
 	dh_auto_build
 
 override_dh_auto_install::

-- 
Debian packaging for Praat



More information about the debian-med-commit mailing list