From 94121ad1d82142fcb1e172e70058b127eef1d8f7 Mon Sep 17 00:00:00 2001 From: Ute Becker <ute.becker@ptb.de> Date: Mon, 15 Apr 2024 11:50:40 +0200 Subject: [PATCH] =?UTF-8?q?Kalibrierschein=20f=C3=BCr=20TL1=20-=20deutsch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- writeLaTex-ks-TL1.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/writeLaTex-ks-TL1.py b/writeLaTex-ks-TL1.py index f7ddd03..14f6de1 100644 --- a/writeLaTex-ks-TL1.py +++ b/writeLaTex-ks-TL1.py @@ -7,18 +7,24 @@ except ImportError: from ConfigParser import ConfigParser # ver. < 3.0 -couch = couchdb.Server('http://a73434.berlin.ptb.de:5984') -db = couch['vl_db'] # existing -config = ConfigParser() +configtl1 = ConfigParser() +ini_values = ConfigParser() # parse existing file -config.read('tl1.ini') +configtl1.read('tl1.ini') +ini_values.read('inputs.ini') # read values from a section -cal_cert = config.get('cert', 'cal_cert') -year = config.get('cert', 'year') -no = config.get('cert', 'no') -path=config.get('path', 'path') +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 CertificateDate = str(date.today()) @@ -124,9 +130,9 @@ obj ='\\object{'+ Object + '}\n' manufacturer = '\\manufacturer{' + Producer +' }\n' typ = '\\type{' + Type + '}\n' serialNo = '\\serialNo{' + Serial + '}\n' -applicant = '\\applicant{{' + Name + '}\n {' + Street + '} \n {' + Zipcode + Town +'}\n {' + Land+'}}\n' +applicant = '\\applicant{{' + Name + '}\n {' + Street + '} \n {' + Zipcode + Town +'}\n {' + Land +'}}\n' refNo = '\\refNo{ ' + ReferenceNo + '}\n' -calibMark = '\\calibMark{ ' +' ' + Certificate + ' PTB 23}\n' +calibMark = '\\calibMark{ ' +' ' + Certificate + ' PTB ' + year_str2 + '}\n' calibDate = '\\calibDate{' + MeasurementDate + '}\n' examiner = '\\examiner{' + Examiner + '}\n' certificateDate = '\\certificateDate{' + CertificateDate + '}\n' -- GitLab