diff options
| author | Santosh Sivaraj <santosiv@in.ibm.com> | 2015-05-11 20:38:16 +0530 |
|---|---|---|
| committer | Santosh Sivaraj <santosiv@in.ibm.com> | 2016-11-09 19:42:34 +0530 |
| commit | f3a73de95bbcebe6d8a746f50c30913fab63d7bc (patch) | |
| tree | f270be7a85e5c9426ef10cde0fbc870756924151 /catalog/formulae.py | |
| parent | 6d21f396ac18c18db0a53af63d0f341121256c94 (diff) | |
| download | ima-catalog-f3a73de95bbcebe6d8a746f50c30913fab63d7bc.tar.gz ima-catalog-f3a73de95bbcebe6d8a746f50c30913fab63d7bc.zip | |
Add unit field to the formula
Signed-off-by: Santosh Sivaraj <santosiv@in.ibm.com>
Diffstat (limited to 'catalog/formulae.py')
| -rw-r--r-- | catalog/formulae.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/catalog/formulae.py b/catalog/formulae.py index e64fd9c..684f1fe 100644 --- a/catalog/formulae.py +++ b/catalog/formulae.py @@ -8,8 +8,7 @@ def formula_pack(formula): # First pack the header header = pack(">xxIH6x", formula['flag'], formula['group']) - st = header + pack_text(formula['name']) + pack_text(formula['desc']) + pack_text(formula['formula']) - + st = header + pack_text(formula['name']) + pack_text(formula['desc']) + pack_text(formula['formula']) + pack_text(formula['unit']) t = pad16(st) # this also adds the length return t @@ -27,12 +26,13 @@ def pack_formulae(formulae_csv): formula['name'] = row['Formula Name'] formula['desc'] = row['Formula Description'] formula['formula'] = row['Formula'] + formula['unit'] = row['Unit'] + formula['group'] = int(row['Group']) + if row['Grouped'] == 'y': formula['flag'] = 0x04 - formula['group'] = int(row['Group']) else: formula['flag'] = 0 - formula['group'] = 0 formulae += formula_pack(formula) |

