Page MenuHomeFreeBSD

D5967.id15235.diff
No OneTemporary

D5967.id15235.diff

Index: audio/Makefile
===================================================================
--- audio/Makefile
+++ audio/Makefile
@@ -584,6 +584,7 @@
SUBDIR += p5-libvorbis
SUBDIR += p5-tagged
SUBDIR += p5-xmms2
+ SUBDIR += py-soundcloud
SUBDIR += pacpl
SUBDIR += paman
SUBDIR += paprefs
Index: audio/py-soundcloud/Makefile
===================================================================
--- /dev/null
+++ audio/py-soundcloud/Makefile
@@ -0,0 +1,30 @@
+# Created by: Bernard Spil <brnrd@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= soundcloud
+PORTVERSION= 0.5.0
+CATEGORIES= audio devel www python
+MASTER_SITES= CHEESESHOP
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= Bernard Spil <brnrd@FreeBSD.org>
+COMMENT= A friendly wrapper library for the Soundcloud API
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}nose>=1.1.2:devel/py-nose
+
+USES= python
+USE_PYTHON= autoplist distutils
+
+PORTDOCS= README.rst
+
+post-install:
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_MAN} ${WRKSRC}/README.rst ${STAGEDIR}${DOCSDIR}
+
+do-test:
+ cd ${WRKSRC} ; nosetests --with-doctest
+
+.include <bsd.port.mk>
Index: audio/py-soundcloud/distinfo
===================================================================
--- /dev/null
+++ audio/py-soundcloud/distinfo
@@ -0,0 +1,2 @@
+SHA256 (soundcloud-0.5.0.tar.gz) = aad2003592cec945f835f158f7b41ba8bf805c5738a2fcc5629668ea1df653d5
+SIZE (soundcloud-0.5.0.tar.gz) = 10861
Index: audio/py-soundcloud/pkg-descr
===================================================================
--- /dev/null
+++ audio/py-soundcloud/pkg-descr
@@ -0,0 +1,79 @@
+================= soundcloud-python ================= .. image:: https
+://travis-ci.org/soundcloud/soundcloud-python.svg :target: https://travis-
+ci.org/soundcloud/soundcloud-python A friendly wrapper around the `Soundcloud
+API`_. .. _Soundcloud API: http://developers.soundcloud.com/ Installation
+------------ To install soundcloud-python, simply: :: pip install
+soundcloud Or if you're not hip to the pip: :: easy_install soundcloud
+Basic Use --------- To use soundcloud-python, you must first create a `Client`
+instance, passing at a minimum the client id you obtained when you `registered
+your app`_: :: import soundcloud client =
+soundcloud.Client(client_id=YOUR_CLIENT_ID) The client instance can then be
+used to fetch or modify resources: :: tracks = client.get('/tracks',
+limit=10) for track in tracks: print track.title app =
+client.get('/apps/124') print app.permalink_url .. _registered your app:
+http://soundcloud.com/you/apps/ Authentication -------------- All `OAuth2
+authorization flows`_ supported by the Soundcloud API are available in
+soundcloud-python. If you only need read-only access to public resources, simply
+provide a client id when creating a `Client` instance: :: import soundcloud
+client = soundcloud.Client(client_id=YOUR_CLIENT_ID) track =
+client.get('/tracks/30709985') print track.title If however, you need to
+access private resources or modify a resource, you will need to have a user
+delegate access to your application. To do this, you can use one of the
+following OAuth2 authorization flows. **Authorization Code Flow** The
+`Authorization Code Flow`_ involves redirecting the user to soundcloud.com where
+they will log in and grant access to your application: :: import soundcloud
+client = soundcloud.Client( client_id=YOUR_CLIENT_ID,
+client_secret=YOUR_CLIENT_SECRET,
+redirect_uri='http://yourapp.com/callback' )
+redirect(client.authorize_url()) Note that `redirect_uri` must match the value
+you provided when you registered your application. After granting access, the
+user will be redirected to this uri, at which point your application can
+exchange the returned code for an access token: :: access_token, expires,
+scope, refresh_token = client.exchange_token(
+code=request.args.get('code')) render_text("Hi There, %s" %
+client.get('/me').username) **User Credentials Flow** The `User Credentials
+Flow`_ allows you to exchange a username and password for an access token. Be
+cautious about using this flow, it's not very kind to ask your users for their
+password, but may be necessary in some use cases: :: import soundcloud
+client = soundcloud.Client( client_id=YOUR_CLIENT_ID,
+client_secret=YOUR_CLIENT_SECRET, username='jane@example.com',
+password='janespassword' ) print client.get('/me').username .. _`OAuth2
+authorization flows`: http://developers.soundcloud.com/docs/api/authentication
+.. _`Authorization Code Flow`:
+http://developers.soundcloud.com/docs/api/authentication#user-agent-flow ..
+_`User Credentials Flow`:
+http://developers.soundcloud.com/docs/api/authentication#user-credentials-flow
+Examples -------- Resolve a track and print its id: :: import soundcloud
+client = soundcloud.Client(client_id=YOUR_CLIENT_ID) track =
+client.get('/resolve', url='http://soundcloud.com/forss/flickermood') print
+track.id Upload a track: :: import soundcloud client =
+soundcloud.Client(access_token="a valid access token") track =
+client.post('/tracks', track={ 'title': 'This is a sample track',
+'sharing': 'private', 'asset_data': open('mytrack.mp4', 'rb') })
+print track.title Start following a user: :: import soundcloud client
+= soundcloud.Client(access_token="a valid access token") user_id_to_follow =
+123 client.put('/me/followings/%d' % user_id_to_follow) Update your profile
+description: :: import soundcloud client =
+soundcloud.Client(access_token="a valid access token") client.put('/me',
+user={ 'description': "a new description" }) Proxy Support
+------------- If you're behind a proxy, you can specify it when creating a
+client: :: import soundcloud proxies = { 'http':
+'example.com:8000' } client = soundcloud.Client(access_token="a valid
+access token", proxies=proxies) The proxies
+kwarg is a dictionary with protocols as keys and host:port as values. Redirects
+--------- By default, 301 or 302 redirects will be followed for idempotent
+methods. There are certain cases where you may want to disable this, for
+example: :: import soundcloud client =
+soundcloud.Client(access_token="a valid access token") track =
+client.get('/tracks/293/stream', allow_redirects=False) print track.location
+Will print a tracks streaming URL. If ``allow_redirects`` was omitted, a binary
+stream would be returned instead. Running Tests ------------- To run the
+tests, run: :: $ pip install -r requirements.txt $ nosetests --with-
+doctest .................. Success! Contributing ------------
+Contributions are awesome. You are most welcome to `submit issues`_, or `fork
+the repository`_. soundcloud-python is published under a `BSD License`_. ..
+_`submit issues`: https://github.com/soundcloud/soundcloud-python/issues ..
+_`fork the repository`: https://github.com/soundcloud/soundcloud-python .. _`BSD
+License`: https://github.com/soundcloud/soundcloud-python/blob/master/README
+
+WWW: https://github.com/soundcloud/soundcloud-python

File Metadata

Mime Type
text/plain
Expires
Wed, Aug 19, 1:55 PM (8 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36875893
Default Alt Text
D5967.id15235.diff (7 KB)

Event Timeline