Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
96cf477d
Commit
96cf477d
authored
Jul 31, 2009
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python-ctypes: do not redefine overridden methods
parent
a5dc39cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
bindings/python-ctypes/generate.py
bindings/python-ctypes/generate.py
+12
-4
No files found.
bindings/python-ctypes/generate.py
View file @
96cf477d
...
@@ -429,14 +429,18 @@ def parse_override(name):
...
@@ -429,14 +429,18 @@ def parse_override(name):
if m:
if m:
# Dump old data
# Dump old data
if current is not None:
if current is not None:
res[current]="
\
n
".join(data)
res[current]="".join(data)
current=m.group(1)
current=m.group(1)
data=[]
data=[]
continue
continue
data.append(l)
data.append(l)
res[current]="
\
n
".join(data)
res[current]="".join(data)
f.close()
f.close()
return res
# Not robust wrt. internal methods, but this works for the moment.
overriden_methods=dict( (k, re.findall('
^
\
s
+
def
\
s
+
(
\
w
+
)
', v)) for (k, v) in res.iteritems() )
return res, overriden_methods
def fix_python_comment(c):
def fix_python_comment(c):
"""Fix comment by removing first and last parameters (self and exception)
"""Fix comment by removing first and last parameters (self and exception)
...
@@ -466,7 +470,7 @@ def generate_wrappers(methods):
...
@@ -466,7 +470,7 @@ def generate_wrappers(methods):
),
),
key=operator.itemgetter(0))
key=operator.itemgetter(0))
overrides=parse_override('
override
.
py
')
overrides
, overriden_methods
=parse_override('
override
.
py
')
for classname, el in itertools.groupby(elements, key=operator.itemgetter(0)):
for classname, el in itertools.groupby(elements, key=operator.itemgetter(0)):
print """
print """
...
@@ -501,6 +505,10 @@ class %(name)s(object):
...
@@ -501,6 +505,10 @@ class %(name)s(object):
# Strip prefix
# Strip prefix
name=method.replace(prefix, '').replace('
libvlc_
', '')
name=method.replace(prefix, '').replace('
libvlc_
', '')
ret.add(method)
ret.add(method)
if name in overriden_methods.get(cl, []):
# Method already defined in override.py
continue
if params:
if params:
params[0]=(params[0][0], '
self
')
params[0]=(params[0][0], '
self
')
if params and params[-1][0] in ('
libvlc_exception_t
*
', '
mediacontrol_Exception
*
'):
if params and params[-1][0] in ('
libvlc_exception_t
*
', '
mediacontrol_Exception
*
'):
...
...
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