def show_matching_formats(): import sys from dxtbx.format.Registry import Registry for arg in sys.argv[1:]: print '=== %s ===' % arg for fmt in Registry.get(): if fmt.understand(arg): print fmt.__name__, fmt.understand(arg) recurse(fmt, arg) else: print fmt.__name__, fmt.understand(arg)
def show_matching_formats(files): from dxtbx.format.Registry import Registry for filename in files: print('\n=== %s ===' % filename) if os.path.exists(filename): for fmt in Registry.get(): understood = fmt.understand(filename) print("%s: %s" % (fmt.__name__, understood)) if understood: recurse(fmt, filename) else: print("File not found.")