119 if ext in __extensions["Ruby"]: |
119 if ext in __extensions["Ruby"]: |
120 for p in path: # only search in path |
120 for p in path: # only search in path |
121 pathname = os.path.join(p, name) |
121 pathname = os.path.join(p, name) |
122 if os.path.exists(pathname): |
122 if os.path.exists(pathname): |
123 return (open(pathname), pathname, (ext, 'r', RB_SOURCE)) |
123 return (open(pathname), pathname, (ext, 'r', RB_SOURCE)) |
|
124 # __IGNORE_WARNING_Y115__ |
124 raise ImportError |
125 raise ImportError |
125 |
126 |
126 elif ext in __extensions["IDL"]: |
127 elif ext in __extensions["IDL"]: |
127 for p in path: # only search in path |
128 for p in path: # only search in path |
128 pathname = os.path.join(p, name) |
129 pathname = os.path.join(p, name) |
129 if os.path.exists(pathname): |
130 if os.path.exists(pathname): |
130 return (open(pathname), pathname, (ext, 'r', IDL_SOURCE)) |
131 return (open(pathname), pathname, (ext, 'r', IDL_SOURCE)) |
|
132 # __IGNORE_WARNING_Y115__ |
131 raise ImportError |
133 raise ImportError |
132 |
134 |
133 elif ext in __extensions["ProtoBuf"]: |
135 elif ext in __extensions["ProtoBuf"]: |
134 for p in path: # only search in path |
136 for p in path: # only search in path |
135 pathname = os.path.join(p, name) |
137 pathname = os.path.join(p, name) |
136 if os.path.exists(pathname): |
138 if os.path.exists(pathname): |
137 return (open(pathname), pathname, (ext, 'r', PROTO_SOURCE)) |
139 return (open(pathname), pathname, (ext, 'r', PROTO_SOURCE)) |
|
140 # __IGNORE_WARNING_Y115__ |
138 raise ImportError |
141 raise ImportError |
139 |
142 |
140 elif ext in __extensions["JavaScript"]: |
143 elif ext in __extensions["JavaScript"]: |
141 for p in path: # only search in path |
144 for p in path: # only search in path |
142 pathname = os.path.join(p, name) |
145 pathname = os.path.join(p, name) |
143 if os.path.exists(pathname): |
146 if os.path.exists(pathname): |
144 return (open(pathname), pathname, (ext, 'r', JS_SOURCE)) |
147 return (open(pathname), pathname, (ext, 'r', JS_SOURCE)) |
|
148 # __IGNORE_WARNING_Y115__ |
145 raise ImportError |
149 raise ImportError |
146 |
150 |
147 elif ext == '.ptl': |
151 elif ext == '.ptl': |
148 for p in path: # only search in path |
152 for p in path: # only search in path |
149 pathname = os.path.join(p, name) |
153 pathname = os.path.join(p, name) |
150 if os.path.exists(pathname): |
154 if os.path.exists(pathname): |
151 return (open(pathname), pathname, (ext, 'r', PTL_SOURCE)) |
155 return (open(pathname), pathname, (ext, 'r', PTL_SOURCE)) |
|
156 # __IGNORE_WARNING_Y115__ |
152 raise ImportError |
157 raise ImportError |
153 |
158 |
154 elif ( |
159 elif ( |
155 name.lower().endswith( |
160 name.lower().endswith( |
156 tuple(Preferences.getPython("Python3Extensions"))) or |
161 tuple(Preferences.getPython("Python3Extensions"))) or |
158 ): |
163 ): |
159 for p in path: # search in path |
164 for p in path: # search in path |
160 pathname = os.path.join(p, name) |
165 pathname = os.path.join(p, name) |
161 if os.path.exists(pathname): |
166 if os.path.exists(pathname): |
162 return (open(pathname), pathname, (ext, 'r', PY_SOURCE)) |
167 return (open(pathname), pathname, (ext, 'r', PY_SOURCE)) |
|
168 # __IGNORE_WARNING_Y115__ |
163 raise ImportError |
169 raise ImportError |
164 |
170 |
165 # standard Python module file |
171 # standard Python module file |
166 if name.lower().endswith('.py'): |
172 if name.lower().endswith('.py'): |
167 name = name[:-3] |
173 name = name[:-3] |