Ejemplo n.º 1
0
 def create(self, state):
     from manifest import manifest
     state.manifest_path = os.path.join(state.metadata_path,
                                        "MANIFEST.json")
     # Conservatively always rebuild the manifest when doing a sync
     state.old_manifest = manifest.load(state.tests_path,
                                        state.manifest_path)
     state.test_manifest = manifest.Manifest(None, "/")
Ejemplo n.º 2
0
    def load_manifest(self, tests_path, metadata_path, url_base="/"):
        manifest_path = os.path.join(metadata_path, "MANIFEST.json")
        if not os.path.exists(manifest_path) or self.force_manifest_update:
            self.update_manifest(manifest_path, tests_path, url_base)
        manifest_file = manifest.load(tests_path, manifest_path)
        if manifest_file.url_base != url_base:
            self.logger.info("Updating url_base in manifest from %s to %s" % (manifest_file.url_base, url_base))
            manifest_file.url_base = url_base
            manifest.write(manifest_file, manifest_path)

        return manifest_file
Ejemplo n.º 3
0
    def load_manifest(self, tests_path, metadata_path, url_base="/"):
        manifest_path = os.path.join(metadata_path, "MANIFEST.json")
        if (not os.path.exists(manifest_path) or self.force_manifest_update):
            self.update_manifest(manifest_path, tests_path, url_base)
        manifest_file = manifest.load(tests_path, manifest_path)
        if manifest_file.url_base != url_base:
            self.logger.info("Updating url_base in manifest from %s to %s" %
                             (manifest_file.url_base, url_base))
            manifest_file.url_base = url_base
            manifest.write(manifest_file, manifest_path)

        return manifest_file
Ejemplo n.º 4
0
    def load_manifest(self, tests_path, manifest_path, url_base="/", **kwargs):
        if (not os.path.exists(manifest_path) or
            self.force_manifest_update):
            self.update_manifest(manifest_path, tests_path, url_base, download=self.manifest_download)
        manifest_file = manifest.load(tests_path, manifest_path, types=self.types, meta_filters=self.meta_filters)
        if manifest_file.url_base != url_base:
            self.logger.info("Updating url_base in manifest from %s to %s" % (manifest_file.url_base,
                                                                              url_base))
            manifest_file.url_base = url_base
            manifest.write(manifest_file, manifest_path)

        return manifest_file
Ejemplo n.º 5
0
def main(request, response):
    path = os.path.join(root, "MANIFEST.json")

    manifest_file = None
    try:
        manifest_file = manifest.load(root, path)
    except manifest.ManifestVersionMismatch:
        pass
    if manifest_file is None:
        manifest_file = manifest.Manifest("/")

    update.update(root, manifest_file)

    manifest.write(manifest_file, path)

    return [("Content-Type", "application/json")], json.dumps({"url": "/MANIFEST.json"})
Ejemplo n.º 6
0
def main(request, response):
    path = os.path.join(root, "MANIFEST.json")

    manifest_file = None
    try:
        manifest_file = manifest.load(root, path)
    except manifest.ManifestVersionMismatch:
        pass
    if manifest_file is None:
        manifest_file = manifest.Manifest("/")

    update.update(root, manifest_file)

    manifest.write(manifest_file, path)

    return [("Content-Type", "application/json")
            ], json.dumps({"url": "/MANIFEST.json"})
Ejemplo n.º 7
0
Archivo: sync.py Proyecto: 0X1A/servo
 def create(self, state):
     from manifest import manifest
     state.manifest_path = os.path.join(state.metadata_path, "MANIFEST.json")
     # Conservatively always rebuild the manifest when doing a sync
     state.old_manifest = manifest.load(state.tests_path, state.manifest_path)
     state.test_manifest = manifest.Manifest(None, "/")