def convert_enum_names(enums):
res={}
- for (typ, name, values) in enums:
+ for (typ, name, values, comment) in enums:
if typ != 'enum':
raise Exception('This method only handles enums')
pyname=re.findall('(libvlc|mediacontrol)_(.+?)(_t)?$', name)[0][1]
return res
def generate_enums(enums):
- for (typ, name, values) in enums:
+ for (typ, name, values, comment) in enums:
if typ != 'enum':
raise Exception('This method only handles enums')
pyname=typ2class[name]
print "class %s(ctypes.c_uint):" % pyname
+ print ' """%s\n """' % comment
conv={}
# Convert symbol names
"""Parse include file for typedef expressions.
This generates a tuple for each typedef:
- (type, name, value_list)
+ (type, name, value_list, comment)
with type == 'enum' (for the moment) and value_list being a list of (name, value)
Note that values are string, since this is intended for code generation.
"""
else:
if l:
values.append( (l, str(i)) )
- yield (typ, name, values)
+ comment=comment.replace('@{', '').replace('@see', 'See').replace('\ingroup', '')
+ yield (typ, name, values, comment)
+ comment=''
def parse_include(name):
"""Parse include file.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
#
+"""This module provides bindings for the
+U{libvlc<http://wiki.videolan.org/ExternalAPI>} and
+U{MediaControl<http://wiki.videolan.org/MediaControlAPI>} APIs.
+
+You can find documentation at U{http://www.advene.org/download/python-ctypes/}.
+
+Basically, the most important class is L{Instance}, which is used to
+create a libvlc Instance. From this instance, you can then create
+L{MediaPlayer} and L{MediaListPlayer} instances.
+"""
+
import ctypes
import sys