Fixing a regex mistake
[gonvert] / src / unit_data.py
index d5634f2..a5ce831 100644 (file)
@@ -422,7 +422,7 @@ UNIT_DESCRIPTIONS = {
                [(converters.m, 1.0e-6), u"\xb5A", ''],
                _(u"nanoampere"):
                [(converters.m, 1.0e-9), "nA", ''],
-               _(u"math.picoampere"):
+               _(u"picoampere"):
                [(converters.m, 1.0e-12), "pA", ''],
                _(u"abampere"):
                [(converters.m, 10.0), "abA", _(u"The CGS electromagnetic unit of current.")],
@@ -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",