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
325d9c72
Commit
325d9c72
authored
1 year ago
by
Ute Becker
Browse files
Options
Downloads
Patches
Plain Diff
Kalibrierscheine werden an das cer-document angehängt und danach im Ordner gelöscht
parent
812ad9ad
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
attachment_cer.py
+50
-20
50 additions, 20 deletions
attachment_cer.py
with
50 additions
and
20 deletions
attachment_cer.py
+
50
−
20
View file @
325d9c72
...
...
@@ -7,27 +7,57 @@ Created on Fri Jan 6 11:14:44 2023
import
pathlib
import
os
import
couchdb
try
:
from
configparser
import
ConfigParser
except
ImportError
:
from
ConfigParser
import
ConfigParser
# ver. < 3.0
configtl1
=
ConfigParser
()
ini_values
=
ConfigParser
()
# parse existing file
configtl1
.
read
(
'
tl1.ini
'
)
ini_values
.
read
(
'
inputs.ini
'
)
# read values from a section
cal_cert
=
ini_values
.
get
(
'
input_cer
'
,
'
cal_cert
'
)
year
=
ini_values
.
get
(
'
input_gen
'
,
'
year
'
)
year_str2
=
year
[
2
:]
no
=
ini_values
.
get
(
'
input_gen
'
,
'
no
'
)
path
=
configtl1
.
get
(
'
path
'
,
'
path
'
)
server
=
configtl1
.
get
(
'
couch
'
,
'
couch
'
)
db_vl
=
configtl1
.
get
(
'
couch
'
,
'
db
'
)
couch
=
couchdb
.
Server
(
server
)
db
=
couch
[
db_vl
]
# existing
RefNo
=
ini_values
.
get
(
'
bur
'
,
'
RefNo
'
)
RefNo
=
'
bur-7.5-1V-
'
+
year_str2
+
'
-
'
+
RefNo
couch
=
couchdb
.
Server
(
'
http://a73434.berlin.ptb.de:5984
'
)
db
=
couch
[
'
vl_db
'
]
# existing
print
(
RefNo
)
doc_RefNo
=
db
.
get
(
RefNo
)
year
=
"
2024
"
cers
=
doc_RefNo
[
"
Bureaucracy
"
][
"
Certificate
"
]
cers
=
[
"
75552
"
,
"
75553
"
]
# Beispiel: cers = ["75511_0001","75512_0001"]
#cers = ["75552","75553"] # Beispiel: cers = ["75511_0001","75512_0001"]
#cers = ["75562","75563"] # Beispiel: cers = ["75511_0001","75512_0001"]
################### die Kalibrierscheine werden an das cer-json-dokument angehangen ##################
i
=
0
while
i
<
len
(
cers
):
json_file
=
"
cer-
"
+
year
+
'
-
'
+
cers
[
i
]
for
cers_i
in
cers
:
print
(
cers_i
)
cers_i
=
str
(
cers_i
)
json_file
=
"
cer-
"
+
year
+
'
-
'
+
cers_i
print
(
json_file
)
doc
=
db
.
get
(
json_file
)
cer_pdf
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.pdf
"
cer_tex
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.tex
"
cer_pdf
=
"
ks-
"
+
cers
_i
+
"
-
"
+
year
+
"
.pdf
"
cer_tex
=
"
ks-
"
+
cers
_i
+
"
-
"
+
year
+
"
.tex
"
print
(
cer_pdf
,
cer_tex
)
ks_pdf
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_pdf
ks_tex
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_tex
...
...
@@ -37,21 +67,21 @@ while i < len(cers):
db
.
put_attachment
(
doc
,
content_pdf
,
cer_pdf
,
content_type
=
'
application/pdf
'
)
db
.
put_attachment
(
doc
,
content_tex
,
cer_tex
,
content_type
=
'
text/plain
'
)
i
+=
1
################### die Kalibrierscheine werden im Ordner Kalibrierscheine gelöscht ##################
i
=
0
while
i
<
len
(
cers
):
json_file
=
"
cer-
"
+
year
+
'
-
'
+
cers
[
i
]
for
cers_i
in
cers
:
cers_i
=
str
(
cers
_i
)
json_file
=
"
cer-
"
+
year
+
'
-
'
+
cers
_i
print
(
json_file
)
doc
=
db
.
get
(
json_file
)
cer_pdf
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.pdf
"
cer_tex
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.tex
"
cer_aux
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.aux
"
cer_log
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.log
"
cer_gz
=
"
ks-
"
+
cers
[
i
]
+
"
-
"
+
year
+
"
.synctex.gz
"
cer_pdf
=
"
ks-
"
+
cers
_i
+
"
-
"
+
year
+
"
.pdf
"
cer_tex
=
"
ks-
"
+
cers
_i
+
"
-
"
+
year
+
"
.tex
"
cer_aux
=
"
ks-
"
+
cers
_i
+
"
-
"
+
year
+
"
.aux
"
cer_log
=
"
ks-
"
+
cers
_i
+
"
-
"
+
year
+
"
.log
"
cer_gz
=
"
ks-
"
+
cers
_i
+
"
-
"
+
year
+
"
.synctex.gz
"
print
(
cer_pdf
,
cer_tex
)
ks_pdf
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_pdf
ks_tex
=
"
C:
\\
Users
\\
becker07
\\
kalibrierschein
\\
"
+
cer_tex
...
...
@@ -66,4 +96,4 @@ while i < len(cers):
os
.
remove
(
ks_log
)
os
.
remove
(
ks_gz
)
i
+=
1
\ No newline at end of file
\ 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