Skip to content
Snippets Groups Projects
Commit 7b327fa9 authored by Eduard Friske's avatar Eduard Friske
Browse files

Konfigdatei für Laborbuch

parent 697f65e9
No related branches found
No related tags found
No related merge requests found
......@@ -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=647
cers = ["75556_0001","75557_0001","75558_0001","75559_0001"] # Beispiel: cers = ["75511_0001","75512_0001"]
#elab_id=648
#cers = ["75586_0001"] # Beispiel: cers = ["75511_0001","75512_0001"]
TL1_2= "TLA" #### FM1 oder TLA
year = str(config["KS-Daten"]["Jahr"])
......
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment