def validate_subdirectory_string(subdirectory_str):
    ' Validate subdirectory string '
    if (not subdirectory_str.isascii()):
        raise argparse.ArgumentTypeError(('%s contains non ascii characters' % subdirectory_str))
    if subdirectory_str.startswith('/'):
        subdirectory_str = subdirectory_str[1:]
    if subdirectory_str.endswith('/'):
        subdirectory_str = subdirectory_str[:(- 1)]
    site_config.set_subdirectory(subdirectory_str)
    return subdirectory_str
Validate subdirectory string
def validate_subdirectory_string(subdirectory_str):
    '  '
    if (not subdirectory_str.isascii()):
        raise argparse.ArgumentTypeError(('%s contains non ascii characters' % subdirectory_str))
    if subdirectory_str.startswith('/'):
        subdirectory_str = subdirectory_str[1:]
    if subdirectory_str.endswith('/'):
        subdirectory_str = subdirectory_str[:(- 1)]
    site_config.set_subdirectory(subdirectory_str)
    return subdirectory_str