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
ba3ae7af
Commit
ba3ae7af
authored
1 year ago
by
Eduard Friske
Browse files
Options
Downloads
Patches
Plain Diff
Umbau attachment_cer auf Konfiguration
parent
7d7f454e
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
+2
-2
2 additions, 2 deletions
API-V2-elab.py
attachment_cer.py
+21
-20
21 additions, 20 deletions
attachment_cer.py
with
23 additions
and
22 deletions
API-V2-elab.py
+
2
−
2
View file @
ba3ae7af
...
@@ -59,8 +59,8 @@ today = datetime.date.today()
...
@@ -59,8 +59,8 @@ today = datetime.date.today()
########
########
elab_id
=
64
3
elab_id
=
64
7
cers
=
[
"
7555
2
_0001
"
,
"
7555
3
_0001
"
]
# Beispiel: cers = ["75511_0001","75512_0001"]
cers
=
[
"
7555
6
_0001
"
,
"
7555
7_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
=
"
2024
"
...
...
This diff is collapsed.
Click to expand it.
attachment_cer.py
+
21
−
20
View file @
ba3ae7af
...
@@ -5,19 +5,19 @@ Created on Fri Jan 6 11:14:44 2023
...
@@ -5,19 +5,19 @@ Created on Fri Jan 6 11:14:44 2023
@author: becker07
@author: becker07
"""
"""
import
p
ath
lib
from
pathlib
import
P
ath
import
os
import
os
import
couchdb
import
couchdb
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
"
])
year
=
"
2024
"
year
=
str
(
config
[
"
KS-Daten
"
][
"
Jahr
"
])
cers
=
[
"
7555
2
"
,
"
75553
"
]
# Beispiel: cers = ["75511_0001","75512_0001"]
cers
=
[
"
7555
9
"
]
# Beispiel: cers = ["75511_0001","75512_0001"]
#cers = ["75562","75563"] # Beispiel: cers = ["75511_0001","75512_0001"]
#cers = ["75562","75563"] # Beispiel: cers = ["75511_0001","75512_0001"]
################### die Kalibrierscheine werden an das cer-json-dokument angehangen ##################
################### die Kalibrierscheine werden an das cer-json-dokument angehangen ##################
...
@@ -29,11 +29,11 @@ while i < len(cers):
...
@@ -29,11 +29,11 @@ while i < len(cers):
cer_pdf
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.pdf
"
cer_pdf
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.pdf
"
cer_tex
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.tex
"
cer_tex
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.tex
"
print
(
cer_pdf
,
cer_tex
)
print
(
cer_pdf
,
cer_tex
)
ks_pdf
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_pdf
ks_pdf
=
path
.
joinpath
(
cer_pdf
)
ks_tex
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_tex
ks_tex
=
path
.
joinpath
(
cer_tex
)
print
(
ks_pdf
,
ks_tex
)
print
(
ks_pdf
,
ks_tex
)
content_pdf
=
pathlib
.
Path
(
ks_pdf
)
.
read_bytes
()
content_pdf
=
ks_pdf
.
read_bytes
()
content_tex
=
pathlib
.
Path
(
ks_tex
)
.
read_bytes
()
content_tex
=
ks_tex
.
read_bytes
()
db
.
put_attachment
(
doc
,
content_pdf
,
cer_pdf
,
content_type
=
'
application/pdf
'
)
db
.
put_attachment
(
doc
,
content_pdf
,
cer_pdf
,
content_type
=
'
application/pdf
'
)
db
.
put_attachment
(
doc
,
content_tex
,
cer_tex
,
content_type
=
'
text/plain
'
)
db
.
put_attachment
(
doc
,
content_tex
,
cer_tex
,
content_type
=
'
text/plain
'
)
...
@@ -41,6 +41,7 @@ while i < len(cers):
...
@@ -41,6 +41,7 @@ while i < len(cers):
################### die Kalibrierscheine werden im Ordner Kalibrierscheine gelöscht ##################
################### die Kalibrierscheine werden im Ordner Kalibrierscheine gelöscht ##################
exit
()
i
=
0
i
=
0
while
i
<
len
(
cers
):
while
i
<
len
(
cers
):
...
@@ -53,17 +54,17 @@ while i < len(cers):
...
@@ -53,17 +54,17 @@ while i < len(cers):
cer_log
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.log
"
cer_log
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.log
"
cer_gz
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.synctex.gz
"
cer_gz
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.synctex.gz
"
print
(
cer_pdf
,
cer_tex
)
print
(
cer_pdf
,
cer_tex
)
ks_pdf
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_pdf
ks_pdf
=
path
.
joinpath
(
cer_pdf
)
ks_tex
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_tex
ks_tex
=
path
.
joinpath
(
cer_tex
)
ks_aux
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_aux
ks_aux
=
path
.
joinpath
(
cer_aux
)
ks_log
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_log
ks_log
=
path
.
joinpath
(
cer_log
)
ks_gz
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_gz
ks_gz
=
path
.
joinpath
(
cer_gz
)
print
(
ks_pdf
,
ks_tex
)
print
(
ks_pdf
,
ks_tex
)
os
.
remove
(
ks_pdf
)
ks_pdf
.
unlink
(
missing_ok
=
True
)
os
.
remove
(
ks_tex
)
ks_tex
.
unlink
(
missing_ok
=
True
)
os
.
remove
(
ks_aux
)
ks_aux
.
unlink
(
missing_ok
=
True
)
os
.
remove
(
ks_log
)
ks_log
.
unlink
(
missing_ok
=
True
)
os
.
remove
(
ks_gz
)
ks_gz
.
unlink
(
missing_ok
=
True
)
i
+=
1
i
+=
1
\ No newline at end of file
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