-#!/usr/bin/env python
-
'''Check that a workshop's index.html metadata is valid. See the
docstrings on the checking functions for a summary of the checks.
'''
URL_PATTERN = r'https?://.+'
# Defaults.
-CARPENTRIES = ("dc", "swc")
+CARPENTRIES = ("dc", "swc", "lc", "cp")
DEFAULT_CONTACT_EMAIL = 'admin@software-carpentry.org'
USAGE = 'Usage: "workshop_check.py path/to/root/directory"'
@look_for_fixme
def check_carpentry(layout):
- '''"carpentry" in YAML header must be "dc" or "swc".'''
+ '''"carpentry" in YAML header must be "dc", "swc", "lc", or "cp".'''
return layout in CARPENTRIES
and 4-digit year. Examples include 'Feb 18-20, 2025' and 'Feb 18
and 20, 2025'. It may be in languages other than English, but the
month name should be kept short to aid formatting of the main
- Software Carpentry web site.
+ Carpentries web site.
"""
if ',' not in date:
kind)
carpentry = config.get('carpentry', None)
- reporter.check(carpentry in ('swc', 'dc'),
+ reporter.check(carpentry in ('swc', 'dc', 'lc', 'cp'),
filename,
'Missing or unknown carpentry: {0}',
carpentry)
reporter = Reporter()
check_config(reporter, config_file)
check_unwanted_files(root_dir, reporter)
- with open(index_file) as reader:
+ with open(index_file, encoding='utf-8') as reader:
data = reader.read()
check_file(reporter, index_file, data)
reporter.report()