From: Frank W. <fwi...@us...> - 2005-11-05 15:23:11
|
Update of /cvsroot/jython/jython/org/python/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4254/org/python/core Modified Files: PrecompiledImporter.java Log Message: reformat Index: PrecompiledImporter.java =================================================================== RCS file: /cvsroot/jython/jython/org/python/core/PrecompiledImporter.java,v retrieving revision 2.1 retrieving revision 2.2 diff -C2 -d -r2.1 -r2.2 *** PrecompiledImporter.java 24 Jun 2005 01:10:17 -0000 2.1 --- PrecompiledImporter.java 5 Nov 2005 15:23:03 -0000 2.2 *************** *** 3,7 **** /** * An importer for classes pre-compiled with JythonC. ! * */ public class PrecompiledImporter extends PyObject { --- 3,7 ---- /** * An importer for classes pre-compiled with JythonC. ! * */ public class PrecompiledImporter extends PyObject { *************** *** 13,18 **** /** * Find the module for the fully qualified name. * @param name the fully qualified name of the module ! * @return a loader instance if this importer can load the module, None otherwise */ public PyObject find_module(String name) { --- 13,20 ---- /** * Find the module for the fully qualified name. + * * @param name the fully qualified name of the module ! * @return a loader instance if this importer can load the module, None ! * otherwise */ public PyObject find_module(String name) { *************** *** 22,44 **** /** * Find the module for the fully qualified name. * @param name the fully qualified name of the module * @param path if installed on the meta-path None or a module path ! * @return a loader instance if this importer can load the module, None otherwise */ public PyObject find_module(String name, PyObject path) { if (Py.frozenModules != null) { ! //System.out.println("precomp: "+name+", "+name); Class c = null; ! if (Py.frozenModules.get(name+".__init__") != null) { ! //System.err.println("trying: "+name+".__init__$_PyInner"); ! Py.writeDebug("import", "trying " + name + " as precompiled package"); ! c = findPyClass(name+".__init__"); if (c == null) { return Py.None; } ! //System.err.println("found: "+name+".__init__$_PyInner"); return new PrecompiledLoader(c, true); } else if (Py.frozenModules.get(name) != null) { ! Py.writeDebug("import", "trying " + name + " as precompiled module"); c = findPyClass(name); if (c == null) { --- 24,50 ---- /** * Find the module for the fully qualified name. + * * @param name the fully qualified name of the module * @param path if installed on the meta-path None or a module path ! * @return a loader instance if this importer can load the module, None ! * otherwise */ public PyObject find_module(String name, PyObject path) { if (Py.frozenModules != null) { ! // System.out.println("precomp: "+name+", "+name); Class c = null; ! if (Py.frozenModules.get(name + ".__init__") != null) { ! // System.err.println("trying: "+name+".__init__$_PyInner"); ! Py.writeDebug("import", "trying " + name ! + " as precompiled package"); ! c = findPyClass(name + ".__init__"); if (c == null) { return Py.None; } ! // System.err.println("found: "+name+".__init__$_PyInner"); return new PrecompiledLoader(c, true); } else if (Py.frozenModules.get(name) != null) { ! Py.writeDebug("import", "trying " + name ! + " as precompiled module"); c = findPyClass(name); if (c == null) { *************** *** 53,57 **** /** * Returns a string representation of the object. ! * * @return a string representation of the object. */ --- 59,63 ---- /** * Returns a string representation of the object. ! * * @return a string representation of the object. */ *************** *** 63,66 **** --- 69,73 ---- private Class _class; + private boolean _package; *************** *** 71,75 **** public PyObject load_module(String name) { ! if(this._package) { PyModule m = imp.addModule(name); m.__dict__.__setitem__("__path__", new PyList()); --- 78,82 ---- public PyObject load_module(String name) { ! if (this._package) { PyModule m = imp.addModule(name); m.__dict__.__setitem__("__path__", new PyList()); *************** *** 77,81 **** } Py.writeComment("import", "'" + name + "' as precompiled " ! + (this._package ? "package" : "module")); return imp.createFromClass(name, this._class); } --- 84,88 ---- } Py.writeComment("import", "'" + name + "' as precompiled " ! + (this._package ? "package" : "module")); return imp.createFromClass(name, this._class); } *************** *** 83,87 **** /** * Returns a string representation of the object. ! * * @return a string representation of the object. */ --- 90,94 ---- /** * Returns a string representation of the object. ! * * @return a string representation of the object. */ *************** *** 93,99 **** private Class findPyClass(String name) { if (Py.frozenPackage != null) { ! name = Py.frozenPackage+"."+name; } ! return Py.findClassEx(name+"$_PyInner", "precompiled"); } } --- 100,106 ---- private Class findPyClass(String name) { if (Py.frozenPackage != null) { ! name = Py.frozenPackage + "." + name; } ! return Py.findClassEx(name + "$_PyInner", "precompiled"); } } |