[xiph-cvs] cvs commit: vorbis-python ChangeLog README setup.py

Andrew Catham Master of Python andrew at xiph.org
Mon Jan 21 17:58:19 PST 2002



andrew      02/01/21 17:58:19

  Modified:    .        ChangeLog README setup.py
  Log:
  Oops, I forgot to do a toplevel commit.

Revision  Changes    Path
1.7       +11 -0     vorbis-python/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/vorbis-python/ChangeLog,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ChangeLog	2001/12/09 19:47:07	1.6
+++ ChangeLog	2002/01/22 01:58:17	1.7
@@ -1,3 +1,14 @@
+2001-01-21  Andrew H. Chatham <andrew.chatham at duke.edu>
+	* pyvorbisinfo.c: Comment objects now store pointers to the
+	comment structures, not the structure itself. Helps with dealloc.
+	* pyvorbisinfo.c (write_comments), (py_comment_append_to),
+	(py_comment_write_to): Added
+	* pyvorbisinfo.c (py_comment_assign): Catch del on a comment
+	object. Returns not implemented exception for now
+	* README: Explain how to use comments
+	* vcedit.h Copied in from vorbiscomment
+	* vcedit.c: Copied in from vorbiscomment
+	
 2001-12-09  Andrew H. Chatham <andrew.chatham at duke.edu>
         * config_unix.py: Better logging and finer-grained path arguments
         

<p><p>1.3       +37 -0     vorbis-python/README

Index: README
===================================================================
RCS file: /usr/local/cvsroot/vorbis-python/README,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- README	2001/12/09 19:47:07	1.2
+++ README	2002/01/22 01:58:17	1.3
@@ -48,3 +48,40 @@
 twice as slow if you're using my test enc.py file. It can probably
 stand some speedup, though.
 
+
+
+Vorbis Comment
+--------------
+
+A frequent question is how to edit and then write comments. This was
+not possible until recently. To implement this, I have taken the code
+from the vorbiscomment program, which is by Michael Smith and released
+under the LGPL. It has not been modified by me (Andrew).
+
+The comment structure is a lot like a Python dictionary, with a few
+changes. First, there can be multiple entries per key, because that's
+how vorbis comments work. So I might do:
+
+>>> import ogg.vorbis
+>>> v = ogg.vorbis.VorbisComment()
+>>> v['mykey'] = 'myval1'
+>>> v['mykey'] = 'myval2'
+>>> print v.items()
+[('MYKEY', 'myval1'), ('MYKEY', 'myval2')]
+>>> print v['mykey']
+['myval1', 'myval2']
+
+Each entry in the "dictionary" is a list of values. Each key is
+treated as case-insensitive. If you use Python >= 1.6, the values (but
+not keys) will be unicode strings. Note that I have not yet
+implemented deleting a key, since I have yet to find a good way to
+implement this.
+
+You can also get the comments from an existing file by opening that
+file as a VorbisFile object and then calling .comment() on it. This is
+treated the same way as above.
+
+To write the comments to an existing ogg/vorbis file, call v.write_to
+or v.append_to. The former will add lots of keys, so if you already
+have an artist key, and you add another, you now have two arist keys
+in that file.

<p><p>1.4       +1 -0      vorbis-python/setup.py

Index: setup.py
===================================================================
RCS file: /usr/local/cvsroot/vorbis-python/setup.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- setup.py	2001/09/02 18:21:12	1.3
+++ setup.py	2002/01/22 01:58:17	1.4
@@ -53,6 +53,7 @@
                                   'src/pyvorbisfile.c',
                                   'src/pyvorbiscodec.c',
                                   'src/pyvorbisinfo.c',
+                                  'src/vcedit.c',
                                   'src/general.c'],
                          define_macros = [('VERSION', '"%s"' % pyvorbis_version)],
                          include_dirs=[vorbis_include_dir,

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list