[[nbpython-commits]] [hg] main/contrib: Python: Fix bug in handling jar urls (inside ...

  • From: Tor Norbye < >
  • To:
  • Subject: [[nbpython-commits]] [hg] main/contrib: Python: Fix bug in handling jar urls (inside ...
  • Date: Thu, 21 Oct 2010 08:34:43 -0700

changeset e3ad3fbe3760 in main/contrib
details: http://hg.netbeans.org/main/contrib?cmd=changeset;node=e3ad3fbe3760
description:
        Python: Fix bug in handling jar urls (inside .egg files) which 
resulted in code completion documentation for the builtin standard library 
apis all missing

diffstat:

 python.editor/external/binaries-list                                    |   
2 +-
 python.editor/nbproject/project.properties                              |   
2 +-
 python.editor/src/org/netbeans/modules/python/editor/PythonIndex.java   |  
10 ++
 python.editor/src/org/netbeans/modules/python/editor/PythonIndexer.java |  
50 +++++----
 python.kit/manifest.mf                                                  |   
2 +-
 python.kit/nbproject/project.xml                                        |   
2 +-
 6 files changed, 40 insertions(+), 28 deletions(-)

diffs (145 lines):

diff --git a/python.editor/external/binaries-list 
b/python.editor/external/binaries-list
--- a/python.editor/external/binaries-list
+++ b/python.editor/external/binaries-list
@@ -1,2 +1,2 @@
 DF35EF03CB787EC41501381E3146BF42C6C9CA9A pythonstubs-2_6_1.egg
-8450BC2D07654595D896998BACCC530716530885 preindexed.zip
+6AE5565081BE766488E1FE13415C08324AB80860 preindexed.zip
diff --git a/python.editor/nbproject/project.properties 
b/python.editor/nbproject/project.properties
--- a/python.editor/nbproject/project.properties
+++ b/python.editor/nbproject/project.properties
@@ -18,7 +18,7 @@
 javac.source=1.6
 javac.compilerargs=-Xlint -Xlint:-serial
 nbm.needs.restart=true
-spec.version.base=1.5.0
+spec.version.base=1.6.0
 spec.version.base.fatal.warning=false
 
 ant.jar=${ant.core.lib}
diff --git 
a/python.editor/src/org/netbeans/modules/python/editor/PythonIndex.java 
b/python.editor/src/org/netbeans/modules/python/editor/PythonIndex.java
--- a/python.editor/src/org/netbeans/modules/python/editor/PythonIndex.java
+++ b/python.editor/src/org/netbeans/modules/python/editor/PythonIndex.java
@@ -1374,6 +1374,13 @@
             return CLUSTER_URL + url.substring(s.length());
         }
 
+        if (url.startsWith("jar:file:")) { // NOI18N
+           String sub = url.substring(4);
+            if (sub.startsWith(s)) {
+                return CLUSTER_URL + sub.substring(s.length());
+            }
+        }
+
         return url;
     }
 
@@ -1424,6 +1431,9 @@
                 return null;
             } else if (url.startsWith(CLUSTER_URL)) {
                 url = getClusterUrl() + url.substring(CLUSTER_URL.length()); 
// NOI18N
+                if (url.indexOf(".egg!/") != -1) { // NOI18N
+                    url = "jar:" + url; // NOI18N
+                }
             }
 
             return URLMapper.findFileObject(new URL(url));
diff --git 
a/python.editor/src/org/netbeans/modules/python/editor/PythonIndexer.java 
b/python.editor/src/org/netbeans/modules/python/editor/PythonIndexer.java
--- a/python.editor/src/org/netbeans/modules/python/editor/PythonIndexer.java
+++ b/python.editor/src/org/netbeans/modules/python/editor/PythonIndexer.java
@@ -191,7 +191,7 @@
     }
 
     public String getIndexVersion() {
-        return "0.121"; // NOI18N
+        return "0.123"; // NOI18N
     }
 
     public String getIndexerName() {
@@ -1180,30 +1180,32 @@
             }
         }
 
-        if (namesFound.size() > 0) {
-            StringBuilder sb = new StringBuilder();
-            sb.append("FOUND for ");
-            sb.append(clz);
-            sb.append(" in ");
-            sb.append(module);
-            sb.append(": ");
-            appendList(sb, namesFound);
-            System.err.println(sb.toString());
-        }
+        if (PREINDEXING) {
+            if (namesFound.size() > 0) {
+                StringBuilder sb = new StringBuilder();
+                sb.append("FOUND for ");
+                sb.append(clz);
+                sb.append(" in ");
+                sb.append(module);
+                sb.append(": ");
+                appendList(sb, namesFound);
+                System.err.println(sb.toString());
+            }
 
-        if (noneFound && search) {
-            System.err.println("ERROR: NONE of the passed in names for " + 
clz + " were found!");
-        }
+            if (noneFound && search) {
+                System.err.println("ERROR: NONE of the passed in names for " 
+ clz + " were found!");
+            }
 
-        if (namesMissing.size() > 0) {
-            StringBuilder sb = new StringBuilder();
-            sb.append("WARNING: Missing these names from ");
-            sb.append(module);
-            sb.append(" for use by class ");
-            sb.append(clz);
-            sb.append(" : ");
-            appendList(sb, namesMissing);
-            System.err.println(sb.toString());
+            if (namesMissing.size() > 0) {
+                StringBuilder sb = new StringBuilder();
+                sb.append("WARNING: Missing these names from ");
+                sb.append(module);
+                sb.append(" for use by class ");
+                sb.append(clz);
+                sb.append(" : ");
+                appendList(sb, namesMissing);
+                System.err.println(sb.toString());
+            }
         }
     }
 
@@ -1276,7 +1278,7 @@
             String s = fo.getURL().toExternalForm() + "!"; // NOI18N
             URL u = new URL("jar:" + s); // NOI18N
             FileObject root = URLMapper.findFileObject(u);
-            String rootUrl = u.toExternalForm();
+            String rootUrl = PythonIndex.getPreindexUrl(u.toExternalForm());
             indexScriptDocRecursively(factory, documents, root, rootUrl);
         } catch (FileStateInvalidException ex) {
             Exceptions.printStackTrace(ex);
diff --git a/python.kit/manifest.mf b/python.kit/manifest.mf
--- a/python.kit/manifest.mf
+++ b/python.kit/manifest.mf
@@ -1,6 +1,6 @@
 Manifest-Version: 1.0
 OpenIDE-Module: org.netbeans.modules.python.kit/1
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/modules/python/kit/Bundle.properties
-OpenIDE-Module-Specification-Version: 0.104
+OpenIDE-Module-Specification-Version: 0.105
 AutoUpdate-Show-In-Client: true
 
diff --git a/python.kit/nbproject/project.xml 
b/python.kit/nbproject/project.xml
--- a/python.kit/nbproject/project.xml
+++ b/python.kit/nbproject/project.xml
@@ -46,7 +46,7 @@
                 <dependency>
                     
<code-name-base>org.netbeans.modules.python.editor</code-name-base>
                     <run-dependency>
-                        <specification-version>1.5</specification-version>
+                        <specification-version>1.6</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>

[[nbpython-commits]] [hg] main/contrib: Python: Fix bug in handling jar urls (inside ...

Tor Norbye 10/21/2010

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close