Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
acaf2d0d
Commit
acaf2d0d
authored
5 months ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Diplomy/sazba: Hledání standardního pozadí
parent
5fb038ea
No related branches found
No related tags found
1 merge request
!137
Sazba diplomů
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mo/jobs/certs.py
+22
-8
22 additions, 8 deletions
mo/jobs/certs.py
with
22 additions
and
8 deletions
mo/jobs/certs.py
+
22
−
8
View file @
acaf2d0d
...
...
@@ -199,18 +199,32 @@ class CertMaker:
add_cert
(
db
.
CertType
.
honorary_mention
,
'
za úplné vyřešení úlohy
'
,
user
.
sort_key
())
def
prepare_files
(
self
)
->
None
:
if
self
.
design_params
.
background_type
==
BackgroundType
.
custom
:
b
=
os
.
path
.
join
(
self
.
certs_dir
,
self
.
cset
.
background_file
)
elif
self
.
design_params
.
background_type
==
BackgroundType
.
standard
:
b
=
os
.
path
.
join
(
mo
.
util
.
part_path
(
'
tex
'
),
'
cert-background.pdf
'
)
else
:
b
=
None
if
b
:
if
b
:
=
self
.
_find_background
():
background
=
os
.
path
.
join
(
self
.
job_dir
,
'
background.pdf
'
)
mo
.
util
.
unlink_if_exists
(
background
)
os
.
link
(
b
,
background
)
def
_find_background
(
self
)
->
Optional
[
str
]:
bgt
=
self
.
design_params
.
background_type
if
bgt
==
BackgroundType
.
custom
:
return
os
.
path
.
join
(
self
.
certs_dir
,
self
.
cset
.
background_file
)
elif
bgt
==
BackgroundType
.
blank
:
return
None
bg
=
bgt
.
name
candidates
=
[
f
'
{
self
.
round
.
round_code
()
}
/bg-
{
bg
}
.pdf
'
,
f
'
bg-
{
bg
}
.pdf
'
,
]
for
cand
in
candidates
:
bg
=
os
.
path
.
join
(
self
.
certs_dir
,
cand
)
if
os
.
path
.
isfile
(
bg
):
return
bg
raise
RuntimeError
(
"
Nemohu najít standardní pozadí (kandidáti:
"
+
"
"
.
join
(
candidates
)
+
"
)
"
)
def
make_certs
(
self
,
cert_type
:
db
.
CertType
)
->
None
:
certs
=
[
cert
for
cert
in
self
.
certs
if
cert
.
type
==
cert_type
]
if
not
certs
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment