def open_project_with_extensions(path, extensions):
 if (not os.path.exists(path)):
  raise NinjaIOException(u'The folder does not exist')
 valid_extensions = [ext.lower() for ext in extensions if (not ext.startswith(u'-'))]
 d = {}
 for (root, dirs, files) in os.walk(path, followlinks=True):
  for f in files:
   ext = os.path.splitext(f.lower())[(-1)]
   if ((ext in valid_extensions) or (u'.*' in valid_extensions)):
    d[root] = [f, dirs]
   elif ((ext == u'') and (u'*' in valid_extensions)):
    d[root] = [f, dirs]
 return d

def open_project_with_extensions ( path , extensions ) : if ( not os . path . exists ( path ) ) : raise NinjaIOException ( u'The folder does not exist' ) valid_extensions = [ ext . lower ( ) for ext in extensions if ( not ext . startswith ( u'-' ) ) ] d = { } for ( root , dirs , files ) in os . walk ( path , followlinks = True ) : for f in files : ext = os . path . splitext ( f . lower ( ) ) [ ( - 1 ) ] if ( ( ext in valid_extensions ) or ( u'.*' in valid_extensions ) ) : d [ root ] = [ f , dirs ] elif ( ( ext == u'' ) and ( u'*' in valid_extensions ) ) : d [ root ] = [ f , dirs ] return d
return a dict structure containing the info inside a folder .