Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
proto3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
protokollsystem
proto3
Commits
c160a9d0
Commit
c160a9d0
authored
8 years ago
by
Administrator
Browse files
Options
Downloads
Patches
Plain Diff
Fixed errors connected to importing the legacy
parent
ac091dbd
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
legacy.py
+5
-4
5 additions, 4 deletions
legacy.py
server.py
+2
-2
2 additions, 2 deletions
server.py
templates/decision.tex
+1
-1
1 addition, 1 deletion
templates/decision.tex
with
8 additions
and
7 deletions
legacy.py
+
5
−
4
View file @
c160a9d0
...
...
@@ -62,10 +62,10 @@ def import_old_protocols(sql_text):
deleted
,
sent
,
document_id
)
in
_split_insert_line
(
protocol_line
):
date
=
datetime
.
strptime
(
date
,
"
%Y-%m-%d
"
)
handle
=
type_id_to_handle
[
int
(
old_type_id
)]
type
=
ProtocolType
.
query
.
filter
(
ProtocolType
.
short_name
.
ilike
(
handle
)).
first
()
if
type
is
None
:
protocol
type
=
ProtocolType
.
query
.
filter
(
ProtocolType
.
short_name
.
ilike
(
handle
)).
first
()
if
protocol
type
is
None
:
raise
KeyError
(
"
No protocoltype for handle
'
{}
'
.
"
.
format
(
handle
))
protocol
=
Protocol
(
type
.
id
,
date
,
source
=
source
)
protocol
=
Protocol
(
protocol
type
.
id
,
date
,
source
=
source
)
db
.
session
.
add
(
protocol
)
db
.
session
.
commit
()
import
tasks
...
...
@@ -73,6 +73,7 @@ def import_old_protocols(sql_text):
for
protocol
in
sorted
(
protocols
,
key
=
lambda
p
:
p
.
date
):
print
(
protocol
.
date
)
tasks
.
parse_protocol
(
protocol
)
print
(
"
done importing
"
)
def
import_old_todos
(
sql_text
):
...
...
@@ -106,7 +107,7 @@ def import_old_todos(sql_text):
for
old_id
,
protocol_id
,
who
,
what
,
start_time
,
end_time
,
done
in
_split_insert_line
(
todo_line
):
protocol_id
=
int
(
protocol_id
)
if
protocol_id
not
in
protocol_id_to_key
:
print
(
"
Missing protocol with ID {} for Todo {}
"
.
format
(
protocol_id
,
what
))
#
print("Missing protocol with ID {} for Todo {}".format(protocol_id, what))
continue
todo
=
OldTodo
(
old_id
=
old_id
,
who
=
who
,
description
=
what
,
protocol_key
=
protocol_id_to_key
[
protocol_id
])
...
...
This diff is collapsed.
Click to expand it.
server.py
+
2
−
2
View file @
c160a9d0
...
...
@@ -86,8 +86,8 @@ def import_legacy():
"""
Import the old todos and protocols from an sql dump
"""
filename
=
prompt
(
"
SQL-file
"
)
#filename = "legacy.sql"
with
open
(
filename
,
"
r
"
)
as
sqlfile
:
content
=
sqlfile
.
read
()
with
open
(
filename
,
"
r
b
"
)
as
sqlfile
:
content
=
sqlfile
.
read
()
.
decode
(
"
utf-8
"
)
import_old_todos
(
content
)
import_old_protocols
(
content
)
...
...
This diff is collapsed.
Click to expand it.
templates/decision.tex
+
1
−
1
View file @
c160a9d0
...
...
@@ -27,7 +27,7 @@
{
\bf
Datum:
}
&
\VAR
{
protocol.date|datify
_
long|escape
_
tex
}
\\
\ENV
{
endif
}
\ENV
{
for meta in protocol.metas
}
{
\bf
\
ENV
{
meta.name|escape
_
tex
}
:
}
&
\VAR
{
meta.value|escape
_
tex
}
\\
{
\bf
\
VAR
{
meta.name|escape
_
tex
}
:
}
&
\VAR
{
meta.value|escape
_
tex
}
\\
\ENV
{
endfor
}
\end{tabular}
\normalsize
...
...
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