##// END OF EJS Templates
updated comments. removed debug print statement
kd2718 -
Show More
@@ -212,14 +212,13 b' class OSMagics(Magics):'
212 # write the whole loop for posix/Windows so we don't have an if in
212 # write the whole loop for posix/Windows so we don't have an if in
213 # the innermost part
213 # the innermost part
214 if self.is_posix:
214 if self.is_posix:
215 print(path)
216 for pdir in path:
215 for pdir in path:
217 try:
216 try:
218 os.chdir(pdir)
217 os.chdir(pdir)
219 except OSError:
218 except OSError:
220 continue
219 continue
221
220
222 # use with notation for python 3.6 onward
221 # for python 3.6+ rewrite to: with os.scandir(pdir) as dirlist:
223 dirlist = os.scandir(path=pdir)
222 dirlist = os.scandir(path=pdir)
224 for ff in dirlist:
223 for ff in dirlist:
225 if self.isexec(ff):
224 if self.isexec(ff):
@@ -242,7 +241,7 b' class OSMagics(Magics):'
242 except OSError:
241 except OSError:
243 continue
242 continue
244
243
245 # use with notation for python 3.6 onward
244 # for python 3.6+ rewrite to: with os.scandir(pdir) as dirlist:
246 dirlist = os.scandir(pdir)
245 dirlist = os.scandir(pdir)
247 for ff in dirlist:
246 for ff in dirlist:
248 fname = ff.name
247 fname = ff.name
@@ -258,6 +257,7 b' class OSMagics(Magics):'
258 except InvalidAliasError:
257 except InvalidAliasError:
259 pass
258 pass
260 syscmdlist.append(fname)
259 syscmdlist.append(fname)
260
261 self.shell.db['syscmdlist'] = syscmdlist
261 self.shell.db['syscmdlist'] = syscmdlist
262 finally:
262 finally:
263 os.chdir(savedir)
263 os.chdir(savedir)
@@ -98,7 +98,7 b' def list_profiles_in(path):'
98 """list profiles in a given root directory"""
98 """list profiles in a given root directory"""
99 profiles = []
99 profiles = []
100
100
101 # use with notation for python 3.6 onward
101 # for python 3.6+ rewrite to: with os.scandir(path) as dirlist:
102 files = os.scandir(path)
102 files = os.scandir(path)
103 for f in files:
103 for f in files:
104 if f.is_dir() and f.name.startswith('profile_'):
104 if f.is_dir() and f.name.startswith('profile_'):
@@ -111,7 +111,7 b' def list_bundled_profiles():'
111 path = os.path.join(get_ipython_package_dir(), u'core', u'profile')
111 path = os.path.join(get_ipython_package_dir(), u'core', u'profile')
112 profiles = []
112 profiles = []
113
113
114 # use with notation for python 3.6 onward
114 # for python 3.6+ rewrite to: with os.scandir(path) as dirlist:
115 files = os.scandir(path)
115 files = os.scandir(path)
116 for profile in files:
116 for profile in files:
117 if profile.is_dir() and profile.name != "__pycache__":
117 if profile.is_dir() and profile.name != "__pycache__":
General Comments 0
You need to be logged in to leave comments. Login now