diff --git a/cal/sections.py b/cal/sections.py index 21cdf714bfd09679601c215fab5174b67ce11359..c7b522afe0a7554a8fffd4a86cca0a10dbb5e1ad 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 1b6b8c1b25f5e6c1db766419387908a2ebcc5057..57c9c2cef99fbdb60c2d60f45e164615a21b0a63 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 29fb35af8f2a5763a08c4d3e845ba7ddf7f99876..95c9ca6bebb8eb612ae96e370645c2c0af421d6e 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 5ab664e1b8d411395091b794e1a414c91297896c..0511b471631ebf17abe95714f5ddef9814013b43 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 ba9943f4daad35afd9a6ad59f0cce49a0b43e9fc..7a67e4329e225e2aad37b9743e79d7d20edb4b0b 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])