Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
f60c1042
Commit
f60c1042
authored
Jul 31, 2009
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python-ctypes: improve documentation generation
parent
5e94dabf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
bindings/python-ctypes/generate.py
bindings/python-ctypes/generate.py
+7
-4
bindings/python-ctypes/header.py
bindings/python-ctypes/header.py
+11
-0
bindings/python-ctypes/override.py
bindings/python-ctypes/override.py
+4
-0
No files found.
bindings/python-ctypes/generate.py
View file @
f60c1042
...
...
@@ -207,7 +207,7 @@ def generate_header(classes=None):
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]
...
...
@@ -219,12 +219,13 @@ def convert_enum_names(enums):
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
...
...
@@ -255,7 +256,7 @@ def parse_typedef(name):
"""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.
"""
...
...
@@ -298,7 +299,9 @@ def parse_typedef(name):
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.
...
...
bindings/python-ctypes/header.py
View file @
f60c1042
...
...
@@ -22,6 +22,17 @@
# 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
...
...
bindings/python-ctypes/override.py
View file @
f60c1042
...
...
@@ -103,6 +103,8 @@ class MediaPlayer:
return
o
def
get_instance
(
self
):
"""Return the associated vlc.Instance.
"""
return
self
.
_instance
class
MediaListPlayer
:
...
...
@@ -131,6 +133,8 @@ class MediaListPlayer:
return
o
def
get_instance
(
self
):
"""Return the associated vlc.Instance.
"""
return
self
.
_instance
class
LogIterator
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment