import os from googlecloudsdk.command_lib.util import gcloudignore chooser = gcloudignore.GetFileChooserForDir('.') predicate = chooser.IsIncluded for root, _, filelist in os.walk('.'): path = os.path.normpath(os.path.relpath(root, '.')) if not predicate(path): continue for f in filelist: filename = os.path.normpath(os.path.join(root, f)) if not predicate(filename): continue print(filename)