2020-01-21 06:35:58 +00:00
|
|
|
formats = {}
|
|
|
|
|
|
|
|
|
|
|
|
def register_contest_format(name):
|
|
|
|
def register_class(contest_format_class):
|
|
|
|
assert name not in formats
|
|
|
|
formats[name] = contest_format_class
|
|
|
|
return contest_format_class
|
|
|
|
|
|
|
|
return register_class
|
|
|
|
|
|
|
|
|
|
|
|
def choices():
|
2022-11-01 01:43:06 +00:00
|
|
|
return [(key, value.name) for key, value in sorted(formats.items())]
|