Slowly going through functions cleaning them up. THis includes massive cleanup to...
[gonvert] / src / unit_data.py
index d5634f2..0714972 100644 (file)
@@ -2186,6 +2186,19 @@ _(u"Electrical Voltage"): {".base_unit": _(u"volt"),
        },
 }
 
+
+UNIT_CATEGORIES = sorted(UNIT_DESCRIPTIONS.iterkeys())
+
+
+def get_units(category):
+       units = sorted(UNIT_DESCRIPTIONS[category].iterkeys())
+
+       # do not display .base_unit description key
+       del units[0]
+
+       return units
+
+
 future_dic = {
        _(u"Wire Gauge"): {
                ".base_unit": "circular mils",