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
7b327fa9
Commit
7b327fa9
authored
1 year ago
by
Eduard Friske
Browse files
Options
Downloads
Patches
Plain Diff
Konfigdatei für Laborbuch
parent
697f65e9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
API-V2-elab.py
+22
-2
22 additions, 2 deletions
API-V2-elab.py
attachment_cer.py
+2
-2
2 additions, 2 deletions
attachment_cer.py
with
24 additions
and
4 deletions
API-V2-elab.py
+
22
−
2
View file @
7b327fa9
...
...
@@ -12,6 +12,7 @@ import datetime
import
elabapi_python
from
elabapi_python.rest
import
ApiException
import
requests
import
argparse
import
json
import
couchdb
import
numpy
as
np
...
...
@@ -22,6 +23,25 @@ from urllib3 import disable_warnings
couch
=
couchdb
.
Server
(
'
http://a73434.berlin.ptb.de:5984
'
)
db
=
couch
[
'
vl_db
'
]
# existing
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
(
"
-e
"
,
"
--elab
"
,
type
=
int
,
metavar
=
"
<eLab ID>
"
)
args
=
cmd_parser
.
parse_args
()
if
args
.
elab
is
not
None
:
elab_id
=
str
(
args
.
elab
)
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
)
#########################
# CONFIG #
#########################
...
...
@@ -59,8 +79,8 @@ today = datetime.date.today()
########
elab_id
=
64
7
cers
=
[
"
755
56_0001
"
,
"
75557_0001
"
,
"
75558_0001
"
,
"
75559
_0001
"
]
# Beispiel: cers = ["75511_0001","75512_0001"]
#
elab_id=64
8
#
cers = ["755
86
_0001"] # Beispiel: cers = ["75511_0001","75512_0001"]
TL1_2
=
"
TLA
"
#### FM1 oder TLA
year
=
str
(
config
[
"
KS-Daten
"
][
"
Jahr
"
])
...
...
This diff is collapsed.
Click to expand it.
attachment_cer.py
+
2
−
2
View file @
7b327fa9
...
...
@@ -39,7 +39,7 @@ print(cers)
#cers = ["75559"] # Beispiel: cers = ["75511_0001","75512_0001"]
#cers = ["75562","75563"] # Beispiel: cers = ["75511_0001","75512_0001"]
exit
()
#
exit()
################### die Kalibrierscheine werden an das cer-json-dokument angehangen ##################
i
=
0
while
i
<
len
(
cers
):
...
...
@@ -61,7 +61,7 @@ while i < len(cers):
################### die Kalibrierscheine werden im Ordner Kalibrierscheine gelöscht ##################
exit
()
#
exit()
i
=
0
while
i
<
len
(
cers
):
...
...
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