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
356cf806
Commit
356cf806
authored
Jul 31, 2009
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python-ctypes: generate list methods when possible
parent
e9210428
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
bindings/python-ctypes/generate.py
bindings/python-ctypes/generate.py
+20
-0
No files found.
bindings/python-ctypes/generate.py
View file @
356cf806
...
@@ -520,6 +520,26 @@ class %(name)s(object):
...
@@ -520,6 +520,26 @@ class %(name)s(object):
else:
else:
print " return %s(%s)" % (method, args)
print " return %s(%s)" % (method, args)
print
print
# Check for standard methods
if name == '
count
':
# There is a count method. Generate a __len__ one.
print " def __len__(self):"
print " e=VLCException()"
print " return %s(self, e)" % method
print
elif name.endswith('
item_at_index
'):
# Indexable (and thus iterable)"
print " def __getitem__(self, i):"
print " e=VLCException()"
print " return %s(self, i, e)" % method
print
print " def __iter__(self):"
print " e=VLCException()"
print " for i in xrange(len(self)):"
print " yield self[i]"
print
return ret
return ret
if __name__ == '
__main__
':
if __name__ == '
__main__
':
...
...
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