New yaml character format (#337 from TheTerrasque/feature/yaml-characters)

This doesn't break backward compatibility with JSON characters.
This commit is contained in:
TheTerrasque 2023-04-03 01:34:25 +02:00 committed by GitHub
parent 7ce608d101
commit 2157bb4319
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 71 additions and 28 deletions

View file

@ -46,7 +46,8 @@ def get_available_prompts():
return prompts
def get_available_characters():
return ['None'] + sorted(set(map(lambda x : '.'.join(str(x.name).split('.')[:-1]), Path('characters').glob('*.json'))), key=str.lower)
paths = (x for x in Path('characters').iterdir() if x.suffix in ('.json', '.yaml', '.yml'))
return ['None'] + sorted(set((k.stem for k in paths)), key=str.lower)
def get_available_extensions():
return sorted(set(map(lambda x : x.parts[1], Path('extensions').glob('*/script.py'))), key=str.lower)