Changeset 294379 in webkit
- Timestamp:
- May 17, 2022, 6:45:35 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/glib/generate-pdfjs-gresource-manifest.py
r291094 r294379 20 20 import sys 21 21 22 VALID_EXTENSIONS = ['.html', '.js', '.css', '.svg', '.png', '.gif', '.cur', '.bcmap', '.properties', '.pfb', '.ttf'] 23 COMPRESSIBLE_EXTENSIONS = ['.html', '.js', '.css', '.svg', '.properties'] 24 BASE_DIRS = ['pdfjs/', 'pdfjs-extras/'] 22 VALID_EXTENSIONS = {'.html', '.js', '.css', '.svg', '.png', '.gif', '.cur', '.bcmap', '.properties', '.pfb', '.ttf'} 23 COMPRESSIBLE_EXTENSIONS = {'.html', '.js', '.css', '.svg', '.properties'} 24 BASE_DIRS = {'pdfjs/', 'pdfjs-extras/'} 25 26 IGNORE = {'LICENSE', 27 'README.webkit', 28 'web/cmaps/LICENSE', 29 'web/standard_fonts/LICENSE_FOXIT', 30 'web/standard_fonts/LICENSE_LIBERATION'} 25 31 26 32 27 33 def get_filenames(directory): 28 34 filenames = [] 29 30 def should_ignore_resource(resource):31 if os.path.splitext(resource)[1] not in VALID_EXTENSIONS:32 return True33 35 34 36 def resource_name(filename): … … 54 56 if os.sep != '/': 55 57 name = name.replace(os.sep, '/') 56 if not should_ignore_resource(name): 58 if name not in IGNORE: 59 if os.path.splitext(name)[1] not in VALID_EXTENSIONS: 60 print('Unexpected file %s, please teach generate-pdfjs-gresource-manifest.py how to handle it' % filename, file=sys.stderr) 61 sys.exit(1) 57 62 filenames.append(name) 58 63
Note:
See TracChangeset
for help on using the changeset viewer.