Пример #1
0
def sanity_check():
    """Sanity check the E3 install."""
    errors = 0
    print('YAMLCheck:', end=' ')
    try:
        import yaml
        yaml.dump({'Yaml': 'works'})
        print('PASSED')
    except Exception:
        print('FAILED')
        errors += 1

    print('HashlibCheck:', end=' ')
    try:
        from e3.hash import sha1, md5
        sha1(__file__)
        md5(__file__)
        print('PASSED')
    except Exception:
        print('FAILED')
        errors += 1

    print('Version:', end=' ')
    try:
        print(version())
    except Exception:
        errors += 1
    return errors
Пример #2
0
def sanity_check():
    """Sanity check the E3 install."""
    errors = 0
    print('YAMLCheck:', end=' ')
    try:
        import yaml
        yaml.dump({'Yaml': 'works'})
        print('PASSED')
    except Exception:  # defensive code
        print('FAILED')
        errors += 1

    print('HashlibCheck:', end=' ')
    try:
        from e3.hash import sha1, md5
        sha1(__file__)
        md5(__file__)
        print('PASSED')
    except Exception:  # defensive code
        print('FAILED')
        errors += 1

    print('Version:', end=' ')
    try:
        print(version())
    except Exception:  # defensive code
        errors += 1
    return errors
Пример #3
0
def sanity_check() -> int:
    """Sanity check the E3 install."""
    errors = 0
    print("YAMLCheck:", end=" ")
    try:
        import yaml

        yaml.safe_dump({"Yaml": "works"})
        print("PASSED")
    except Exception:  # defensive code
        print("FAILED")
        errors += 1

    print("HashlibCheck:", end=" ")
    try:
        from e3.hash import sha1, md5

        sha1(__file__)
        md5(__file__)
        print("PASSED")
    except Exception:  # defensive code
        print("FAILED")
        errors += 1

    print("Version:", end=" ")
    try:
        print(version())
    except Exception:  # defensive code
        errors += 1
    return errors
def sanity_check():
    """Sanity check the E3 install."""
    errors = 0
    sys.stdout.write('YAMLCheck: ')
    try:
        import yaml
        yaml.dump({'Yaml': 'works'})
        sys.stdout.write('PASSED\n')
    except Exception:
        sys.stdout.write('FAILED\n')
        errors += 1

    sys.stdout.write('HashlibCheck: ')
    try:
        from e3.hash import sha1, md5
        sha1(__file__)
        md5(__file__)
        sys.stdout.write('PASSED\n')
    except Exception:
        sys.stdout.write('FAILED\n')
        errors += 1

    try:
        revision = version()
        major, num, git_rev = revision.split('-')
        sys.stdout.write('MajorVersion: %s\n' % major)
        sys.stdout.write('ChangeNumber: %s\n' % num)
    except Exception:
        sys.stdout.write('MajorVersion: FAILED\n')
        sys.stdout.write('ChangeNumber: FAILED\n')
    return errors