Exemplo n.º 1
0
def all_files(root):
    for x in Directory.GetFiles(root):
        yield Path.Combine(root, x)
        
    dirs = Directory.GetDirectories(root)
    for d in dirs:
        for x in all_files(d):
            yield x
Exemplo n.º 2
0
 def __getFolderItems(self, picturesOnly, count):
     if picturesOnly:
         list = []
     else:
         def IsSpecialFolder(dir):
             d = Path.GetFileName(dir).lower()
             return d.startswith('_vti_') or  d.startswith('app_') or d.startswith('bin') or d.startswith('aspnet_')
         list = [GetFolder(d) for d in Directory.GetDirectories(self.path)[:count] if not IsSpecialFolder(d)]
         count -= len(list)
     if count > 0:
         list += [GetPicture(p) for p in Directory.GetFiles(self.path, '*.jpg')[:count]]
     return list