Skip to content

Commit

Permalink
formatted by black
Browse files Browse the repository at this point in the history
  • Loading branch information
mzuenni committed Feb 17, 2024
1 parent 842d39b commit a53822e
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 20 deletions.
8 changes: 5 additions & 3 deletions bin/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,11 @@ def build_contest_pdf(contest, problems, tmpdir, language, solutions=False, web=

local_contest_data = Path('contest_data.tex')
util.copy_and_substitute(
local_contest_data
if local_contest_data.is_file()
else config.tools_root / 'latex/contest_data.tex',
(
local_contest_data
if local_contest_data.is_file()
else config.tools_root / 'latex/contest_data.tex'
),
builddir / 'contest_data.tex',
config_data,
)
Expand Down
6 changes: 3 additions & 3 deletions bin/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ def _get_language(self, deps=None):
# Memory limit in MB.
'memlim': (get_memory_limit() or 1024),
# Out-of-spec variables used by 'manual' and 'Viva' languages.
'build': self.tmpdir / 'build'
if (self.tmpdir / 'build') in self.input_files
else '',
'build': (
self.tmpdir / 'build' if (self.tmpdir / 'build') in self.input_files else ''
),
'run': self.tmpdir / 'run',
'viva_jar': config.tools_root / 'third_party/viva/viva.jar',
}
Expand Down
16 changes: 10 additions & 6 deletions bin/skel.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ def new_problem():
statement_languages = config.args.languages if config.args.languages else ['en']

problemname = {
lang: config.args.problemname
if config.args.problemname
else _ask_variable_string(f'problem name ({lang})')
lang: (
config.args.problemname
if config.args.problemname
else _ask_variable_string(f'problem name ({lang})')
)
for lang in statement_languages
}
dirname = (
Expand Down Expand Up @@ -239,9 +241,11 @@ def rename_problem(problem):
fatal('ruamel.yaml library not found.')

newname = {
lang: config.args.problemname
if config.args.problemname
else _ask_variable_string(f'New problem name ({lang})', problem.settings.name[lang])
lang: (
config.args.problemname
if config.args.problemname
else _ask_variable_string(f'New problem name ({lang})', problem.settings.name[lang])
)
for lang in problem.statement_languages
}
dirname = (
Expand Down
2 changes: 1 addition & 1 deletion bin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,5 +1062,5 @@ def generate_problem_uuid():
uuid = uuid.hex()
uuid = f'{uuid[0:8]}-{uuid[8:12]}-{uuid[12:16]}-{uuid[16:20]}-{uuid[20:32]}'
# make the first bytes BAPCtools specific
uuid = config.BAPC_UUID[:config.BAPC_UUID_PREFIX] + uuid[config.BAPC_UUID_PREFIX:]
uuid = config.BAPC_UUID[: config.BAPC_UUID_PREFIX] + uuid[config.BAPC_UUID_PREFIX :]
return uuid
1 change: 0 additions & 1 deletion test/problems/boolfind/input_validators/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@
sys.exit(43)

sys.exit(42)

1 change: 0 additions & 1 deletion test/problems/fltcmp/input_validators/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@
print("Float expected, got {x}", file=sys.stderr)
sys.exit(43)
sys.exit(42)

4 changes: 2 additions & 2 deletions test/problems/generatorincludes/generators/stdout.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3
#Echoes all arguments to stdout. Additionally, unescaped backslash escape
#character, e.g. \n will produce a newline.
# Echoes all arguments to stdout. Additionally, unescaped backslash escape
# character, e.g. \n will produce a newline.
import sys

print(' '.join(sys.argv[1:]).encode('ascii').decode('unicode_escape'))
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
print("Space-separated ints expected")
sys.exit(43)
sys.exit(42)

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

sys.setrecursionlimit(1024)


def hello(depth):
return "Hello world!" if depth == 0 else hello(depth - 1)
return "Hello world!" if depth == 0 else hello(depth - 1)


print(hello(10**7))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
print(3/0)
print(3 / 0)

0 comments on commit a53822e

Please sign in to comment.