Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-ui-redesign
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
Gautam Chitnis
web-ui-redesign
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):
if
m
:
# Dump old data
if
current
is
not
None
:
res
[
current
]
=
"
\n
"
.
join
(
data
)
res
[
current
]
=
""
.
join
(
data
)
current
=
m
.
group
(
1
)
data
=
[]
continue
data
.
append
(
l
)
res
[
current
]
=
"
\n
"
.
join
(
data
)
res
[
current
]
=
""
.
join
(
data
)
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
):
"""Fix comment by removing first and last parameters (self and exception)
...
...
@@ -466,7 +470,7 @@ def generate_wrappers(methods):
),
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
)):
print
"""
...
...
@@ -501,6 +505,10 @@ class %(name)s(object):
# Strip prefix
name
=
method
.
replace
(
prefix
,
''
).
replace
(
'libvlc_'
,
''
)
ret
.
add
(
method
)
if
name
in
overriden_methods
.
get
(
cl
,
[]):
# Method already defined in override.py
continue
if
params
:
params
[
0
]
=
(
params
[
0
][
0
],
'self'
)
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