Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/guess/problem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ source: Kattis
license: cc by-sa

type: interactive
name: Guess the Number
name:
en: Guess the Number
sv: Gissa talet

# Override standard limits: say that the TLE solutions provided should
# be at least 4 times above the time limit in order for us to be
Expand Down
4 changes: 3 additions & 1 deletion examples/oddecho/problem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ license: cc by-sa
credits: Johan Sannemo
source: Principles of Algorithmic Problem Solving
type: scoring
name: Odd Echo
name:
en: Odd Echo
sv: Udda eko
Binary file removed guess.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions problemtools/tex2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def convert(problem_root: Path, options: argparse.Namespace, statement_file: Pat

renderer.render(doc)

# Clean up the logger class plasTeX registers, and reset to the default
logging.setLoggerClass(logging.Logger)

# Annoying: I have not figured out any way of stopping the plasTeX
# renderer from generating a .paux file
if os.path.isfile('.paux'):
Expand Down
15 changes: 10 additions & 5 deletions problemtools/verifyproblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import uuid
from pathlib import Path

import colorlog
import yaml

from . import config
Expand Down Expand Up @@ -753,9 +754,13 @@ def check(self, context: Context) -> bool:
self._check_res = True

if not self.statements:
allowed_statements = ', '.join(
f'problem.{ext}, problem.[a-z][a-z].{ext}' for ext in self.problem.format.statement_extensions
)
if self.problem.format is FormatVersion.LEGACY:
allowed_statements = ', '.join(
f'problem.{ext}, problem.<language>.{ext}' for ext in self.problem.format.statement_extensions
)
else:
allowed_statements = ', '.join(f'problem.<language>.{ext}' for ext in self.problem.format.statement_extensions)

self.error(
f'No problem statements found (expected file of one of following forms in directory {self.problem.format.statement_directory}/: {allowed_statements})'
)
Expand Down Expand Up @@ -1986,8 +1991,8 @@ def argparser() -> argparse.ArgumentParser:
def initialize_logging(args: argparse.Namespace) -> None:
ProblemAspect.max_additional_info = args.max_additional_info

fmt = '%(levelname)s %(message)s'
logging.basicConfig(stream=sys.stdout, format=fmt, level=getattr(logging, args.log_level.upper()))
fmt = '%(log_color)s%(levelname)s %(message)s'
colorlog.basicConfig(stream=sys.stdout, format=fmt, level=getattr(logging, args.log_level.upper()))


def main() -> None:
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ license = "MIT"
keywords = ["kattis", "problemtools", "icpc", "clics"]

dependencies = [
"colorlog",
"nh3",
"PyYAML",
"plasTeX>=3.0",
"pydantic>=2.11",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
colorlog
nh3
PyYAML
plasTeX>=3.0
Expand Down