def formulator_strings(dir, domain): catalog = {} for filename in find_files(dir, '*.form'): try: extract_ids(filename, catalog) except: # Hee hee, I love bare excepts! print 'There was an error processing', filename traceback.print_exc() return catalog
def metadata_strings(dir, domain): catalog = {} # unfortunately since .xml is used for *both* silva export testfiles # *and* metadata descriptions, we get far too many files. # the handler tries to detect non metadata xml and bails out if so # as a hack for filename in find_files(dir, '*.xml'): try: try: extract_ids(filename, catalog, domain) except NonMetadataXMLError: pass except: # Hee hee, I love bare excepts! print 'There was an error processing', filename traceback.print_exc() return catalog