third_party/blink/tools/blinkpy/w3c/wpt_manifest.py
def ensure_manifest(port, path=None):
        """Regenerates the WPT MANIFEST.json file.

        Args:
            port: A blinkpy.web_tests.port.Port object.
            path: The path to a WPT root (relative to web_tests, optional).
        """
        fs = port.host.filesystem
        if path is None:
            path = fs.join('external', 'wpt')
        wpt_path = fs.join(port.web_tests_dir(), path)
        manifest_path = fs.join(wpt_path, MANIFEST_NAME)

        # Unconditionally delete local MANIFEST.json to avoid regenerating the
        # manifest from scratch (when version is bumped) or invalid/out-of-date
        # local manifest breaking the runner.
        if fs.exists(manifest_path):
            _log.debug('Removing existing manifest file "%s".', manifest_path)
            fs.remove(manifest_path)

        # TODO(crbug.com/853815): perhaps also cache the manifest for wpt_internal.
        if 'external' in path:
            base_manifest_path = fs.join(port.web_tests_dir(), 'external',
                                         BASE_MANIFEST_NAME)
            if fs.exists(base_manifest_path):
                _log.debug('Copying base manifest from "%s" to "%s".',
                           base_manifest_path, manifest_path)
                fs.copyfile(base_manifest_path, manifest_path)
            else:
                _log.error('Manifest base not found at "%s".',
                           base_manifest_path)

        WPTManifest.generate_manifest(port, wpt_path)

        if fs.isfile(manifest_path):
            _log.debug('Manifest generation completed.')
        else:
            _log.error(
                'Manifest generation failed; creating an empty MANIFEST.json...'
            )
            fs.write_text_file(manifest_path, '{}')
Regenerates the WPT MANIFEST.json file.

        Args:
            port: A blinkpy.web_tests.port.Port object.
            path: The path to a WPT root (relative to web_tests, optional).
        
Regenerates the WPT MANIFEST.json file.
Regenerates the WPT MANIFEST . json file .
def ensure_manifest(port, path=None):
        fs = port.host.filesystem
        if path is None:
            path = fs.join('external', 'wpt')
        wpt_path = fs.join(port.web_tests_dir(), path)
        manifest_path = fs.join(wpt_path, MANIFEST_NAME)
        if fs.exists(manifest_path):
            _log.debug('Removing existing manifest file "%s".', manifest_path)
            fs.remove(manifest_path)
        if 'external' in path:
            base_manifest_path = fs.join(port.web_tests_dir(), 'external',
                                         BASE_MANIFEST_NAME)
            if fs.exists(base_manifest_path):
                _log.debug('Copying base manifest from "%s" to "%s".',
                           base_manifest_path, manifest_path)
                fs.copyfile(base_manifest_path, manifest_path)
            else:
                _log.error('Manifest base not found at "%s".',
                           base_manifest_path)
        WPTManifest.generate_manifest(port, wpt_path)
        if fs.isfile(manifest_path):
            _log.debug('Manifest generation completed.')
        else:
            _log.error(
                'Manifest generation failed; creating an empty MANIFEST.json...'
            )
            fs.write_text_file(manifest_path, '{}')
def ensure_manifest ( port , path = None ) : fs = port . host . filesystem if path is None : path = fs . join ( 'external' , 'wpt' ) wpt_path = fs . join ( port . web_tests_dir ( ) , path ) manifest_path = fs . join ( wpt_path , MANIFEST_NAME ) if fs . exists ( manifest_path ) : _log . debug ( 'Removing existing manifest file "%s".' , manifest_path ) fs . remove ( manifest_path ) if 'external' in path : base_manifest_path = fs . join ( port . web_tests_dir ( ) , 'external' , BASE_MANIFEST_NAME ) if fs . exists ( base_manifest_path ) : _log . debug ( 'Copying base manifest from "%s" to "%s".' , base_manifest_path , manifest_path ) fs . copyfile ( base_manifest_path , manifest_path ) else : _log . error ( 'Manifest base not found at "%s".' , base_manifest_path ) WPTManifest . generate_manifest ( port , wpt_path ) if fs . isfile ( manifest_path ) : _log . debug ( 'Manifest generation completed.' ) else : _log . error ( 'Manifest generation failed; creating an empty MANIFEST.json...' ) fs . write_text_file ( manifest_path , '{}' )
Regenerates the WPT MANIFEST.json file.
Regenerates the WPT MANIFEST . json file .
"""Regenerates the WPT MANIFEST.json file.

        Args:
            port: A blinkpy.web_tests.port.Port object.
            path: The path to a WPT root (relative to web_tests, optional).
        """ # Unconditionally delete local MANIFEST.json to avoid regenerating the # manifest from scratch (when version is bumped) or invalid/out-of-date # local manifest breaking the runner. # TODO(crbug.com/853815): perhaps also cache the manifest for wpt_internal.
port
A blinkpy.web_tests.port.Port object.
A blinkpy . web_tests . port . Port object .
path
The path to a WPT root (relative to web_tests, optional).
The path to a WPT root ( relative to web_tests optional ) .