Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision dbd56c149072e656ca8d6a43a59588f3e7513da2 authored by Hubert Kario on 29 September 2021, 13:05:34 UTC, committed by GitHub on 29 September 2021, 13:05:34 UTC
Merge pull request #777 from tlsfuzzer/descriptive-ExpectAlert
ExpectAlert - add __repr__
2 parent s 09d51ea + 34b0bc2
  • Files
  • Changes
  • dbc30ee
  • /
  • tests
  • /
  • verify-scripts-json.py
Raw File
Cook and download a directory from the Software Heritage Vault

You have requested the cooking of the directory with identifier None into a standard tar.gz archive.

Are you sure you want to continue ?

Download a directory from the Software Heritage Vault

You have requested the download of the directory with identifier None as a standard tar.gz archive.

Are you sure you want to continue ?

Cook and download a revision from the Software Heritage Vault

You have requested the cooking of the history heading to revision with identifier swh:1:rev:dbd56c149072e656ca8d6a43a59588f3e7513da2 into a bare git archive.

Are you sure you want to continue ?

Download a revision from the Software Heritage Vault

You have requested the download of the history heading to revision with identifier swh:1:rev:dbd56c149072e656ca8d6a43a59588f3e7513da2 as a bare git archive.

Are you sure you want to continue ?

Invalid Email !

The provided email is not well-formed.

Download link has expired

The requested archive is no longer available for download from the Software Heritage Vault.

Do you want to cook it again ?

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • content
revision badge
swh:1:rev:dbd56c149072e656ca8d6a43a59588f3e7513da2
content badge Iframe embedding
swh:1:cnt:5782c9b9981e060d59a28150c8ee72b25024220c
verify-scripts-json.py
#!/usr/bin/python

import os
from os import listdir, path
import json
from os.path import isfile, join, dirname, abspath
from sys import argv

parent_dir = dirname(dirname(abspath(__file__)))
scriptlist = [f for f in listdir(os.path.join(parent_dir,'scripts')) if isfile(join(os.path.join(parent_dir,'scripts'), f))]
status = 0
for arg in argv[1:]:
    missing = []
    try:
        jsonfile = json.load(open(arg))
    except IOError:
        print("Please check the input file name, it doesn't appear to exist")
        status =1
        continue
    except ValueError:
        print("Wrong file type: The input must be a json file")
        status =1
        continue
    except IndexError:
        print("No input file was provided")
        status =1
        continue
    for f in scriptlist:
        if f not in str(jsonfile):
            missing.append(f)
    if not missing:
        print(" All scripts are in the json file")
    else:
        print("There are {0} scripts that are missing from {1}:".format(len(missing), arg))
        print("\n".join(missing))
        status = 1

missing = []
for test_script in scriptlist:
    script_path = os.path.join(parent_dir, 'scripts', test_script)
    with open(script_path, 'r') as f:
        script_content = f.read()
    if script_content.find('signature_algorithms') != -1:
        if script_content.find('signature_algorithms_cert') == -1:
            missing.append(test_script)
            status = 1

if not missing:
    print(" All files that contain signature_algorithms,")
    print(" also contain signature_algorithms_cert.")
else:
    print("There are {0} scripts that are missing signature_algorithms_cert:".format(len(missing)))
    print("\n".join(missing))

exit(status)
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top