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
31454f5a
Commit
31454f5a
authored
7 months ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Školy: Lepší zpráva o problémech s párováním škol
parent
5bf139f4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/init-schools
+26
-9
26 additions, 9 deletions
bin/init-schools
with
26 additions
and
9 deletions
bin/init-schools
+
26
−
9
View file @
31454f5a
...
@@ -399,27 +399,44 @@ def plan_actions() -> List[Action]:
...
@@ -399,27 +399,44 @@ def plan_actions() -> List[Action]:
else
:
else
:
oi
=
0
oi
=
0
ni
=
0
ni
=
0
merged_list
:
List
[
Tuple
[
ProtoSchool
,
ProtoSchool
]]
=
[]
while
oi
<
len
(
old_ps
)
or
ni
<
len
(
new_ps
):
while
oi
<
len
(
old_ps
)
or
ni
<
len
(
new_ps
):
old
:
Optional
[
ProtoSchool
]
=
old_ps
[
oi
]
if
oi
<
len
(
old_ps
)
else
None
old
:
Optional
[
ProtoSchool
]
=
old_ps
[
oi
]
if
oi
<
len
(
old_ps
)
else
None
new
:
Optional
[
ProtoSchool
]
=
new_ps
[
ni
]
if
ni
<
len
(
new_ps
)
else
None
new
:
Optional
[
ProtoSchool
]
=
new_ps
[
ni
]
if
ni
<
len
(
new_ps
)
else
None
if
old
and
new
and
old
.
address
==
new
.
address
:
if
old
and
new
and
old
.
address
==
new
.
address
:
merged_list
.
append
((
old
,
new
))
plan
(
old
,
new
)
plan
(
old
,
new
)
oi
+=
1
oi
+=
1
ni
+=
1
ni
+=
1
elif
old
and
(
not
new
or
old
.
address
<
new
.
address
):
elif
old
and
(
not
new
or
old
.
address
<
new
.
address
):
assert
old
.
school
assert
old
.
school
print
(
f
'
TODO: Starou školu #
{
old
.
school
.
place_id
}
(RED IZO
{
red_izo
}
) nedokáži spárovat s novou
'
)
if
not
old
.
school
.
place
.
hidden
:
merged_list
.
append
((
old
,
None
))
oi
+=
1
else
:
merged_list
.
append
((
None
,
new
))
ni
+=
1
if
any
(
not
(
x
[
0
]
and
x
[
1
])
for
x
in
merged_list
):
# Existují nespárované záznamy, tak o nich chceme varovat
print
(
f
'
TODO: Školy s RED IZO
{
red_izo
}
se nepodařilo spárovat
'
)
for
old
,
new
in
merged_list
:
if
old
and
new
:
print
(
f
'
Spárovaná (#
{
old
.
school
.
place_id
}
):
'
)
s
=
new
elif
old
:
print
(
f
'
Jen v OSMO (#
{
old
.
school
.
place_id
}
):
'
)
s
=
old
else
:
print
(
'
Jen v rejstříku:
'
)
s
=
new
if
old
:
print
(
f
'
\t
# URL:
{
school_url
(
old
.
school
.
place_id
)
}
'
)
print
(
f
'
\t
# URL:
{
school_url
(
old
.
school
.
place_id
)
}
'
)
if
old
.
school
.
place
.
note
:
if
old
.
school
.
place
.
note
:
print
(
f
'
\t
# NOTE:
{
old
.
school
.
place
.
note
}
'
)
print
(
f
'
\t
# NOTE:
{
old
.
school
.
place
.
note
}
'
)
for
field
in
fields
:
for
field
in
fields
:
print
(
f
'
\t
{
field
}
:
{
getattr
(
old
,
field
)
}
'
)
print
(
f
'
\t
{
field
}
:
{
getattr
(
s
,
field
)
}
'
)
oi
+=
1
else
:
print
(
f
'
TODO: Novou školu (RED IZO
{
red_izo
}
) nedokáži spárovat se starou
'
)
for
field
in
fields
:
print
(
f
'
\t
{
field
}
:
{
getattr
(
new
,
field
)
}
'
)
ni
+=
1
for
red_izo
in
sorted
(
old_schools
.
keys
()):
for
red_izo
in
sorted
(
old_schools
.
keys
()):
if
red_izo
not
in
new_schools
:
if
red_izo
not
in
new_schools
:
...
...
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