Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
leak analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
vaclab
leak analysis
Commits
697f65e9
Commit
697f65e9
authored
1 year ago
by
Eduard Friske
Browse files
Options
Downloads
Patches
Plain Diff
Unterstützung für Kommandozeilen-Parameter eingebaut
parent
ba3ae7af
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
API-V2-elab.py
+1
-1
1 addition, 1 deletion
API-V2-elab.py
attachment_cer.py
+24
-4
24 additions, 4 deletions
attachment_cer.py
file-to-couchdb_TLA.py
+17
-2
17 additions, 2 deletions
file-to-couchdb_TLA.py
writeLaTeX-ks-TLA.py
+18
-1
18 additions, 1 deletion
writeLaTeX-ks-TLA.py
with
60 additions
and
8 deletions
API-V2-elab.py
+
1
−
1
View file @
697f65e9
...
@@ -63,7 +63,7 @@ elab_id=647
...
@@ -63,7 +63,7 @@ elab_id=647
cers
=
[
"
75556_0001
"
,
"
75557_0001
"
,
"
75558_0001
"
,
"
75559_0001
"
]
# Beispiel: cers = ["75511_0001","75512_0001"]
cers
=
[
"
75556_0001
"
,
"
75557_0001
"
,
"
75558_0001
"
,
"
75559_0001
"
]
# Beispiel: cers = ["75511_0001","75512_0001"]
TL1_2
=
"
TLA
"
#### FM1 oder TLA
TL1_2
=
"
TLA
"
#### FM1 oder TLA
year
=
"
2024
"
year
=
str
(
config
[
"
KS-Daten
"
][
"
Jahr
"
])
kk
=
"
KK
"
kk
=
"
KK
"
commentar
=
''
commentar
=
''
...
...
This diff is collapsed.
Click to expand it.
attachment_cer.py
+
24
−
4
View file @
697f65e9
...
@@ -9,17 +9,37 @@ from pathlib import Path
...
@@ -9,17 +9,37 @@ from pathlib import Path
import
os
import
os
import
couchdb
import
couchdb
import
argparse
import
json
couch
=
couchdb
.
Server
(
'
http://a73434.berlin.ptb.de:5984
'
)
couch
=
couchdb
.
Server
(
'
http://a73434.berlin.ptb.de:5984
'
)
db
=
couch
[
'
vl_db
'
]
# existing
db
=
couch
[
'
vl_db
'
]
# existing
path
=
Path
(
config
[
"
Pfad
"
][
"
Kalibrierschein
"
])
config_file
=
"
config.json
"
with
open
(
config_file
)
as
fp
:
config
=
json
.
load
(
fp
)
cmd_parser
=
argparse
.
ArgumentParser
(
description
=
"
Schreibt erstellen kalibrierschein (TeX und PDF) in die CouchDB
"
)
cmd_parser
.
add_argument
(
"
cal_no
"
,
type
=
int
,
metavar
=
"
<Kalibrierschein-Nummer>
"
,
nargs
=
"
*
"
)
cmd_parser
.
add_argument
(
"
-y
"
,
"
--year
"
,
type
=
int
,
metavar
=
"
<Messjahr>
"
)
args
=
cmd_parser
.
parse_args
()
path
=
Path
(
config
[
"
Pfad
"
][
"
Kalibrierschein
"
])
year
=
str
(
config
[
"
KS-Daten
"
][
"
Jahr
"
])
year
=
str
(
config
[
"
KS-Daten
"
][
"
Jahr
"
])
cers
=
[
"
75559
"
]
# Beispiel: cers = ["75511_0001","75512_0001"]
if
args
.
year
is
not
None
:
#cers = ["75562","75563"] # Beispiel: cers = ["75511_0001","75512_0001"]
year
=
str
(
args
.
year
)
cers
=
[
""
]
*
len
(
args
.
cal_no
)
#print(args.cal_no)
for
pos
in
range
(
len
(
args
.
cal_no
)):
cers
[
pos
]
=
str
(
args
.
cal_no
[
pos
])
print
(
cers
)
#cers = ["75559"] # Beispiel: cers = ["75511_0001","75512_0001"]
#cers = ["75562","75563"] # Beispiel: cers = ["75511_0001","75512_0001"]
exit
()
################### die Kalibrierscheine werden an das cer-json-dokument angehangen ##################
################### die Kalibrierscheine werden an das cer-json-dokument angehangen ##################
i
=
0
i
=
0
while
i
<
len
(
cers
):
while
i
<
len
(
cers
):
...
@@ -65,6 +85,6 @@ while i < len(cers):
...
@@ -65,6 +85,6 @@ while i < len(cers):
ks_tex
.
unlink
(
missing_ok
=
True
)
ks_tex
.
unlink
(
missing_ok
=
True
)
ks_aux
.
unlink
(
missing_ok
=
True
)
ks_aux
.
unlink
(
missing_ok
=
True
)
ks_log
.
unlink
(
missing_ok
=
True
)
ks_log
.
unlink
(
missing_ok
=
True
)
ks_gz
.
unlink
(
missing_ok
=
True
)
ks_gz
.
unlink
(
missing_ok
=
True
)
i
+=
1
i
+=
1
This diff is collapsed.
Click to expand it.
file-to-couchdb_TLA.py
+
17
−
2
View file @
697f65e9
...
@@ -17,6 +17,7 @@ import json
...
@@ -17,6 +17,7 @@ import json
import
couchdb
import
couchdb
from
pathlib
import
Path
from
pathlib
import
Path
import
os
import
os
import
argparse
#import pathlib
#import pathlib
couch
=
couchdb
.
Server
(
'
http://a73434.berlin.ptb.de:5984
'
)
couch
=
couchdb
.
Server
(
'
http://a73434.berlin.ptb.de:5984
'
)
db
=
couch
[
'
vl_db
'
]
# existing
db
=
couch
[
'
vl_db
'
]
# existing
...
@@ -34,13 +35,27 @@ with open(config_file) as fp:
...
@@ -34,13 +35,27 @@ with open(config_file) as fp:
# for entry in config[section].keys():
# for entry in config[section].keys():
# print(entry, "=", config[section][entry])
# print(entry, "=", config[section][entry])
cal_cert
=
"
75559
"
cmd_parser
=
argparse
.
ArgumentParser
(
description
=
"
Verarbeitet Messdaten aus TLA und speichert sie als CouchDB-Dokument
"
)
cmd_parser
.
add_argument
(
"
cal_no
"
,
type
=
int
,
metavar
=
"
<Kalibrierschein-Nummer>
"
)
cmd_parser
.
add_argument
(
"
-y
"
,
"
--year
"
,
type
=
int
,
metavar
=
"
<Messjahr>
"
)
cmd_parser
.
add_argument
(
"
-n
"
,
"
--number
"
,
type
=
int
,
metavar
=
"
<laufende Nummer>
"
)
args
=
cmd_parser
.
parse_args
()
#cal_cert = "75559"
year
=
str
(
config
[
"
KS-Daten
"
][
"
Jahr
"
])
year
=
str
(
config
[
"
KS-Daten
"
][
"
Jahr
"
])
no
=
str
(
config
[
"
KS-Daten
"
][
"
lfd. Nr.
"
]).
zfill
(
4
)
no
=
str
(
config
[
"
KS-Daten
"
][
"
lfd. Nr.
"
]).
zfill
(
4
)
#if args.cal_no is not None:
cal_cert
=
str
(
args
.
cal_no
)
if
args
.
year
is
not
None
:
year
=
str
(
args
.
year
)
if
args
.
number
is
not
None
:
no
=
str
(
args
.
number
).
zfill
(
4
)
#print("year:", year)
#print("year:", year)
#print("no:", no)
#print("no:", no)
json_file
=
"
cal-
"
+
year
+
"
-tl2-kk-
"
+
cal_cert
+
"
_
"
+
no
json_file
=
"
cal-
"
+
year
+
"
-tl2-kk-
"
+
cal_cert
+
"
_
"
+
no
doc
=
db
.
get
(
json_file
)
doc
=
db
.
get
(
json_file
)
...
...
This diff is collapsed.
Click to expand it.
writeLaTeX-ks-TLA.py
+
18
−
1
View file @
697f65e9
...
@@ -2,12 +2,29 @@ import time
...
@@ -2,12 +2,29 @@ import time
import
couchdb
import
couchdb
from
datetime
import
date
from
datetime
import
date
from
pathlib
import
Path
from
pathlib
import
Path
import
argparse
import
json
couch
=
couchdb
.
Server
(
'
http://a73434.berlin.ptb.de:5984
'
)
couch
=
couchdb
.
Server
(
'
http://a73434.berlin.ptb.de:5984
'
)
db
=
couch
[
'
vl_db
'
]
# existing
db
=
couch
[
'
vl_db
'
]
# existing
cal_cert
=
"
75559
"
config_file
=
"
config.json
"
with
open
(
config_file
)
as
fp
:
config
=
json
.
load
(
fp
)
cmd_parser
=
argparse
.
ArgumentParser
(
description
=
"
Erstellt TeX-Dokument als Zwischenschritt zum PDF-Kalibrierschein
"
)
cmd_parser
.
add_argument
(
"
cal_no
"
,
type
=
int
,
metavar
=
"
<Kalibrierschein-Nummer>
"
)
cmd_parser
.
add_argument
(
"
-y
"
,
"
--year
"
,
type
=
int
,
metavar
=
"
<Messjahr>
"
)
cmd_parser
.
add_argument
(
"
-n
"
,
"
--number
"
,
type
=
int
,
metavar
=
"
<laufende Nummer>
"
)
args
=
cmd_parser
.
parse_args
()
#cal_cert = "75559"
year
=
str
(
config
[
"
KS-Daten
"
][
"
Jahr
"
])
year
=
str
(
config
[
"
KS-Daten
"
][
"
Jahr
"
])
no
=
str
(
config
[
"
KS-Daten
"
][
"
lfd. Nr.
"
]).
zfill
(
4
)
no
=
str
(
config
[
"
KS-Daten
"
][
"
lfd. Nr.
"
]).
zfill
(
4
)
cal_cert
=
str
(
args
.
cal_no
)
if
args
.
year
is
not
None
:
year
=
str
(
args
.
year
)
if
args
.
number
is
not
None
:
no
=
str
(
args
.
number
).
zfill
(
4
)
year_cer
=
year
[
2
:]
year_cer
=
year
[
2
:]
...
...
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