lucene-pylucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r1058713 - in /lucene/pylucene/trunk/jcc: CHANGES jcc/python.py
Date Thu, 13 Jan 2011 19:31:15 GMT
Author: vajda
Date: Thu Jan 13 19:31:14 2011
New Revision: 1058713

URL: http://svn.apache.org/viewvc?rev=1058713&view=rev
Log:
 - fixed bug with --module using relative paths (Roman Chyla)

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

Modified: lucene/pylucene/trunk/jcc/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/CHANGES?rev=1058713&r1=1058712&r2=1058713&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/CHANGES (original)
+++ lucene/pylucene/trunk/jcc/CHANGES Thu Jan 13 19:31:14 2011
@@ -1,4 +1,9 @@
 
+Version 2.7 ->
+------------------
+ - fixed bug with --module using relative paths (Roman Chyla)
+ - 
+
 Version 2.6 -> 2.7
 ------------------
  - added 'IGNORE' to reserved word list

Modified: lucene/pylucene/trunk/jcc/jcc/python.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/trunk/jcc/jcc/python.py?rev=1058713&r1=1058712&r2=1058713&view=diff
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/python.py (original)
+++ lucene/pylucene/trunk/jcc/jcc/python.py Thu Jan 13 19:31:14 2011
@@ -1620,12 +1620,13 @@ def compile(env, jccPath, output, module
             copytree(resource, os.path.split(resource)[-1])
 
     packages = [moduleName]
+    package = [moduleName]
     if modules:
         for module in modules:
             if os.path.isdir(module):
                 def copytree(src, dst, is_package):
                     if is_package:
-                        packages.append('.'.join((moduleName, src.replace(os.path.sep, '.'))))
+                        packages.append('.'.join(package))
                     if not os.path.exists(dst):
                         os.mkdir(dst)
                     for name in os.listdir(src):
@@ -1636,13 +1637,17 @@ def compile(env, jccPath, output, module
                             continue
                         _dst = os.path.join(dst, name)
                         if os.path.isdir(_src):
+                            package.append(os.path.basename(_src))
                             copytree(_src, _dst, os.path.exists(os.path.join(_src, '__init__.py')))
+                            package.pop()
                         elif not is_package or name.endswith('.py'):
                             shutil.copy2(_src, _dst)
                 dst = modulePath
                 if os.path.exists(os.path.join(module, '__init__.py')):
                     dst = os.path.join(modulePath, os.path.basename(module))
+                    package.append(os.path.basename(module))
                     copytree(module, dst, True)
+                    package.pop()
                 else:
                     copytree(module, dst, False)
             else:



Mime
View raw message