##// END OF EJS Templates
updated to use os.walk instead of os.path.walk - os.path.walk is not supported in Python 3
Greg Caporaso -
Show More
@@ -4,7 +4,8 b' Authors : MinRK, gregcaporaso, dannystaple'
4 """
4 """
5 import urllib
5 import urllib
6
6
7 from os.path import exists, isfile, splitext, abspath, join, isdir, walk
7 from os.path import exists, isfile, splitext, abspath, join, isdir
8 from os import walk
8
9
9
10
10 class YouTubeVideo(object):
11 class YouTubeVideo(object):
@@ -249,12 +250,18 b' class FileLinks(FileLink):'
249
250
250 def _format_path(self):
251 def _format_path(self):
251 result_lines = []
252 result_lines = []
252 walk(self.path, self.notebook_display_formatter, result_lines)
253 walked_dir = list(walk(self.path))
254 walked_dir.sort()
255 for dirname, subdirs, fnames in walked_dir:
256 self.notebook_display_formatter(result_lines,dirname, fnames)
253 return '\n'.join(result_lines)
257 return '\n'.join(result_lines)
254
258
255 def __repr__(self):
259 def __repr__(self):
256 """return newline-separated absolute paths
260 """return newline-separated absolute paths
257 """
261 """
258 result_lines = []
262 result_lines = []
259 walk(self.path, self.terminal_display_formatter, result_lines)
263 walked_dir = list(walk(self.path))
264 walked_dir.sort()
265 for dirname, subdirs, fnames in walked_dir:
266 self.terminal_display_formatter(result_lines, dirname, fnames)
260 return '\n'.join(result_lines)
267 return '\n'.join(result_lines)
General Comments 0
You need to be logged in to leave comments. Login now