lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1421652 - in /lucene/pylucene/trunk/jcc: CHANGES jcc/cpp.py
Date Fri, 14 Dec 2012 03:30:01 GMT
Author: vajda
Date: Fri Dec 14 03:29:58 2012
New Revision: 1421652

URL: http://svn.apache.org/viewvc?rev=1421652&view=rev
Log:
 - added support for wrapping non-public methods by listing them as class:method

Modified:
    lucene/pylucene/trunk/jcc/CHANGES
    lucene/pylucene/trunk/jcc/jcc/cpp.py

Modified: lucene/pylucene/trunk/jcc/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/CHANGES?rev=1421652&r1=1421651&r2=1421652&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/CHANGES (original)
+++ lucene/pylucene/trunk/jcc/CHANGES Fri Dec 14 03:29:58 2012
@@ -2,6 +2,7 @@ Version 2.14 ->
 --------------------
  - improved JCC build on Linux by mokey patching setuptools (Caleb Burns)
  - fixed bug with wrapping arrays coming out of generic iterators
+ - added support for wrapping non-public methods by listing them as class:method
  - 
 
 Version 2.13 -> 2.14

Modified: lucene/pylucene/trunk/jcc/jcc/cpp.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/cpp.py?rev=1421652&r1=1421651&r2=1421652&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/cpp.py (original)
+++ lucene/pylucene/trunk/jcc/jcc/cpp.py Fri Dec 14 03:29:58 2012
@@ -343,6 +343,7 @@ def jcc(args):
 
     classNames = set()
     listedClassNames = set()
+    listedMethodNames = {}
     packages = set()
     jars = []
     classpath = [_jcc.CLASSPATH]
@@ -504,6 +505,9 @@ def jcc(args):
             else:
                 raise ValueError, "Invalid argument: %s" %(arg)
         else:
+            if ':' in arg:
+                arg, method = arg.split(':', 1)
+                listedMethodNames.setdefault(arg, set()).add(method)
             classNames.add(arg)
             listedClassNames.add(arg)
         i += 1
@@ -634,7 +638,8 @@ def jcc(args):
                 (superCls, constructors, methods, protectedMethods,
                  methodNames, fields, instanceFields, declares) = \
                     header(env, out_h, cls, typeset, packages, excludes,
-                           generics, _dll_export)
+                           generics, listedMethodNames.get(cls.getName(), ()),
+                           _dll_export)
 
                 if not allInOne:
                     out_cpp = file(fileName + '.cpp', 'w')
@@ -693,7 +698,8 @@ def jcc(args):
                         extra_setup_args)
 
 
-def header(env, out, cls, typeset, packages, excludes, generics, _dll_export):
+def header(env, out, cls, typeset, packages, excludes, generics,
+           listedMethodNames, _dll_export):
 
     names = cls.getName().split('.')
     superCls = cls.getSuperclass()
@@ -771,7 +777,8 @@ def header(env, out, cls, typeset, packa
     protectedMethods = []
     for method in cls.getDeclaredMethods():
         modifiers = method.getModifiers()
-        if Modifier.isPublic(modifiers):
+        if (Modifier.isPublic(modifiers) or
+            method.getName() in listedMethodNames):
             if generics:
                 returnType = method.getGenericReturnType()
             else:



Mime
View raw message