[vlc-commits] commit: possible optimization, L{enum} handling (Jean Brouwers )

git at videolan.org git at videolan.org
Wed Dec 8 21:41:33 CET 2010


vlc/python | branch: master | Jean Brouwers <MrJean1 at Gmail.com> | Tue Dec  7 21:40:32 2010 -0800| [b54f8d3c123ceb5fb9a1e293e6d67d72e386b72d] | committer: Olivier Aubert 

possible optimization, L{enum} handling

Signed-off-by: Olivier Aubert <olivier.aubert at liris.cnrs.fr>

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=b54f8d3c123ceb5fb9a1e293e6d67d72e386b72d
---

 generate.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/generate.py b/generate.py
index 5614567..3e49b21 100755
--- a/generate.py
+++ b/generate.py
@@ -49,7 +49,7 @@ C{LibVlc-footer.java} and C{LibVlc-header.java}.
 __all__     = ('Parser',
                'PythonGenerator', 'JavaGenerator',
                'process')
-__version__ =  '20.10.12.05'
+__version__ =  '20.10.12.07'
 
 _debug = False
 
@@ -735,6 +735,10 @@ class PythonGenerator(_Generator):
         self.type2class['libvlc_event_e'] = 'EventType'
          # doc links to functions, methods and types
         self.links = {'libvlc_event_e': 'EventType'}
+         # link enum value names to enum type/class
+##      for t in self.parser.enums:
+##          for v in t.vals:
+##              self.links[v.enum] = t.name
          # prefixes to strip from method names
          # when wrapping them into class methods
         self.prefixes = {}
@@ -784,6 +788,9 @@ class PythonGenerator(_Generator):
     f = _Cfunctions.get('%(name)s', None) or \\
         _Cfunction('%(name)s', (%(flags)s),
                     %(types)s)
+    if not __debug__:  # i.e. python -O or -OO
+        global %(name)s
+        %(name)s = f
     return f(%(args)s)
 """ % locals())
 



More information about the vlc-commits mailing list