[xiph-commits] r12148 - in experimental/dholth/shoutpy: . gentoo/dev-python/shoutpy

dholth at svn.xiph.org dholth at svn.xiph.org
Sun Nov 26 14:18:34 PST 2006


Author: dholth
Date: 2006-11-26 14:18:31 -0800 (Sun, 26 Nov 2006)
New Revision: 12148

Added:
   experimental/dholth/shoutpy/gentoo/dev-python/shoutpy/shoutpy-1.0.0.ebuild
Removed:
   experimental/dholth/shoutpy/gentoo/dev-python/shoutpy/shoutpy-0.5.2.ebuild
Modified:
   experimental/dholth/shoutpy/CHANGELOG
   experimental/dholth/shoutpy/README
   experimental/dholth/shoutpy/setup.py
   experimental/dholth/shoutpy/shoutcc.cc
   experimental/dholth/shoutpy/shoutcc.h
   experimental/dholth/shoutpy/shoutpy.cc
Log:
shoutpy: Version 1.0.0. Supports nonblocking I/O functions introduced in libshout 2.1


Modified: experimental/dholth/shoutpy/CHANGELOG
===================================================================
--- experimental/dholth/shoutpy/CHANGELOG	2006-11-26 10:50:12 UTC (rev 12147)
+++ experimental/dholth/shoutpy/CHANGELOG	2006-11-26 22:18:31 UTC (rev 12148)
@@ -1,3 +1,4 @@
+1.0 : update to include libshout 2.1's API extensions. Use setuptools.
 0.5 : added doxygen documentation for C++ code, and docstrings for Python.
 0.4 : included example.py; Shout.send works.
 0.3 : initial release

Modified: experimental/dholth/shoutpy/README
===================================================================
--- experimental/dholth/shoutpy/README	2006-11-26 10:50:12 UTC (rev 12147)
+++ experimental/dholth/shoutpy/README	2006-11-26 22:18:31 UTC (rev 12148)
@@ -2,7 +2,8 @@
 -------
 http://dingoskidneys.com/shoutpy/
 
-A Python (Boost.Python) and C++ wrapper for libshout 2.
+A Python (Boost.Python) and C++ wrapper for libshout 2.1 or higher. The
+libshout API remains the same up to at least version 2.2.2
 
 Installing
 ----------
@@ -20,12 +21,14 @@
 
 A gentoo ebuild is provided.
 
-A boost-jam setup (edit Jamrules and boost-build.jam to point to your
-boost installation) is also provided; you will need to install the boost
-sources and the latest boost-jam before you can use this.  Then type
+A deprecated boost-jam setup, probably more trouble than it is worth
+(edit Jamrules and boost-build.jam to point to your boost installation)
+is also provided; you will need to install the boost sources and the
+latest boost-jam before you can use this.  Then type
 
 	bjam
 
-and look for the module and C++ source client under ./bin/
+and look for the module and C++ source client under ./bin/ . If it works
+for you, you will get a considerably smaller binary.
 
-(c) 2004 Daniel Holth <dholth at fastmail.fm>
+(c) 2004-2006 Daniel Holth <dholth at fastmail.fm>

Deleted: experimental/dholth/shoutpy/gentoo/dev-python/shoutpy/shoutpy-0.5.2.ebuild
===================================================================
--- experimental/dholth/shoutpy/gentoo/dev-python/shoutpy/shoutpy-0.5.2.ebuild	2006-11-26 10:50:12 UTC (rev 12147)
+++ experimental/dholth/shoutpy/gentoo/dev-python/shoutpy/shoutpy-0.5.2.ebuild	2006-11-26 22:18:31 UTC (rev 12148)
@@ -1,25 +0,0 @@
-# Copyright 1999-2004 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-inherit distutils
-
-DESCRIPTION="Python bindings for libshout2."
-HOMEPAGE="http://dingoskidneys.com/shoutpy/"
-SRC_URI="http://dingoskidneys.com/shoutpy/${P}.tar.gz"
-
-LICENSE="LGPL-2.1"
-SLOT="0"
-KEYWORDS="~x86"
-
-DEPEND="dev-lang/python
-	>=media-libs/libshout-2.0
-	>=dev-libs/boost-1.31.0"
-
-# Install the example
-src_install () {
-	distutils_src_install
-
-	insinto /usr/share/doc/${PF}
-	doins ${S}/example.py
-}

Copied: experimental/dholth/shoutpy/gentoo/dev-python/shoutpy/shoutpy-1.0.0.ebuild (from rev 12147, experimental/dholth/shoutpy/gentoo/dev-python/shoutpy/shoutpy-0.5.2.ebuild)
===================================================================
--- experimental/dholth/shoutpy/gentoo/dev-python/shoutpy/shoutpy-0.5.2.ebuild	2006-11-26 10:50:12 UTC (rev 12147)
+++ experimental/dholth/shoutpy/gentoo/dev-python/shoutpy/shoutpy-1.0.0.ebuild	2006-11-26 22:18:31 UTC (rev 12148)
@@ -0,0 +1,25 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit distutils
+
+DESCRIPTION="Python bindings for libshout2.1 or higher"
+HOMEPAGE="http://dingoskidneys.com/shoutpy/"
+SRC_URI="http://dingoskidneys.com/shoutpy/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~x86"
+
+DEPEND="dev-lang/python
+	>=media-libs/libshout-2.1
+	>=dev-libs/boost-1.31.0"
+
+# Install the example
+src_install () {
+	distutils_src_install
+
+	insinto /usr/share/doc/${PF}
+	doins ${S}/example.py
+}

Modified: experimental/dholth/shoutpy/setup.py
===================================================================
--- experimental/dholth/shoutpy/setup.py	2006-11-26 10:50:12 UTC (rev 12147)
+++ experimental/dholth/shoutpy/setup.py	2006-11-26 22:18:31 UTC (rev 12148)
@@ -3,18 +3,22 @@
 # shoutpy's distutils setup script.
 #
 # Daniel Holth <dholth at fastmail.fm>
-# 15 Jan. 2004
+# 15 Jan. 2004 - 26 Nov. 2006
 
-from distutils.core import setup
-from distutils.extension import Extension
+try:
+    from setuptools import setup
+    from setuptools.extension import Extension
+except:
+    from distutils.core import setup
+    from distutils.extension import Extension
 
 # local configuration
 import config
 
-description = """shoutpy provides Pythonic bindings for libshout 2."""
+description = """shoutpy provides Pythonic bindings for libshout 2.1 or higher"""
 
 classifiers="""\
-Development Status :: 3 - Alpha
+Development Status :: 4 - Beta
 License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
 Operating System :: POSIX :: Linux
 Programming Language :: C++
@@ -23,12 +27,12 @@
 Topic :: Multimedia :: Sound/Audio
 """
 
-version="0.5.2"
+version="1.0.0"
 url = "http://dingoskidneys.com/shoutpy/"
 
 setup(name="shoutpy",
       version=version,
-      description="Boost.Python bindings for libshout 2",
+      description="Boost.Python bindings for libshout >= 2.1",
       long_description=description,
       author="Daniel Holth",
       author_email="dholth at fastmail.fm",
@@ -36,6 +40,7 @@
       download_url=url+"shoutpy-"+version+".tar.gz",
       platforms="linux",
       license="GNU LGPL",
+      keywords="shout libshout icecast ogg streaming audio",
       classifiers=filter(None, classifiers.splitlines()),
       ext_modules=[Extension("shoutpy", ["shoutpy.cc", "shoutcc.cc"],
                              libraries=config.libraries,

Modified: experimental/dholth/shoutpy/shoutcc.cc
===================================================================
--- experimental/dholth/shoutpy/shoutcc.cc	2006-11-26 10:50:12 UTC (rev 12147)
+++ experimental/dholth/shoutpy/shoutcc.cc	2006-11-26 22:18:31 UTC (rev 12148)
@@ -94,6 +94,8 @@
     case SHOUTERR_UNSUPPORTED:
       d = "UNSUPPORTED";
       break;
+    case SHOUTERR_BUSY:
+      d = "BUSY";
     default:
       d = "";
   }
@@ -406,3 +408,23 @@
 void Shout::set_metadata(ShoutMetadata *metadata) {
   this->check(shout_set_metadata(this->self, metadata->self));
 }
+
+// Instruct libshout to use nonblocking I/O. 
+/**
+ * Must be called before shout_open (no switching back and forth
+ * midstream).
+ */
+void Shout::set_nonblocking(bool unblocking) {
+  this->check(shout_set_nonblocking(this->self, (unsigned int) unblocking));
+}
+
+/// true if libshout will use nonblocking I/O.
+bool Shout::get_nonblocking() {
+  return 1 == shout_get_nonblocking(this->self);
+}
+
+/// Number of bytes on the write queue (only makes sense in nonblocking mode).
+ssize_t Shout::queuelen() {
+    return shout_queuelen(this->self);
+}
+

Modified: experimental/dholth/shoutpy/shoutcc.h
===================================================================
--- experimental/dholth/shoutpy/shoutcc.h	2006-11-26 10:50:12 UTC (rev 12147)
+++ experimental/dholth/shoutpy/shoutcc.h	2006-11-26 22:18:31 UTC (rev 12148)
@@ -125,6 +125,11 @@
     int delay();
 
     void set_metadata(ShoutMetadata *metadata);
+
+    void set_nonblocking(bool unblocking);
+    bool get_nonblocking();
+
+    ssize_t queuelen();
 };
 
 /// Wrapper for shout_metadata_t, a dictionary-like metadata object.

Modified: experimental/dholth/shoutpy/shoutpy.cc
===================================================================
--- experimental/dholth/shoutpy/shoutpy.cc	2006-11-26 10:50:12 UTC (rev 12147)
+++ experimental/dholth/shoutpy/shoutpy.cc	2006-11-26 22:18:31 UTC (rev 12148)
@@ -1,4 +1,4 @@
-/* Boost.Python wrapper for libshout 2                                       */
+/* Boost.Python wrapper for libshout 2.2.2 or newer                          */
 /*                                                                           */
 /* This library is free software; you can redistribute it and/or             */
 /* modify it under the terms of the GNU Lesser General Public                */
@@ -120,6 +120,10 @@
 //                  "URL of a page describing this stream.")
     .add_property("user", &Shout::get_user, &Shout::set_user)
 //                  "Username for authenticating with the server.")
+    .add_property("nonblocking", &Shout::get_nonblocking, &Shout::set_nonblocking)
+//                  "Instruct shout to use nonblocking I/O. Must set before calling shout_open.")    
+    .add_property("queuelen", &Shout::queuelen)
+//                  "Number of bytes currently on the write queue (only makes sense in nonblocking mode)"    
     .def("get_audio_info", &Shout::get_audio_info,
          "x.get_audio_info(\"keyword\") -> value")
     .def("set_audio_info", &Shout::set_audio_info,



More information about the commits mailing list