From 25cde4675affb3af3015670b59bc57be6d9005d4 Mon Sep 17 00:00:00 2001
From: Thomas Bock <thomas.bock@ptb.de>
Date: Mon, 14 Jun 2021 15:11:05 +0200
Subject: [PATCH] sens dcc

---
 cal/sections.py      | 1 -
 cal/sections_test.py | 7 ++-----
 cal/trans.py         | 3 ++-
 cal/utils.py         | 2 +-
 server.py            | 3 ---
 5 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/cal/sections.py b/cal/sections.py
index 21cdf71..c7b522a 100644
--- a/cal/sections.py
+++ b/cal/sections.py
@@ -102,7 +102,6 @@ def get_device_class(cert):
 
 def get_todo_type(cert):
     tdos = cert.get("Meta",{}).get("kind")
-    print(tdos)
     if tdos is not None and len(tdos) > 0:
         if all([tdo == tdos[0] for tdo in tdos]):
             tdo = tdos[0]
diff --git a/cal/sections_test.py b/cal/sections_test.py
index 1b6b8c1..57c9c2c 100644
--- a/cal/sections_test.py
+++ b/cal/sections_test.py
@@ -1,8 +1,6 @@
 import unittest
 import cal.sections as sections
 
-
-
 class TestSections(unittest.TestCase):
 
     def setUp(self):
@@ -13,11 +11,11 @@ class TestSections(unittest.TestCase):
         """
         f_arr = sections.get_sub_folders(path="partials")
         self.assertTrue(len(f_arr) > 0)
-    
+
     def test_get_count_and_lang(self):
         count = sections.get_count({})
         self.assertTrue(count ==None)
-        
+
         count = sections.get_count({"Meta":{"gas":[]}})
         self.assertTrue(count ==None)
         count = sections.get_count({"Meta":{"gas":[], "lang":"en"}})
@@ -35,4 +33,3 @@ class TestSections(unittest.TestCase):
         self.assertIn("Paragraph", sec[0])
         self.assertIn("Type", sec[0]["Paragraph"][0])
         self.assertIn("Index", sec[0]["Paragraph"][0])
-        
\ No newline at end of file
diff --git a/cal/trans.py b/cal/trans.py
index 29fb35a..95c9ca6 100644
--- a/cal/trans.py
+++ b/cal/trans.py
@@ -83,7 +83,8 @@ class Trans:
         "mbar": "\\hecto\\kilogram\\metre\\tothe{-1}\\second\\tothe{-2}",
         "Pa":"\\kilogram\\metre\\tothe{-1}\\second\\tothe{-2}",
         "1/Pa":"\\kilogram\\tothe{-1}\\metre\\second\\tothe{2}",
-        "K":"\\kelvin"
+        "K":"\\kelvin",
+        "A":"\\ampere"
         }
 
     def __init__(self, config, app, db):
diff --git a/cal/utils.py b/cal/utils.py
index 5ab664e..0511b47 100644
--- a/cal/utils.py
+++ b/cal/utils.py
@@ -257,7 +257,7 @@ def dcc_result(cal_docs, gas_trans, meas_type_trans, unit_trans):
                          {"lang":"de",
                          "content":["Ergebnis für das Prüfgas {}, {}".format(de_g, de_m)]}]}
 
-        if todo_type == "error" or todo_type == "srg_error" :
+        if todo_type == "error" or todo_type == "srg_error" or todo_type == "sens":
             res["data"] = dcc_error_table(get_result_table(doc), unit_trans)["data"]
 
         if todo_type == "srg_sigma":
diff --git a/server.py b/server.py
index ba9943f..7a67e43 100644
--- a/server.py
+++ b/server.py
@@ -29,7 +29,6 @@ def inter(year_cert):
         cert = m.group(2)
 
         cal_docs = db.get_cal_docs("{}_{}".format(year, cert))
-        print(len(cal_docs))
         if not 'error' in cal_docs:
             cal_docs = utils.sort_by_pressure(cal_docs)
             cert_doc = { "_id": "cer-{year}-{cert}".format(year=year, cert=cert),
@@ -63,7 +62,6 @@ def dcc(year_cert):
 
             if request.method == 'POST':
                 res = db.save_doc(dcc_doc)
-                print(res)
                 return  utils.res_json(res)
             else:
                 return utils.res_json(dcc_doc)
@@ -77,7 +75,6 @@ def to_latex(cer_doc_id):
     if cer_doc_id:
         cert_doc = db.get_doc(cer_doc_id)
         if not 'error' in cert_doc:
-            #pprint(cert_doc)
             res = make_response(trans.cert_to_latex(cert_doc))
             res = utils.set_filename_header(res=res, no=cer_doc_id.split("-")[-1])
 
-- 
GitLab