Sha256: cb79005c8100bb0de61b474ea3a8f6efac8b98afc92ed7a29b8b9e37acf9cc34
Contents?: true
Size: 635 Bytes
Versions: 4
Compression:
Stored size: 635 Bytes
Contents
import sys import os import re status = 0 try: import yaml for root, dirs, files in os.walk("."): for f in files: # we want yaml files that are not in hidden (.) dirs. account for / vs \ on windows/linux target = os.path.join(root, f) if target.endswith(".yaml") and not re.match("^\.(/|\\\)\.", target): try: yaml.safe_load(open(target,"r")) except Exception as e: status = 1 print("YAML syntax error in %s: %s" % (target, str(e))) except ImportError as e: status = 1 print("Please install the python-yaml library: pip install pyyaml") sys.exit(status)
Version data entries
4 entries across 4 versions & 1 rubygems